SUPESITE7.5文章内容页的上一篇下一篇标题显示调用方法

刚在网上搜索几篇文章发现都 不能用,发现sql语句有错,然后我就修改去掉了folder=1的条件
1:修改处理程序viewnews.php
找到:

1
include template($tplname);

在其前面加入

1
2
3
4
5
$title_a = $_SGLOBAL['db']->result($_SGLOBAL['db']->query('SELECT subject FROM '.tname('spaceitems').' WHERE itemid < \''.$itemid.'\' AND catid = \''.$thecat['catid'].'\' AND type=\'news\' ORDER BY itemid DESC LIMIT 0,1'), 0);
if(!$title_a) $title_a = '';
 
$title_b = $_SGLOBAL['db']->result($_SGLOBAL['db']->query('SELECT subject FROM '.tname('spaceitems').' WHERE itemid > \''.$itemid.'\' AND catid = \''.$thecat['catid'].'\' AND type=\'news\' ORDER BY itemid LIMIT 0,1'), 0);
if(!$title_b) $title_b = '';

2:修改模版文件news_view.html.php
找到上一遍及下一遍处

1
2
3
<div id="article_pn">
<a class="box_l" href="{S_URL}/batch.common.php?ction=viewnews&amp;op=up&amp;itemid=$news[itemid]&amp;catid=$news[catid]">上一篇</a> <a class="box_r" href="{S_URL}/batch.common.php?action=viewnews&amp;op=down&amp;itemid=$news[itemid]&amp;catid=$news[catid]">下一篇</a>
</div>

将其替换为

1
2
3
4
<div id="article_pn">
<span class="box_l">上一篇:<a href="{S_URL}/batch.common.php?action=viewnews&op=up&itemid=$news[itemid]&catid=$news[catid]" class="viewnewsup">$title_a</a></span>
<span class="box_r">下一篇:<a href="{S_URL}/batch.common.php?action=viewnews&op=down&itemid=$news[itemid]&catid=$news[catid]">$title_b</a></span>
</div>

posted on 2013-08-06 15:12  winfan  阅读(231)  评论(0)    收藏  举报

导航