ecshop首页生成纯静态页插件

ECSHOP首页生成纯静态页插件
ECSHOP默认没有生成静态功能,当您的网站访问量比较大,使用该插件即可把ecshop的网站的首页生成html,减小服务器的压力,让ecshop首页打开得更快一点。该功能非常实用,媲美市面同样功能的千元商业插件。
按照以下两步即可实现ECSHOP生成index.html静态首页功能
第一步:打开admin/templates/top.htm找到以下代码
<a href="index.php?act=clear_cache" target="main-frame" class="fix-submenu">{$lang.clear_cache}</a>
前面加上以下代码
<a href="../creat_index.php" target="main-frame" class="fix-submenu">生成静态首页</a>
第二步:增加生成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>
然后将creat_index.php文件放在网站根目录OK了。
插件效果截图:
ecshop首页生成纯静态页插件
后台右上部,点击“生成静态首页”即可。

本文原创地址:https://www.ecshopok.com/article-643.html
版权所有 © 转载时必须以链接形式注明出处!

觉得本文对您有用,想收藏下来!方法很简单:请点击-〉
我们一直坚持白天工作、晚上熬夜更新资源,付出了巨大的精力和时间,其中的辛酸难以言述。

文章评论

暂无评论,来发表一个吧

发表 取消
充值有惊喜 ECSHOP插件网微信客服edait_cn