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 TAG tag and paging pseudo-static in DedeCMS system

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

What is the method of setting TAG tags and paging pseudo-static in DedeCMS system? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

DedeCMS system TAG tags and paging pseudo-static how to set?

Now many CMS systems have TAGS tag this function, the well-known DEDECMS also has, but its tag function is very poor, not conducive to seo optimization, while there are many problems, such as: the current page does not exist on the page, the link for the "- 1" problem, and the emergence of "the system does not have this tag, may have been removed" problem.

Today, the editor will teach you to put the tag pseudo-static (some of the data comes from the network), but also fixed some of the above-mentioned BUG.

1. Modify the front desk display link

What we have achieved here is to change the original / tags.php?keywors to / tags/keywords.html.

The main modification here is the call tag, found on line 87 in / include/taglib/tag.lib.php

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

Change it to:

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

two。 Modify the paging code section

We need to modify the include/arc.taglist.class.php, find the paging function, and replace it with:

/ * get dynamic paging list * * @ access public * @ param int $list_len list width * @ param string $listitem list style * @ 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 page /". $this- > TotalResult. " Bar ";} if ($this- > TotalResult = = 0) {return" of 0 pages /. $this- > TotalResult. " Bar ";} $maininfo =" total {$totalpage} pages / ". $this- > TotalResult." \ r\ n "; $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) / / get a link to the previous page and the next page / / if ($this- > page Notebook = 1) this fixes the problem that the previous page was negative if ($this- > page Notebook = 1 & & $this- > page Notebook = "") {$prepage.= "previous page\ r\ n"; $indexpage= "home page\ r\ n";} else {$indexpage= "home page\ r\ n";} if ($this- > PageNottable page page & & $totalpage > 1) {$nextpage.= "next page\ r\ n" $endpage= "last page\ r\ n";} else {$endpage= "last page\ r\ n";} / / get the digital link $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 {$jj1; if ($total_list > $totalpage) {$total_list = $totalpage }} for ($j; $jPageNo) {$listdd.= "$j\ r\ n";} else {$listdd.= ". $j."\ r\ n ";}} $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. Set pseudo-static rules

Let's take iis7 as an example and set the following rules:

Thank you for reading! After reading the above, do you have a general understanding of the methods of setting TAG tags and paging pseudo-statics in DedeCMS systems? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

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