欢迎来到站长天空!

DedeCMS

当前位置: 主页 > CMS教程 > DedeCMS

DEDECMS点击图片进入下一页功能实现教程

时间:2020-11-05 00:00:00|栏目:DedeCMS|点击:

">

关于使用Phpcms程序的站长,请参照站长天空以前发表过的PhpCMS点击图片进入下一页教程,那么DedeCMS能否实现呢,回答是可以的,今天站长天空将方法告诉大家。
直接入正题,特点是:不修改源码,只在模板上做处理。
修改 include/arc.archives.class.php
1.查找"//解析模板,对内容里的变动进行赋值"在这段话上面添加以下代码 :

代码如下:
function ClickPicNext($ismake=1,$aid,&$body)
{
global $cfg_rewrite;
if($this->NowPage!=$this->TotalPage)
{
$lPage=$this->NowPage+1;
if($ismake=0)
{
$body=preg_replace("/<(img|IMG)(.*)(src|SRC)=["|'| ]{0,}((.*)>)/isU","点击图片,进入下一页
"."${0}"."",$body);
}
else
{
$PageList=""."${0}"."";
if($cfg_rewrite == 'Y')
{
$PageList = str_replace(".php?aid=","-",$PageList);
$PageList = preg_replace("/&pageno=(d+)/i",'-1.html',$PageList);
}
$body=preg_replace("/<(img|IMG)(.*)(src|SRC)=["|'| ]{0,}((.*)>)/isU",$PageList,$body);
}
}
else
{
$body=preg_replace("/<(img|IMG)(.*)(src|SRC)=["|'| ]{0,}((.*)>)/isU",$this->GetPreNext('imgnext'),$body);
}
return $body;
}

2,查找$this->Fields[$this->SplitPageField] = $this->SplitFields[$pageNo - 1]; 在其下面添加
if($ClickPicNext){
$this->Fields[$this->SplitPageField]=$this->Fields[$this->SplitPageField];
}else{
$this->Fields[$this->SplitPageField]=$this->ClickPicNext($ismake,$this->Fields['id'],$this->Fields[$this->SplitPageField]);
}
3,查找$this->PreNext['next'] = "下一篇:{$nextRow['title']} ";在其下面添加
$this->PreNext['imgnext'] =""."${0}"."";
4,查找$this->PreNext['next'] = "下一篇:没有了 ";在其下面添加
$this->PreNext['imgnext'] ="${0}";
5.查找
else if($gtype=='next')
{
$rs = $this->PreNext['next'];
}
在其下面添加

代码如下:
else if($gtype=='imgnext')
{
$rs = $this->PreNext['imgnext'];
}

上一篇:织梦DedeCms实现调用单页文章内容的方法

栏    目:DedeCMS

下一篇:织梦DedeCms调用全站相关文章方法

本文标题:DEDECMS点击图片进入下一页功能实现教程

本文地址:https://zz.feitang.co/CMSjiaocheng/27026.html

广告投放 | 联系我们 | 版权申明

申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:257218569 | 邮箱:257218569@qq.com

Copyright © 2018-2026 站长天空 版权所有 Powered by EyouCms冀ICP备14023439号