Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] 帖子页面左右分栏显示方法

[复制链接]
jiaolijiede 发表于 2013-2-21 17:18:53 | 显示全部楼层 |阅读模式
本帖最后由 jiaolijiede 于 2013-2-21 17:21 编辑

先看演示:

修改方法:
打开 template/default/forum/viewthread.htm
找到
  1. <font size="4" color="#ff0000"><div id="postlist" class="pl bm" ></font>
复制代码

将其修改为
  1. <font size="4" color="#ff0000"><div id="postlist" class="pl bm" style="width:720px; float:left; margin-right:10px"></font>
复制代码


找到
  1. <font size="4" color="#ff0000"><div id="postlistreply" class="pl"><div id="post_new" class="viewthread_table" style="display: none"></div></div>
  2. </div></font>
复制代码


在其下方加入
  1. <font size="4" color="#ff0000"><div style="width:228px; float: right"><!--[diy=diy2013221]--><div id="diy2013221" class="area"></div><!--[/diy]--></div>
  2. <div style="clear:both;"></div></font>
复制代码
演示地址:http://99985.com.cn/forum.php?mod=viewthread&tid=351
<!--如上时将其修改为左右分栏模式,下面这部分是标题部分 -->
修改帖子页面标题部分

同文件,找到
  1. <font size="4" color="#ff0000"><table cellspacing="0" cellpadding="0">
  2.                 <tr>
  3.                         <td class="pls ptm pbm">
  4.                                 <!--{if $_G['page'] > 1}-->
  5.                                 <div id="tath" class="cl">
  6.                                         <!--{if $_G[forum_thread][authorid] && $_G[forum_thread][author]}-->
  7.                                                 <a href="home.php?mod=space&uid=$_G[forum_thread][authorid]" title="$_G[forum_thread][author]"><!--{avatar($_G[forum_thread][authorid],small)}--></a>
  8.                                                 {lang thread_author}: <a href="home.php?mod=space&uid=$_G[forum_thread][authorid]" title="$_G[forum_thread][author]">$_G[forum_thread][author]</a>
  9.                                         <!--{else}-->
  10.                                                 {lang thread_author}:
  11.                                                 <!--{if $_G['forum']['ismoderator']}-->
  12.                                                         <a href="home.php?mod=space&uid=$_G[forum_thread][authorid]">{lang anonymous}</a>
  13.                                                 <!--{else}-->
  14.                                                         {lang anonymous}
  15.                                                 <!--{/if}-->
  16.                                         <!--{/if}-->
  17.                                 </div>
  18.                                 <!--{else}-->
  19.                                 <div class="hm">
  20.                                         <span class="xg1">{lang show}:</span> <span class="xi1">$_G[forum_thread][views]</span><span class="pipe">|</span><span class="xg1">{lang reply}:</span> <span class="xi1">$_G[forum_thread][replies]</span>
  21.                                 </div>
  22.                                 <!--{/if}-->
  23.                         </td>
  24.                         <td class="plc ptm pbn vwthd">
  25.                                 <!--{if !IS_ROBOT}-->
  26.                                         <div class="y">
  27.                                                 <!--{if $post['invisible'] == 0}--><a href="forum.php?mod=viewthread&action=printable&tid=$_G[tid]" title="{lang thread_printable}" target="_blank"><img src="{IMGDIR}/print.png" alt="{lang thread_printable}" class="vm" /></a>
  28.                                                 <!--{/if}-->
  29.                                                 <a href="forum.php?mod=redirect&goto=nextoldset&tid=$_G[tid]" title="{lang last_thread}"><img src="{IMGDIR}/thread-prev.png" alt="{lang last_thread}" class="vm" /></a>
  30.                                                 <a href="forum.php?mod=redirect&goto=nextnewset&tid=$_G[tid]" title="{lang next_thread}"><img src="{IMGDIR}/thread-next.png" alt="{lang next_thread}" class="vm" /></a>
  31.                                         </div>
  32.                                 <!--{/if}-->
  33.                                 <h1 class="ts">
  34.                                         <!--{if $_G['forum_thread']['typeid'] && $_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}-->
  35.                                                 <!--{if !IS_ROBOT && ($_G['forum']['threadtypes']['listable'] || $_G['forum']['status'] == 3)}-->
  36.                                                         <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&filter=typeid&typeid=$_G[forum_thread][typeid]">[{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}]</a>
  37.                                                 <!--{else}-->
  38.                                                         [{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}]
  39.                                                 <!--{/if}-->
  40.                                         <!--{/if}-->
  41.                                         <!--{if $threadsorts && $_G['forum_thread']['sortid']}-->
  42.                                                 <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&filter=sortid&sortid=$_G[forum_thread][sortid]">[{$_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]}]</a>
  43.                                         <!--{/if}-->
  44.                                         <a href="forum.php?mod=viewthread&tid=$_G[tid]" id="thread_subject">$_G[forum_thread][subject]</a>
  45.                                 </h1>
  46.                                 <span class="xg1">
  47.                                         <!--{if $_G['forum_thread'][displayorder] == -2}-->({lang moderating})
  48.                                         <!--{elseif $_G['forum_thread'][displayorder] == -3}-->({lang have_ignored})
  49.                                         <!--{elseif $_G['forum_thread'][displayorder] == -4}-->({lang draft})
  50.                                         <!--{/if}-->
  51.                                         <!--{if $_G['forum_thread']['recommendlevel']}-->
  52.                                                  <img src="{IMGDIR}/recommend_$_G['forum_thread']['recommendlevel'].gif" alt="" title="{lang thread_recommend} $_G['forum_thread'][recommends]" />
  53.                                         <!--{/if}-->
  54.                                         <!--{if $_G['forum_thread'][heatlevel]}-->
  55.                                                  <img src="{IMGDIR}/hot_$_G['forum_thread'][heatlevel].gif" alt="" title="$_G['forum_thread'][heatlevel] {lang heats}" />
  56.                                         <!--{/if}-->
  57.                                         <!--{if $_G['forum_thread']['closed'] == 1}-->
  58.                                                  <img src="{IMGDIR}/locked.gif" alt="{lang close}" title="{lang close}" class="vm" />
  59.                                         <!--{/if}-->
  60.                                         <a href="forum.php?mod=viewthread&tid=$_G[tid]$fromuid" onclick="return copyThreadUrl(this)" {if $fromuid}title="{lang share_url_copy_comment}"{/if}>[{lang share_url_copy}]</a>
  61.                                 </span>
  62.                                 <!--{hook/viewthread_title_extra}-->
  63.                         </td>
  64.                 </tr>
  65.         </table></font>
