请选择 进入手机版 | 继续访问电脑版

UESOHO

帖子列表或门户文章列表中上一页下一页怎么实现

admin 发表于 11-29 12:15:49 | 0 条回复 | 555 次浏览

修改方法:
文章列表修改:source\module\portal\portal_view.php
查找: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*/
复制代码

帖子列表修改:template\default\portal\view.htm
查找:
<!--[diy=diycontentrelatetop]--><div id="diycontentrelatetop" class="area"></div><!--[/diy]-->
下面增加:
  1. <style>
  2. /*门户阅读页显示上下篇文章*/
  3.   .cr180nextitle { height:auto; overflow:hidden; padding:3px 5px}
  4.   .cr180nextitle span{ font-weight:bold; display:block; float:left; width:50%; height:21px; line-height:21px; overflow:hidden}
  5.   .cr180nextitle span a { font-weight:normal}
  6.   /*门户阅读页显示上下篇文章  END*/
  7. </style>
  8.   <div class="bm cr180nextitle"><span style="float:right">$cr180_nexts</span><span>$cr180_lasts</span></div>
复制代码



回复 道具 举报

您需要登录后才可以回帖 登录 | 注册

UESOHO/津ICP备11001501号-4 Powered by Discuz!

top