ecshop2.7.0首页静态化程序
2009-12-19 10:49 来源:www.chinab4c.com 作者:admin
ecshop争论的最厉害的,就是如何实现静态化,现在的ecshop都是伪静态,虽然说对seo影响不是很大,但是对于一个站的负荷来说,还是有必然的弊端.今天测试过,通过文件读写技术,可以实现ecshop首页真静态化.生成实在的html.这个没有任何问题的。
1:生成index.html
<?
if(!file_exists("index.html")){
$f = fopen("index.html","w");
fwrite($f,file_get_contents("http://localhost/e/270/ceshi/index.php"));
fclose($f);
}
?>
2:member_info.lbi要处理,通过ajax调用信息
<div id="append_parent"></div>
<script>
sss();
function sss(){
Ajax.call( 'm.php', '1', backtt , 'GET', 'TEXT', true, true );
}
function backtt(result){
document.getElementById('infot').innerHTML = result;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<p id="infot"></p>
3:动态ajax调用信息.
<?
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
if($_SESSION[user_id]){
$str = ' <font style="position:relative; top:10px;">'.'您好<font class="f4_b">'.$_SESSION[user_name].'</font>, 欢迎您回来!'.'<a href="user.php">用户中心</a>|<a href="user.php?act=logout">退出</a></font>';
echo $str.$a.$b;
}else{
echo ' <a href="user.php"><img src="themes/default/images/bnt_log.gif" /></a><a href="user.php?act=register"><img src="themes/default/images/bnt_reg.gif" /></a>';
}
?>
4:index.php中需要修改.如果存在index.html.要跳转过去.
这样就完成了ecshop首页的真静态过程。
来源:中国B4C电子商务
最近更新
常用插件
- ecshop按买满件数计算折扣
ecshop促销 管理当中,你可以增加不同的优惠活动,有按折扣优惠的,有...
- ecshop品牌馆楼层插件
ecshop品牌馆楼层插件,这个插件是通过对ecshop品牌功能的修改将ecshop的品...
- ecshop订单信息发货单打印
ecshop使用过程中,常常有人对ecshop订单的功能提出需求.我们在ecshop后台...
- ecshop后台商品列表编辑属
ecshop后台商品列表编辑属性规格,这个功能十分重要,当我们在后台,录...
- ecshop强力批量删除订单插
ecshop强力批量删除订单插件V1.0,可以批量强力的删除任何状态的订单。...



