夜间模式
请选择 进入手机版 | 继续访问电脑版
🌓黑暗模式

 找回密码
 立即注册
搜索
热搜: discuz sclub 夜读
查看: 967|回复: 0

[爱秀代码] 精仿X系列之版块浏览【图片模式】

[复制链接]
  • TA的每日心情
    擦汗
    2023-7-12 20:55
  • 签到天数: 8 天

    连续签到: 8 天

    [LV.3]偶尔看看II

    74

    主题

    0

    回帖

    1631

    积分

    管理员

    积分
    1631
    发表于 2022-3-27 21:04:31 | 显示全部楼层 |阅读模式

    112842raowamk7w33lqo1u.jpg


    1、打开 forumdisplay 模版,在最上边添加:

    1. {eval $wj_image_mode = $_COOKIE["wj_image_mode"];}
    复制代码


    2、然后找到:

    1. <div id="threadlist" class="threadlist datalist" style="position: relative;">
    复制代码


    在上边添加:

    1. <!--{if $wj_image_mode != 1}-->
    2. <td>
    3. <a onclick="setcookie('wj_image_mode', 1, 999999);location.reload();" title="开启图片模式" class="unchk" href="javascript:;">图片模式</a>
    4. </td>
    5. <!--{/if}-->
    6. <!--{if $wj_image_mode == 1}-->
    7. <td>
    8. <a onclick="setcookie('wj_image_mode', 2, 999999);location.reload();" title="关闭图片模式" class="chked" href="javascript:;">图片模式</a>
    9. </td>
    10. <!--{/if}-->
    复制代码


    然后再找:

    1. <!--{if $page == 1 && !empty($announcement)}-->
    复制代码


    在上边加上:

    1. <!--{if $wj_image_mode != 1}-->
    复制代码


    继续找到:

    1. <tbody><tr><th colspan="6"><p class="nodata">{lang forum_nothreads}</p></th></tr></tbody>
    2.                         <!--{/if}-->
    复制代码



    在下边添加:

    1. <!--{/if}-->
    复制代码


    完成第四个部分有看见个</table>么?在</table>这个下边添加:

    1. {template i_f_imagemode}
    复制代码


    新建一个模板命名为 i_f_imagemode 内容是:

    1. <style>
    2. .tl .by {
    3. width: 105px;
    4. line-height: 14px;
    5. }
    6. .chked {
    7. padding-left: 15px;
    8. line-height: 16px;
    9. background: url(https://www.qms23.com/pic/picmode.png) no-repeat 0 3px;
    10. color: #1E547F;
    11. cursor: pointer;
    12. background-position: 0 -37px;
    13. }
    14. .unchk {
    15. padding-left: 15px;
    16. line-height: 16px;
    17. background: url(https://www.qms23.com/pic/picmode.png) no-repeat 0 3px;
    18. color: #1E547F;
    19. cursor: pointer;
    20. }
    21. .waterfall {
    22. position: relative;
    23. margin-left: 22px;
    24. }
    25. .waterfall li {
    26. float: left;
    27. width: 215px;
    28. overflow: hidden;
    29. margin: 0 10px 10px 0;
    30. padding: 0 0 3px;
    31. text-align: left;
    32. border-width: 1px 0 0;
    33. border-top: 1px solid #EAEAEA;
    34. background: url(https://www.qms23.com/pic/piclong.png) no-repeat 100% 100%;
    35. }
    36. .waterfall .c {
    37. overflow: hidden;
    38. padding-bottom: 0;
    39. max-height: 800px;
    40. }
    41. .waterfall .c, .waterfall h3 {
    42. padding: 10px;
    43. border: solid #EAEAEA;
    44. border-width: 0 1px;
    45. background-color: #F8F8F8;
    46. }
    47. .waterfall .c, .waterfall h3 {
    48. white-space: nowrap;
    49. overflow: hidden;
    50. text-overflow: ellipsis;
    51. padding: 10px;
    52. border: solid #EAEAEA;
    53. border-width: 0 1px;
    54. background-color: #F8F8F8;
    55. }
    56. .waterfall .auth {
    57. padding: 0 10px 10px;
    58. border-width: 0 1px 1px;
    59. border-style: solid;
    60. border-color: transparent #EAEAEA #B9B9B9;
    61. background: #F8F8F8;
    62. }
    63. </style>

    64. <!--{if $wj_image_mode == 1}-->
    65. <style>#threadlist {padding-top: 20px;}</style>
    66. <table summary="forum_$fid" id="forum_ajax" cellspacing="0" cellpadding="0" class="datatable">
    67.       <tbody id="$thread[id]" onmouseover="gtview_showover(this)" onmouseout="gtview_showout(this)">
    68. <ul id="waterfall" class="ml waterfall cl">
    69. <!--{loop $threadlist $key $thread}-->
    70. <li id="$thread[id]">
    71. <div class="c cl">
    72. {eval $q2 = $db->query("SELECT * FROM cdb_attachments WHERE tid='".$thread[tid]."' AND isimage!=0 ORDER BY pid DESC");}
    73. {eval while ($asdfgh=$db->fetch_array($q2)) $thread[imgurl]=$asdfgh[attachment];}
    74. <!--{if $thread[imgurl]}-->
    75. <a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]" target="_blank"><img src="attachments/$thread[imgurl]" alt="$thread[subject]" title="$thread[subject]" width="100%" height="145" /></a>
    76. <!--{else}-->
    77. <a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]" target="_blank"><img src="https://www.qms23.com/pic/nophototiny.png" title="$thread[subject]" width="100%" height="145" /></a>
    78. <!--{/if}-->
    79. </div>
    80. <h3 class="xw0">
    81. <!--{if $forum['ismoderator']}-->
    82. <!--{if $thread['fid'] == $fid && $thread['digest'] >= 0}-->
    83. <!--{if $thread['displayorder'] <= 3 || $adminid == 1}-->
    84. <input onclick="tmodclick(this)" class="checkbox" type="checkbox" name="moderate[]" value="$thread[tid]" />
    85. <!--{else}-->
    86. <input class="checkbox" type="checkbox" disabled="disabled" />
    87. <!--{/if}-->
    88. <!--{else}-->
    89. <input class="checkbox" type="checkbox" disabled="disabled" />
    90. <!--{/if}-->
    91. <!--{/if}-->
    92. <a href="viewthread.php?tid=$thread[tid]&extra=$extra"$thread[highlight]" onclick="atarget(this)" title="$thread[subject]">$thread[subject]</a>
    93. </h3>
    94. <div class="auth cl">
    95. <cite class="xg1 y" style="float: right;color:#999;">
    96. 喜欢: $thread[views] &nbsp; 回复: <a href="thread-$thread[tid]-1-1.html" title="$thread[replies] 回复">$thread[replies]</a>
    97. </cite>
    98. <!--{if $thread['authorid'] && $thread['author']}-->
    99. <a href="space.php?uid=$thread[authorid]">$thread[author]</a>
    100. <!--{else}-->
    101. <!--{if $forum['ismoderator']}-->
    102. <a href="space.php?uid=$thread[authorid]">匿名</a>
    103. <!--{else}-->
    104. {lang anonymous}
    105. <!--{/if}-->
    106. <!--{/if}-->
    107. </div>
    108. </li>
    109. <!--{/loop}-->
    110. </ul>
    111. </tbody>
    112. </table>
    113. <!--{/if}-->
    复制代码




    文章来源:icode.258club.com




    上一篇:仿X2 ➟板块浏览页面的板块导航
    下一篇:jQuery安装

    相关帖子

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

    本版积分规则

    快速回复 返回顶部 返回列表