查看: 4|回复: 1

Discuz! 手机触屏版帖子内添加上一篇下一篇

[复制链接]

764

主题

13

回帖

2377

积分

管理员

金钱
1600
发表于 1 小时前 | 显示全部楼层 |阅读模式

Discuz! 手机触屏版帖子内添加上一篇下一篇

Discuz! 手机触屏版帖子内添加上一篇下一篇


一、打开 template/default/touch/forum/viewthread.htm 模板文件,查找:

  1.                 <!--{if !empty($post['relateitem'])}-->
复制代码


在上面添加:

  1. <!--上一篇下一篇-->
  2.                 <!--{eval $next_t=DB::fetch_first("SELECT tid,subject from ".DB::table('forum_thread')." where fid='$_G[fid]' and tid>'$_G[tid]' and displayorder >= 0 order by tid asc limit 1");}-->
  3.                                 <!--{eval $up_t=DB::fetch_first("SELECT tid,subject from ".DB::table('forum_thread')." where fid='$_G[fid]' and tid<'$_G[tid]' and displayorder >= 0 order by tid desc limit 1");}-->
  4.                                         <div class="t_navigation">
  5.                                                 <p class="up_t">
  6.                                                         <em>上一篇:</em>
  7.                                                         <!--{if empty($up_t)}-->
  8.                                                         <span style="font-size: 14px">已经是最后一篇</span>
  9.                                                         <!--{else}-->
  10.                                                         <a href="/thread-<!--{eval echo $up_t[tid];}-->-1-1.html"><!--{eval echo $up_t[subject];}--></a>
  11.                                                         <!--{/if}-->
  12.                                                 </p>
  13.                                                 <p class="next_t">
  14.                                                         <em>下一篇:</em>
  15.                                                         <!--{if empty($next_t)}-->
  16.                                                         <span style="font-size: 14px">已经是最新一篇</span>
  17.                                                         <!--{else}-->
  18.                                                         <a href="/thread-<!--{eval echo $next_t[tid];}-->-1-1.html"><!--{eval echo $next_t[subject];}--></a>
  19.                                                         <!--{/if}-->
  20.                                                 </p>
  21.                                         </div>                          
  22. <!--上一篇下一篇end-->
复制代码


二、打开 static/image/mobile/style.css 文件,在最下边添加:

  1. /*----------上一篇下一篇----------*/
  2. .t_navigation a{
  3.         font-size: 12px;
  4.         color:#333;
  5.         vertical-align: middle;
  6.         text-decoration: none;
  7. }
  8. .t_navigation a:hover{
  9.         color:red;
  10. }
  11. .up_t{
  12.         margin:20px 0 10px 0;
  13.         overflow: hidden;
  14.         line-height: 10px;
  15. }
  16. .up_t em{
  17.         font-size: 9px;
  18.         color:#ffffff;
  19.         padding: 1px 9px 3px 7px;
  20.         margin:0 10px 5px 0;
  21.         background: #20B09F;
  22.         border-radius:2px 2px 2px 2px;
  23. }
  24. .next_t{
  25.         margin:5px 0 5px 0;
  26.         overflow: hidden;
  27.         line-height: 10px;
  28. }
  29. .next_t em{
  30.         font-size: 9px;
  31.         color:#ffffff;
  32.         padding: 1px 9px 3px 7px;
  33.         margin:0 10px 5px 0;
  34.         background: #20B09F;
  35.         border-radius:2px 2px 2px 2px;
  36. }
  37. /*----------上一篇下一篇end----------*/
复制代码



764

主题

13

回帖

2377

积分

管理员

金钱
1600
 楼主| 发表于 1 小时前 | 显示全部楼层
Discuz! X5

1、打开 template\default\touch\forum\viewthread.php,查找:

  1. <div id="comment_$post['pid']">
复制代码


在上面添加:

  1. <!--上一篇下一篇-->
  2. <!--{eval $next_t=DB::fetch_first("SELECT tid,subject from ".DB::table('forum_thread')." where fid='$_G[fid]' and tid>'$_G[tid]' and displayorder >= 0 order by tid asc limit 1");}-->
  3. <!--{eval $up_t=DB::fetch_first("SELECT tid,subject from ".DB::table('forum_thread')." where fid='$_G[fid]' and tid<'$_G[tid]' and displayorder >= 0 order by tid desc limit 1");}-->
  4. <div class="t_navigation">
  5.         <p class="up_t">
  6.                 <em>上一篇:</em>
  7.                 <!--{if empty($up_t)}-->
  8.                 <span style="font-size: 14px">已经是最后一篇</span>
  9.                 <!--{else}-->
  10.                 <a href="/thread-<!--{eval echo $up_t['tid'];}-->-1-1.html"><!--{eval echo $up_t['subject'];}--></a>
  11.                 <!--{/if}-->
  12.         </p>
  13.         <p class="next_t">
  14.                 <em>下一篇:</em>
  15.                 <!--{if empty($next_t)}-->
  16.                 <span style="font-size: 14px">已经是最新一篇</span>
  17.                 <!--{else}-->
  18.                 <a href="/thread-<!--{eval echo $next_t['tid'];}-->-1-1.html"><!--{eval echo $next_t['subject'];}--></a>
  19.                 <!--{/if}-->
  20.         </p>
  21. </div>                          
  22. <!--上一篇下一篇end-->
复制代码


2、打开  template\default\touch\common\common.css,在最下面添加:

  1. /*上一篇下一篇*/
  2. .t_navigation a{
  3.         font-size: 13px;
  4.         line-height: 17px;        
  5.         vertical-align: middle;
  6.         text-decoration: none;
  7.         transition: all ease-out .3s;        
  8. }     
  9. .t_navigation a:hover{
  10.         color:red;
  11. }
  12. .up_t{
  13.         margin:5px 0 5px 0;
  14.         overflow: hidden;
  15.         line-height: 15px;        
  16. }   
  17. .up_t em{
  18.         font-size: 10px;
  19.         color:#ffffff;
  20.         padding: 1px 9px 3px 7px;
  21.         margin:0 10px 5px 0;
  22.         background: #20B09F;
  23.         border-radius:2px;
  24.         box-shadow: 1px 1px 1px #20B09F;               
  25. }
  26. .next_t{
  27.         margin:20px 0 10px 0;
  28.         overflow: hidden;
  29.         line-height: 15px;        
  30. }  
  31. .next_t em{
  32.         font-size: 10px;
  33.         color:#ffffff;
  34.         padding: 1px 9px 3px 7px;
  35.         margin:0 10px 5px 0;
  36.         background: #20B09F;
  37.         border-radius:2px;
  38.         box-shadow: 1px 1px 1px #20B09F;        
  39. }
  40. /*上一篇下一篇end*/
复制代码


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|网站地图|文强阁

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖
返回顶部