Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of setting pseudo-static of TAG label in DedeCMS 5.7system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

这篇文章将为大家详细讲解有关设置DedeCMS 5.7系统TAG标签伪静态的方法,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

DedeCMS 5.7系统TAG标签伪静态怎么设置?

1.修改前台显示链接

我们这里达到的效果就是使原来/tags.php?keywors更改为/tags/keywords.html。

这里主要修改下调用的标签,在include/tag/libtag.lib.php中,在87行找到

代码如下:

$row['link'] = $cfg_cmsurl."/tags?".urlencode($row['keyword']);

将其改为:

代码如下:

$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword']).".html";

2.修改分页代码

我们需要修改include/arc.taglist.class.php,将分页函数替换为:

代码如下:

/** * 获取动态的分页列表** @access public* @param int $list_len 列表宽度* @param string $listitem 列表样式* @return string*/function GetPageListDM($list_len,$listitem="info,index,end,pre,next,pageno"){$prepage="";$nextpage="";$prepagenum = $this->PageNo - 1;$nextpagenum = $this->PageNo + 1;if($list_len == "" || preg_match("/[^0-9]/", $list_len)){$list_len = 3;}$totalpage = $this->TotalPage;if($totalpage TotalResult > 0){return "共1页/".$this->TotalResult."条";}if($this->TotalResult == 0){return "共0页/".$this->TotalResult."条";}$maininfo = "共{$totalpage}页/".$this->TotalResult."条rn";$purl = $this->GetCurUrl();$basename = basename($purl);$tmpname = explode('.', $basename);$purl = str_replace($basename, '', $purl).urlencode($this->Tag);//var_dump($purl);exit;//$purl .= "?/".urlencode($this->Tag);//获得上一页和下一页的链接if($this->PageNo != 1){$prepage.="上一页rn";$indexpage="首页rn";}else{$indexpage="首页rn";}if($this->PageNo!=$totalpage && $totalpage>1){$nextpage.="下一页rn";$endpage="末页rn";}else{$endpage="末页rn";}//获得数字链接$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; $jPageNo){$listdd.= "$jrn";}else{$listdd.="".$j."rn";}}$plist = '';if(preg_match('/info/i', $listitem)){$plist .= $maininfo.' ';}if(preg_match('/index/i', $listitem)){$plist .= $indexpage.' ';}if(preg_match('/pre/i', $listitem)){$plist .= $prepage.' ';}if(preg_match('/pageno/i', $listitem)){$plist .= $listdd.' ';}if(preg_match('/next/i', $listitem)){$plist .= $nextpage.' ';}if(preg_match('/end/i', $listitem)){$plist .= $endpage.' ';}return $plist;}

3.设置伪静态规则

我们这里以iis7为例子,设置以下规则:

代码如下:

可以直接保存为web.config放在站点根目录。

4.重新生成html页面

这个操作就不用说了,全部重新生成下,至此全部修改完毕。

关于设置DedeCMS 5.7系统TAG标签伪静态的方法就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report