效果截图:

QQ截图未命名.png

修改方法:

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

查找:

  1. include_once template("diy:portal/view:{$article['catid']}")

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

  1. /*门户阅读页显示上下篇文章 BY:cr180*/
  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. /*门户阅读页显示上下篇文章*/

文件 2:template/default/portal/view.htm

查找:

  1. <!--[diy=diycontentrelatetop]--><div id="diycontentrelatetop" ></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.   /*门户阅读页显示上下篇文章 BY:cr180 END*/
  7. </style>
  8.   <div ><span
    style="float:right">$cr180_nexts</span><span>$cr180_lasts</span></div>