Discuz教程网

[代码修改] 门户阅读页增加上一篇下一篇 Discuz X1.5

[复制链接]
authicon dly 发表于 2012-6-29 22:16:03 | 显示全部楼层 |阅读模式
Discuz X1.5门户阅读页没有上一篇下一篇,下面我们分享下增加的修改方法,效果见下图

d1.png
门户阅读页增加上一篇下一篇 Discuz X1.5

修改方法:

文件1:source\module\portal\portal_view.php

查找:
  1. include_once template("diy:portal/view:{$article['catid']}");
复制代码

上面增加:(在这里感谢鸟辉的指导,将查询语句进行了改进,更准确了一点)

  1. /*门户阅读页显示上下篇文章*/
  2. $query = DB::query("SELECT a.aid, a.title FROM ".DB::table('portal_article_title')." AS a WHERE a.aid<$id ORDER BY a.aid DESC limit 1");
  3. $cr180_last = DB::fetch($query);
  4. if (!empty($cr180_last['title'])){$cr180_lasts = "上一篇:<a href="portal.php?mod=view&aid=$cr180_last[aid]">$cr180_last[title]</a>";}else{$cr180_lasts = "上一篇:没有了";}
  5. $query = DB::query("SELECT a.aid, a.title FROM ".DB::table('portal_article_title')." AS a WHERE a.aid>$id ORDER BY a.aid ASC limit 1");
  6. $cr180_next = DB::fetch($query);
  7. if (!empty($cr180_next['aid'])){$cr180_nexts = "下一篇:<a href="portal.php?mod=view&aid=$cr180_next[aid]">$cr180_next[title]</a>";}else{$cr180_nexts = "下一篇:没有了";}
  8. /*门户阅读页显示上下篇文章 END*/
复制代码
文件2:template\default\portal\view.htm
查找:
  1. <!--[diy=diycontentrelatetop]--><div id="diycontentrelatetop" class="area"></div><!--[/diy]-->
复制代码

下面增加:
游客,如果您要查看本帖隐藏内容请回复



上一篇:纵横搜索版块显示XXX的解决方法
下一篇:Discuz X2.5论坛 水印设置方法
authicon zhou123 发表于 2012-8-24 18:00:26 | 显示全部楼层
342343123412
authicon zgycgc 发表于 2012-9-22 11:20:56 | 显示全部楼层
您好支持
authicon bibolovebobo 发表于 2012-12-30 22:08:42 | 显示全部楼层
太生气了,无法HOLD啦 >_<......
authicon Chisame 发表于 2013-1-18 00:45:15 | 显示全部楼层
楼下的听好了……
authicon 工单系统 发表于 2015-10-15 11:49:17 | 显示全部楼层
authicon 天山乌鸦 发表于 2016-6-5 09:55:08 | 显示全部楼层
好东西,谢谢
authicon 这个家伙! 发表于 2016-9-25 15:54:11 | 显示全部楼层
不不不不不不不不不不不不不不不
authicon yyqyxx 发表于 2017-3-23 09:22:47 | 显示全部楼层
{:4_225:}{:4_225:}{:4_225:}{:4_225:}{:4_225:}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 01:31

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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