DEDECMS如何点击图片进入下一页?
现在很多以DEDEECMS为门户的人都有图片或者图集频道,一些站长为了增加知名度也推出了这样的频道。对于使用DEDEECMS搭建网站的站长来说,他们最想要的就是点击图片进入下一页。
开门见山,特点就是:不修改源代码,只做模板上的处理。
修改include/arc.archives.class.php
1.找到“//解析模板,给内容的变化赋值。”将以下代码添加到这段文字中:
代码如下:
函数ClickPicNext($ismake=1,$aid,amp$body)
{
global $ cfg _ rewrite
if($ this -gt;NowPage!= $ this -gt;总页数)
{
$lPage=$this-gt。now page+1;
如果($ismake=0)
{
$ body = preg _ replace(quot;/lt;(img|IMG)。*)(SRC | SRC)=[\\ quot;|#39;| ]{0,}((.*)gt;)/ISU quot;,quot单击图片进入下一页lt;br/gt。lt;a href = # 39quot。$ this -gt;名字优先。_ quot。$ lPage.quot。quot。$ this -gt;简称。quot;#39;gt;quot。quot\\ $ { 0 } quot。quotlt;/AGT;quot,$ body);
}
其他
{
$ PageList = quotlt;a href = # 39view.php?aid = $ aidamppageno = $ lPage # 39gt;quot。quot\\ $ { 0 } quot。quotlt;/AGT;quot;
if($ CFG _ rewrite = = # 39;Y # 39)
{
$ PageList = str _ replace(quot;。php?aid = quot,quot-quot;,$ PageList);
$ PageList = preg _ replace(quot;/amp。pageno =(\\ d+)/iquot;,#39;-\\ \\ 1 . html # 39;,$ PageList);
}
$ body = preg _ replace(quot;/lt;(img|IMG)。*)(SRC | SRC)=[\\ quot;|#39;| ]{0,}((.*)gt;)/ISU quot;,$PageList,$ body);
}
}
其他
{
$ body = preg _ replace(quot;/lt;(img|IMG)。*)(SRC | SRC)=[\\ quot;|#39;| ]{0,}((.*)gt;)/ISU quot;,$ this -gt;GetPreNext(# 39;imgnext # 39)、$ body);
}
return $ body
}
2、找到$ this -gt;字段[$ this -gt;split pagefield]= $ this -gt;split fields[$ page no -1];在其下方添加。
if($ClickPicNext){
$ this -gt;字段[$ this -gt;split pagefield]= $ this -gt;字段[$ this -gt;split pagefield];
}否则{
$ this -gt;字段[$ this -gt;split pagefield]= $ this -gt;点击PicNext($ismake,$ this -gt;字段[# 39;id # 39],$ this -gt;字段[$ this -gt;split pagefield]);
}
3、找到$ this -gt;PreNext[# 39;下一个# 39;]= quot;下一个:lt;a href = # 39$ mlink # 39gt;{ $ next row[# 39;标题# 39;]} lt;/AGT;quot;在其下方添加。
$ this -gt;PreNext[# 39;imgnext # 39]= quot;lt;a href = # 39$ mlink # 39gt;quot。quot\\ $ { 0 } quot。quotlt;/AGT;quot;
4、找到$ this -gt;PreNext[# 39;下一个# 39;]= quot;下一篇文章:没有quot;在其下方添加。
$ this -gt;PreNext[# 39;imgnext # 39]= quot;\\ $ { 0 } quot;登录后复制