复制代码
将其修改为:
  1. <font size="4" color="#ff0000"><table cellpadding="0" cellspacing="0">

  2.                         <td class="plc ptm pbn vwthd" style="background-color:#E5F2FC;">
  3.                                 <!--{if !IS_ROBOT}-->
  4.                                         <div class="y">
  5.                                                 <!--{if $post['invisible'] == 0}--><a href="forum.php?mod=viewthread&action=printable&tid=$_G[tid]" title="{lang thread_printable}" target="_blank"><img src="{IMGDIR}/print.png" alt="{lang thread_printable}" class="vm" /></a>
  6.                                                 <!--{/if}-->
  7.                                                 <a href="forum.php?mod=redirect&goto=nextoldset&tid=$_G[tid]" title="{lang last_thread}"><img src="{IMGDIR}/thread-prev.png" alt="{lang last_thread}" class="vm" /></a>
  8.                                                 <a href="forum.php?mod=redirect&goto=nextnewset&tid=$_G[tid]" title="{lang next_thread}"><img src="{IMGDIR}/thread-next.png" alt="{lang next_thread}" class="vm" /></a>                                        </div>
  9.                                 <!--{/if}-->
  10.                                 <h1 class="ts">
  11.                                         <!--{if $_G['forum_thread']['typeid'] && $_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}-->
  12.                                                 <!--{if !IS_ROBOT && ($_G['forum']['threadtypes']['listable'] || $_G['forum']['status'] == 3)}-->
  13.                                                         <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&filter=typeid&typeid=$_G[forum_thread][typeid]">[{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}]</a>
  14.                                                 <!--{else}-->
  15.                                                         [{$_G['forum']['threadtypes']['types'][$_G['forum_thread']['typeid']]}]
  16.                                                 <!--{/if}-->
  17.                                         <!--{/if}-->
  18.                                         <!--{if $threadsorts && $_G['forum_thread']['sortid']}-->
  19.                                                 <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&filter=sortid&sortid=$_G[forum_thread][sortid]">[{$_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]}]</a>
  20.                                         <!--{/if}-->
  21.                                         <a href="forum.php?mod=viewthread&tid=$_G[tid]" id="thread_subject"><font color="#900" size="+1">$_G[forum_thread][subject]</font></a>                                </h1>
  22.                                 <span class="xg1">
  23.                                         <!--{if $_G['forum_thread'][displayorder] == -2}-->({lang moderating})
  24.                                         <!--{elseif $_G['forum_thread'][displayorder] == -3}-->({lang have_ignored})
  25.                                         <!--{elseif $_G['forum_thread'][displayorder] == -4}-->({lang draft})
  26.                                         <!--{/if}-->
  27.                                         <!--{if $_G['forum_thread']['recommendlevel']}-->
  28.                                                  <img src="{IMGDIR}/recommend_$_G['forum_thread']['recommendlevel'].gif" alt="" title="{lang thread_recommend} $_G['forum_thread'][recommends]" />
  29.                                         <!--{/if}-->
  30.                                         <!--{if $_G['forum_thread'][heatlevel]}-->
  31.                                                  <img src="{IMGDIR}/hot_$_G['forum_thread'][heatlevel].gif" alt="" title="$_G['forum_thread'][heatlevel] {lang heats}" />
  32.                                         <!--{/if}-->
  33.                                         <!--{if $_G['forum_thread']['closed'] == 1}-->
  34.                                                  <img src="{IMGDIR}/locked.gif" alt="{lang close}" title="{lang close}" class="vm" />
  35.                                         <!--{/if}-->
  36.                                         <a href="forum.php?mod=viewthread&tid=$_G[tid]$fromuid" onclick="return copyThreadUrl(this)" {if $fromuid}title="{lang share_url_copy_comment}"{/if}>[{lang share_url_copy}]</a>                                </span>
  37.                                        
  38. <span class="xg1">{lang show}:</span> <span class="xi1">$_G[forum_thread][views]</span><span class="pipe">|</span><span class="xg1">{lang reply}:</span> <span class="xi1">$_G[forum_thread][replies]</span>
  39.                                 <!--{hook/viewthread_title_extra}-->                  </td>

  40.         </table></font>
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| jiaolijiede 发表于 2013-2-21 17:24:30 | 显示全部楼层
如果你不想修改,请下载将其解压直接覆盖在 template/default/forum/viewthread.htm

请做好备份工作

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

魔涵larry 发表于 2013-2-21 17:45:03 | 显示全部楼层
这样感觉页面太挤吧了!
回复

使用道具 举报

小米office 发表于 2013-4-10 16:38:48 | 显示全部楼层
这个不错啊,我测试了 还可以,就是左边信息有点挤挤
回复

使用道具 举报

silu思路 发表于 2013-5-10 10:46:05 | 显示全部楼层
不错,不错,先收藏。
回复

使用道具 举报

bbskgm 发表于 2013-5-31 16:24:00 | 显示全部楼层
x3 修改后,右侧位置diy无法保存,保存就没掉了。为什么呢
回复

使用道具 举报

童年心梦 发表于 2013-8-16 16:12:40 | 显示全部楼层
感谢,DZ2.5能用!
回复

使用道具 举报

童年心梦 发表于 2013-8-16 16:54:09 | 显示全部楼层

哈哈,还是不能用,可能是模板问题
回复

使用道具 举报

txhcn 发表于 2013-9-1 10:09:01 | 显示全部楼层
大师,非常感谢你的分享,效果很好,请问主题列表页也想改成这样,怎么修改呢,谢谢您
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-29 11:40 , Processed in 0.203644 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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