DEDECMS列表伪静态修改

softyun3年前cms教程112

打开inc_arclist_view.php
查找
//---------------------------------
//获取动态的分页列表
//---------------------------------

对比以下代码修改
function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno")
{
$prepage="";
$nextpage="";
$prepagenum = $this->PageNo-1;
$nextpagenum = $this->PageNo+1;
if($list_len==""||ereg("[^0-9]",$list_len)) $list_len=3;
$totalpage = ceil($this->TotalResult/$this->PageSize);
if($totalpage<=1 && $this->TotalResult>0) return "共1页/".$this->TotalResult."条记录";
if($this->TotalResult == 0) return "共0页".$this->TotalResult."条记录";
$maininfo = "共{$totalpage}页/".$this->TotalResult."条记录";

$purl = $this->GetCurUrl();
$geturl = "typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
$gettypeid =$this->TypeID."-";
//$hidenform = "<input type='hidden' name='typeid' value='".$this->TypeID."'>\r\n";
//$hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>\r\n";

$purl .= "?".$geturl;

//获得上一页和下一页的链接
if($this->PageNo != 1){
$prepage.="<a href='list-".$gettypeid."$prepagenum'>上一页</a>";
$indexpage="<a href='list-".$gettypeid."1'>首页</a>";
}
else{
$indexpage="首页";
}

if($this->PageNo!=$totalpage && $totalpage>1){
$nextpage.="<a href='list-".$gettypeid."$nextpagenum'>下一页</a>";
$endpage="<a href='list-".$gettypeid."$totalpage'>末页</a>";
}
else{
$endpage="末页";
}
//获得数字链接
$listdd="";
$total_list = $list_len * 2 + 1;
if($this->PageNo >= $total_list) {
$j = $this->PageNo-$list_len;
$total_list = $this->PageNo+$list_len;
if($total_list>$totalpage) $total_list=$totalpage;
}else{
$j=1;
if($total_list>$totalpage) $total_list=$totalpage;
}
for($j;$j<=$total_list;$j++){
$listdd.="<a href='list-".$gettypeid."$j'>".$j."</a>";
}
$plist .= $maininfo.$indexpage.$prepage.$listdd.$nextpage.$endpage;
return $plist;
}

打开inc_channel_unit_functions.php

查找
$reurl = $GLOBALS["cfg_plus_dir"]."/list.php?tid=".$typeid;

改成
//$reurl = $GLOBALS["cfg_plus_dir"]."/list.php?tid=".$typeid;
$reurl = "/list-".$typeid."";

增加.htaccess文件

内容为
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)list-([0-9]+)\$ $1/plus/list.php?tid=$2
RewriteRule ^(.*)list-([0-9]+)-([0-9]+)\$ $1/plus/list.php?typeid=$2&PageNo=$3
</IfModule>

官方原帖:42132&3

免责声明:本文内容来自用户上传并发布,站点仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请核实广告和内容真实性,谨慎使用。

相关文章

DEDE5.3隆重盛大发布,无忧鼎力支持!

经过众多DEDE爱好者测试完善后的DEDECMS 5.3正式版在今天12月10日这个特别的日子发布了.今天,广大织梦爱好者的心情都无比激动,论坛的火爆程度更是国内CMS行业中前所未有的,短短几个小时,...

Safe Alert: Request Error step 1 ! 解决方法

出现Safe Alert: Request Error step 1 ! 的解决方法这是由于新版中使用了SQL语句防注入功能引了的安全警告,在自定义模模型中使用了下面名称union|sleep|ben...

sonchannel 子栏目调用标签的使用教程

今天给大家分享一下sonchannel子栏目调用标签的使用教程,需要的朋友可以记录一下哦标签名称:sonchannel功能说明:子栏目调用标签适用范围:全局使用基本语法:{dede:sonchanne...

dedecms在plus目录调用当前模板head.htm,footer.htm方法

在织梦dedecms的plus文件夹里面有许多常用的模板的头部和尾部都是单独的写的,最简单的方法就是把默认模板的head.htm和footer.htm复制过来就行了,只是每次修改后又要再复制一次,为了...

arclist标签中调用附加表字段

将需要调用的字段,换成如下格式放在arclist标签内即可.代码如下:[field:id runphp="yes"]$dsql = new DedeSql(false);$a="SELECT mb5u...

DEDECMS V5.3 官方默认模板 预设列表样式说明

DEDECMS V5.3在(layout.css)中预设了6种区块列表样式 您可以根据自己的实际需要修改使用 下面以首页区块调用位置为例 我们来详细介绍这六种列表样式的结构和class 首页模板的&l...