织梦链接地址和html名字不一样,【图片】dedecms织梦移动版伪静态-实现与PC电脑版静态地址url一致教程_织梦吧_百度贴吧...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

3.\m\index.php 修改成永远是动态,不生成index.html

把里面的

$row['showmod'] = isset($row['showmod'])? $row['showmod'] : 0;

if ($row['showmod'] == 1)

{

$pv->SaveToHtml(dirname(__FILE__).'/index.html');

include(dirname(__FILE__).'/index.html');

exit();

} else {

$pv->Display();

exit();

}

改成

$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);

$pv->Display();

exit();

4.\m\list.php 增加伪静态判断

把里面的

$tid = (isset($tid) && is_numeric($tid) ? $tid : 0);

改成

if($cfg_rewritem == 'Y')

{

$typedir = parse_url($tid, PHP_URL_PATH);

$PageNo = stripos(GetCurUrl(), '.html') ? intval(str_replace('.html', '', end(explode("_", GetCurUrl())))) : 1;

$tinfos = $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE typedir='/$typedir' or typedir='{cmspath}/$typedir'");

if(is_array($tinfos))

{

$tid = $tinfos['id'];

$typeid = GetSonIds($tid);

$row = $dsql->GetOne("Select count(id) as total From `dede_archives` where typeid in({$typeid})");

$TotalResult = is_array($row) ? $row['total'] : 0;

}

else

{

$tid = 0;

}

}

else

{

$tid = (isset($tid) && is_numeric($tid) ? $tid : 0);

}

5.\m\view.php 增加伪静态判断

$t1 = ExecTime();

下面加入

if($cfg_rewritem == 'Y')

{

$aid = stripos(GetCurUrl(), '.html') ? intval(str_replace('.html', '', end(explode("/", GetCurUrl())))) : 0;

}

6.\include\arc.listview.class.php 增加移动版伪静态分页功能,找到

global $cfg_rewrite;

改成

global $cfg_rewrite,$cfg_rewritem;

继续找到

$geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";

$purl .= '?'.$geturl;

改成

if($cfg_rewritem == 'Y')

{

$purl = "";

}

else

{

$geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";

$purl .= '?'.$geturl;

}

继续找到下面的

return $plist;

在它的上面加入

if($cfg_rewritem == 'Y')

{

$plist = preg_replace("/PageNo=(\d+)/i",'list_'.$this->TypeID.'_\\1.html',$plist);

}

002ac71bdfe9619ca360935aab157caf.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值