①打开 template/default/forum/viewthread_node.htm 模板文件,查找:
<!--{if !empty($post['relateitem'])}--> 复制代码
在上边添加:
<!--上一篇下一篇-->
<!--{eval $next_t=DB::fetch_first("SELECT tid,subject from ".DB::table('forum_thread')." where fid='$_G[fid]' and tid>'$_G[tid]' order by tid asc limit 1");}-->
<!--{eval $up_t=DB::fetch_first("SELECT tid,subject from ".DB::table('forum_thread')." where fid='$_G[fid]' and tid<'$_G[tid]' order by tid desc limit 1");}-->
<div class="t_navigation">
<p class="up_t">
<em>上一篇:</em>
<a href="/thread-<!--{eval echo $up_t[tid];}-->-1-1.html"><!--{eval echo $up_t[subject];}--></a>
</p>
<p class="next_t">
<em>下一篇:</em>
<a href="/thread-<!--{eval echo $next_t[tid];}-->-1-1.html"><!--{eval echo $next_t[subject];}--></a>
</p>
</div>
<!--上一篇下一篇end--> 复制代码
②打开 template/default/common/common.css 文件,在最下边添加:
/*----------上一篇下一篇----------*/
.t_navigation a{
font-size: 14px;
color:#333;
vertical-align: middle;
text-decoration: none;
}
.t_navigation a:hover{
color:red;
}
.up_t{
margin:20px 0 10px 0;
overflow: hidden;
line-height: 22px;
}
.up_t em{
font-size: 12px;
color:#ffffff;
padding: 1px 9px 3px 7px;
margin:0 10px 5px 0;
background: #3DA2C2;
}
.next_t{
margin:5px 0 5px 0;
overflow: hidden;
line-height: 22px;
}
.next_t em{
font-size: 12px;
color:#ffffff;
padding: 1px 9px 3px 7px;
margin:0 10px 5px 0;
background: #3DA2C2;
}
/*----------上一篇下一篇end----------*/ 复制代码