找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1403|回复: 0

[分享] dede5.7点击图片进入下一页的方法

[复制链接]
发表于 2018-3-16 08:47:13 | 显示全部楼层 |阅读模式 来自 中国–河南–新乡
按以下五个步骤进行修改就行了。
修改 include/arc.archives.class.php

1.查找“//解析模板,对内容里的变动进行赋值”字段,在这段话上面添加以下代码 :

  1. function ClickPicNext($ismake=1,$aid,&$body)
  2.   {
  3.   global $cfg_rewrite;
  4.   if($this->NowPage!=$this->TotalPage)
  5.   {
  6.   $lPage=$this->NowPage+1;
  7.   if($ismake=0)
  8.   {
  9.   $body=preg_replace("/<(img|IMG)(.*)(src|SRC)=["|'|   ]{0,}((.*)>)/isU","点击图片,进入下一页<br/><a   href='".$this->NameFirst."_".$lPage.".".$this->ShortName."'>"."\${0}"."</a>",$body);
  10.   }
  11.   else
  12.   {
  13. //静态页
  14. $PageList="<a href='".$this->NameFirst."_".$lPage.".".$this->ShortName."'>"."\${0}"."</a>";
  15. //动态页
  16.   //$PageList="<a href='view.php?aid=$aid&pageno=$lPage'>"."\${0}"."</a>";
  17.   if($cfg_rewrite == 'Y')
  18.   {
  19.   $PageList = str_replace(".php?aid=","-",$PageList);
  20.   $PageList = preg_replace("/&pageno=(\d+)/i",'-\\1.html',$PageList);
  21.   }
  22.   $body=preg_replace("/<(img|IMG)(.*)(src|SRC)=["|'| ]{0,}((.*)>)/isU",$PageList,$body);
  23.   }
  24. }
  25.   else
  26.   {
  27. $body=preg_replace("/<(img|IMG)(.*)(src|SRC)=["|'| ]{0,}((.*)>)/isU",$this->GetPreNext('imgnext'),$body);
  28.   }

  29.   return $body;
  30.   }
复制代码

2.查找$this->Fields[$this->SplitPageField] = $this->SplitFields[$pageNo - 1]; 在其下面添加
  1. if($ClickPicNext){
  2.             $this->Fields[$this->SplitPageField]=$this->Fields[$this->SplitPageField];
  3.             }else{
  4.                 $this->Fields[$this->SplitPageField]=$this->ClickPicNext($ismake,$this->Fields['id'],$this->Fields[$this->SplitPageField]);
  5.             }
复制代码

3.查找$this->;PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";在其下面添加
  1. $this->PreNext['imgnext'] ="<a href='$mlink'>"."\${0}"."</a>";
复制代码

4.查找$this->;PreNext['next'] = "下一篇:没有了 ";在其下面添加
  1. $this->PreNext['imgnext'] ="\${0}";
复制代码

5.查找
  1. else if($gtype=='next')
  2. {
  3. $rs =  $this->PreNext['next'];
  4. }
复制代码

在其下面添加
  1. else if($gtype=='imgnext')                  
  2. {  
  3. $rs =  $this->PreNext['imgnext'];   
  4. }  
复制代码

发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;

如何回报帮助你解决问题的坛友,好办法就是点击帖子下方的评分按钮给对方加【金币】不会扣除自己的积分,做一个热心并受欢迎的人!

▶专业解决各类DiscuzX疑难杂症、discuz版本升级 、网站搬家 和 云服务器销售!▶有偿服务QQ 860855665 更多精品应用
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则 需要先绑定手机号

关闭

站长推荐上一条 /1 下一条

QQ|侵权投诉|广告报价|手机版|小黑屋|西部数码代理|飘仙建站论坛 ( 豫ICP备2022021143号-1 )

GMT+8, 2025-2-2 10:47 , Processed in 0.040823 second(s), 9 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表