您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop首页生成纯静态页插件
曼文2023-12-17 22:25:05ecshop商城教程已有人查阅
导读如果网站访问量比较大,我们可以把ecshop的网站的首页生成html,减小服务器的压力,让ecshop首页打开得更快一点实现这个可以按以下两步完成:
ecshop首页生成静态首页插件如果网站访问量比较大,我们可以把ecshop的网站的首页生成html,减小服务器的压力,让ecshop首页打开得更快一点实现这个可以按以下两步完成:
一、打开admin/templates/top.htm
二、前台增加生成html的php文件_creat_index.php
一、打开admin/templates/top.htm
<div id="send_info" style="padding: 5px 10px 0 0; clear:right;text-align: right; color: #FF9900;width:40%;float: right;">
{if $send_mail_on eq 'on'}
<span id="send_msg"><img src="images/top_loader.gif" width="16" height="16" alt="{$lang.loading}" style="vertical-align: middle" /> {$lang.email_sending}</span>
<a href="javascript:;" onClick="Javascript:switcher()" id="lnkSwitch" style="margin-right:10px;color: #FF9900;text-decoration: underline">{$lang.pause}</a>
{/if}
<a href="index.php?act=clear_cache" target="main-frame" class="fix-submenu">{$lang.clear_cache}</a>
<a href="privilege.php?act=logout" target="_top" class="fix-submenu">{$lang.signout}</a>
</div>
修改成
<div id="send_info" style="padding: 5px 10px 0 0; clear:right;text-align: right; color: #FF9900;width:40%;float: right;">
{if $send_mail_on eq 'on'}
<span id="send_msg"><img src="images/top_loader.gif" width="16" height="16" alt="{$lang.loading}" style="vertical-align: middle" /> {$lang.email_sending}</span>
<a href="javascript:;" onClick="Javascript:switcher()" id="lnkSwitch" style="margin-right:10px;color: #FF9900;text-decoration: underline">{$lang.pause}</a>
{/if}
<a href="../_creat_index.php" target="main-frame" class="fix-submenu">生成静态首页</a>
<a href="index.php?act=clear_cache" target="main-frame" class="fix-submenu">{$lang.clear_cache}</a>
<a href="privilege.php?act=logout" target="_top" class="fix-submenu">{$lang.signout}</a>
</div>
增加生成静态页的后台操作链接二、前台增加生成html的php文件_creat_index.php
<?php
define('IN_ECS', true);
define('INIT_NO_USERS', true);
define('INIT_NO_SMARTY', true);
require(dirname(__FILE__) . '/includes/init.php');
$site_url = rtrim($ecs->url(),'/');
$index_file = ROOT_PATH . 'index.html';
$source_url = $site_url . '/index.php';
file_put_contents($index_file, file_get_contents($source_url), LOCK_EX);
?>
done! <a href="<?php echo $site_url; ?>" target="_blank">go to index</a>
本文标签:
很赞哦! ()
相关文章
随机图文
-
ecshop商城任意位置调用新文章的方法
欢迎大家来到代码号,今天为大家讲解下,ECSHOP商城任意位置调用文章方法,希望对大家有帮助!ECSHOP文章调用_ECSHOP商城任意位置调用很新文章方法: -
ecshop商品属性库存仿淘宝属性库存联动显示的方法
ECSHOP有个货品功能,就是可以单独给商品的尺码、颜 设置库存。但是商品详情页却只能显示部库存。如果有个属 无货了,也不知道。本ECSHOP教程即可实现 -
ecshop商品页发表评论时取消E-MAIL必填的方法
ECSHOP的商品详情页,在用户提交评论的时候,那个“E-MAIL”输入框默认是“必填”的。如果我想改成“E-MAIL非必填”或者干脆 -
ecshop首页上显示最新评论及评论内容和时间的方法
本教程以“ECSHOP2.7.2 + 官方默认模板” 为例,其他模板大同小异,步骤一:将下面代码 ,并保存为一个库文件,文件名和保存路径为
留言与评论 (共有 条评论) |