DZ门户上一篇下一篇

/*门户阅读页显示上下篇文章 BY:cr180*/

$query = DB::query(“SELECT a.aid, a.catid, a.title FROM “.DB::table(‘portal_article_title’).” AS a WHERE a.aid< $id AND a.catid=$cat[catid] ORDER BY a.aid DESC limit 1″);

$cr180_last = DB::fetch($query);

if (!empty($cr180_last[‘title’])){$cr180_lasts = “下一篇:<a href=”\&quot;portal.php?mod=view&amp;aid=$cr180_last[aid]\&quot;”>$cr180_last[title]”;}else{$cr180_lasts = “下一篇:没有了”;}

$query = DB::query(“SELECT a.aid, a.catid, a.title FROM “.DB::table(‘portal_article_title’).” AS a WHERE a.aid&gt;$id AND a.catid=$cat[catid] ORDER BY a.aid ASC limit 1″);

$cr180_next = DB::fetch($query);

if (!empty($cr180_next[‘aid’])){$cr180_nexts = “上一篇:</a><a href=”\&quot;portal.php?mod=view&amp;aid=$cr180_next[aid]\&quot;”>$cr180_next[title]</a>”;}else{$cr180_nexts = “上一篇:没有了”;}

/*门户阅读页显示上下篇文章 BY:cr180 END*/