效果截图:
修改方法:
文件 1:source/module/portal/portal_view.php
查找:
- include_once template("diy:portal/view:{$article['catid']}")
上面增加:(在这里感谢鸟辉的指导,将查询语句进行了改进,更准确了一点)
- /*门户阅读页显示上下篇文章 BY:cr180*/
- $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"); - $cr180_last = DB::fetch($query);
- if (!empty($cr180_last['title'])){$cr180_lasts = "上一篇:<a
href="portal.php?mod=view&aid=$cr180_last[aid]">$cr180_last[title]</a>";}else{$cr180_lasts
= "上一篇: 没有了";} - $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"); - $cr180_next = DB::fetch($query);
- if (!empty($cr180_next['aid'])){$cr180_nexts = "下一篇:<a
href="portal.php?mod=view&aid=$cr180_next[aid]">$cr180_next[title]</a>";}else{$cr180_nexts
= "下一篇: 没有了";} - /*门户阅读页显示上下篇文章*/
文件 2:template/default/portal/view.htm
查找:
- <!--[diy=diycontentrelatetop]--><div id="diycontentrelatetop" ></div><!--[/diy]-->
下面增加:
- <style>
- /*门户阅读页显示上下篇文章*/
- .cr180nextitle { height:auto; overflow:hidden; padding:3px 5px}
- .cr180nextitle span{ font-weight:bold; display:block; float:left; width:50%; height:21px; line-height:21px; overflow:hidden}
- .cr180nextitle span a { font-weight:normal}
- /*门户阅读页显示上下篇文章 BY:cr180 END*/
- </style>
- <div ><span
style="float:right">$cr180_nexts</span><span>$cr180_lasts</span></div>