织梦dedecms5.7栏目列表首页与第一页重复的解决办法

企鹅博客 2019年7月13日07:24:06 发表评论 340 views

今天有位站长来咨询小编,他说用dedecms5.7建的站,最近发现栏目列表首页与第一页重复,这个问题不知道应该如何解决,去论坛搜索也发现不少这样的问题。现在小编就来告诉大家应该如何处理栏目列表首页与第一页重复的问题吧。 

dede5.7栏目列表首页与第一页重复的解决办法 

首先,操作前注意备份文件。代码中的网址记得替换成自己的。 

1,找到\include\arc.listview.class.php这个文件,将 

$typedir= ereg_replace(‘{cmspath}’,$GLOBALS['cfg_cmspath'],$this->Fields['typedir']); 

这段代码添加到”//获得上一页和主页的链接”前面; 

2,找到下面几行代码(就在”//获得上一页和主页的链接”下面) 

if($this->PageNo != 1) 



$prepage.=”<li><a rel="external nofollow" target="_blank" href="https://www.qieseo.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy54eHguY29tL2xlYXJuaW5nL+KAmeKAnS5zdHJfcmVwbGFjZSjigJwlN0JwYWdlJTdE4oCdLCRwcmVwYWdlbnVtLCR0bmFtZXJ1bGUpLuKAneKAmA==">上一页</a></li>/r/n”;%3C/div> 

$indexpage=”<li><a rel="external nofollow" target="_blank" href="https://www.qieseo.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy54eHguY29tL2xlYXJuaW5nL+KAmeKAnS5zdHJfcmVwbGFjZSjigJwlN0JwYWdlJTdE4oCdLDEsJHRuYW1lcnVsZSku4oCd4oCY">首页</a></li>/r/n”;%3C/div> 



改成: 

if($this->PageNo != 1) 



if($prepagenum==1) 



$prepage.=”<li><a rel="external nofollow" target="_blank" href="https://www.qieseo.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy54eHguY29tL+KAnSUyMi4kdHlwZWRpci7igJ0vL+KAnQ==">上一页</a></li>/r/n”;%3C/div> 



else 



$prepage.=”<li><a rel="external nofollow" target="_blank" href="https://www.qieseo.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy54eHguY29tL+KAnSUyMi5zdHJfcmVwbGFjZSjigJwlN0JwYWdlJTdE4oCdLCRwcmVwYWdlbnVtLCR0bmFtZXJ1bGUpLuKAnS/igJ0=">上一页</a></li>/r/n”;%3C/div> 



$indexpage=”<li><a rel="external nofollow" target="_blank" href="https://www.qieseo.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy54eHguY29tL+KAnSUyMi4kdHlwZWRpci7igJ0vL+KAnQ==">首页</a></li>/r/n”;%3C/div> 



3.找到 

$listdd.=”<a rel="external nofollow" target="_blank" href="https://www.qieseo.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy54eHguY29tL2xlYXJuaW5nL+KAmeKAnS5zdHJfcmVwbGFjZSjigJwlN0JwYWdlJTdE4oCdLCRqLCR0bmFtZXJ1bGUpLuKAneKAmA==">”.$j.”</a>/r/n”;%3C/div> 

改成: 

if($j==1) 



$listdd.=”<li><a rel="external nofollow" target="_blank" href="https://www.qieseo.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy54eHguY29tL+KAnSUyMi4kdHlwZWRpci7igJ0vL+KAnQ==">”.$j.”</a></li>/r/n”;%3C/div> 



else 



$listdd.=”<li><a rel="external nofollow" target="_blank" href="https://www.qieseo.com/wp-content/themes/begin/go.php?url=aHR0cDovL3d3dy54eHguY29tL+KAnSUyMi5zdHJfcmVwbGFjZSjigJwlN0JwYWdlJTdE4oCdLCRqLCR0bmFtZXJ1bGUpLuKAnS/igJ0=">”.$j.”</a></li>/r/n”;%3C/div> 



最后一个关键的: 

把$optionlist .= “<option value="’”.str_replace(“{page}”,$mjj,$tnamerule).”‘" selected="selected">$mjj</option>\r\n”; 

改成if($mjj==1) 

{$optionlist .= “<option value="’”.$typedir.”/’" selected="selected">$mjj</option>\r\n”;} 

else{$optionlist .= “<option value="’”.str_replace(“{page}”,$mjj,$tnamerule).”‘" selected="selected">$mjj</option>\r\n”;} 

把$optionlist .= “<option value="’”.str_replace(“{page}”,$mjj,$tnamerule).”‘">$mjj</option>\r\n”; 

改成if($mjj==1) 

{$optionlist .= “<option value="’”.$typedir.”/’">$mjj</option>\r\n”;} 

else{ 

$optionlist .= “<option value="’”.str_replace(“{page}”,$mjj,$tnamerule).”‘">$mjj</option>\r\n”;} 

只需要4步就完成了

除非注明,否则均为@企鹅博客原创文章,转载必须以链接形式标明本文链接

本文链接:https://www.qieseo.com/33567.html

weinxin
欢迎加入中国SEO站长博客之家
本站的所有资源都会上传分享到博客之家,希望大家互相学习交流进步。
企鹅博客

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: