techsir 登陆 |注册|TS首页
  首页 快活林 猿氏悟语

修改论坛横版样式(包括板块图标、板块简介、显示子版和版主)

By: 冰客 发表于 2008-8-26 11:27:23 · 9154次点击   回复:0   
并非原创,是在搜索了n多相关帖子后总结得出的,希望能对新手有所帮助。

1.要修改的文件是:discuz.htm,在discuz安装目录下的/templates/default/下(如果你的风格文件不在default下,请转到你风格的目录下寻找discuz.htm文件)。

2.主要需要修改的代码是这一段:
<th width="$cat[forumcolwidth]"{$forum[folder]}>
       <h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts]}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>
       <p>{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts]</p>
       <p>{lang forum_lastpost}:
        <!--{if is_array($forum['lastpost'])}-->
         <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][dateline]</a>
         {lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
        <!--{else}-->
         {lang never}
        <!--{/if}-->
       </p>
      </th>

3.修改论坛自定义板块图标。
将<th width="$cat[forumcolwidth]"{$forum[folder]}>代码
改为<th width="$cat[forumcolwidth]">{$forum[icon]}即可显示自定义版块图片了。

4.显示板块简介。
将代码<!--{if $forum[description]}--><p>$forum[description]</p><!--{/if}-->加在<p>{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts]</p>代码前面,即可在论坛名称下面显示论坛简介。
实现论坛名称下面显示子版块可以把论坛简介可以写成:
子板块:
<a href="子论坛地址">子论坛名称</a>
<a href="子论坛地址">子论坛名称</a>
<a href="子论坛地址">子论坛名称</a>

5.显示版主
将代码<!--{if $forum['moderators']}--><!--{if $moddisplay == 'flat'}--><p class="moderators">{lang forum_moderators}: $forum[moderators]</p><!--{else}--><span class="dropmenu" id="mod$forum[fid]" >{lang forum_moderators}</span><ul class="moderators popupmenu_popup" id="mod$forum[fid]_menu" style="display: none">$forum[moderators]</ul><!--{/if}--><!--{/if}-->
      </th>
添加到
<!--{else}-->
  {lang never}
  <!--{/if}-->
</p>
后面就会在最后回复人的下面显示版主。但是需要去后台=》基本设置=》界面与显示方式=》版主显示方式里改成平面显示。

6.一些小的变通修改。
默认的横排效果第一排是论坛名称,对应的代码是:
<th width="$cat[forumcolwidth]"{$forum[folder]}>
       <h2><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a><!--{if $forum[todayposts]}--><em> ({lang index_today}: $forum[todayposts])</em><!--{/if}--></h2>

第二排是主题数和帖子数,对应的代码为:<p>{lang forum_threads}: $forum[threads], {lang forum_posts}: $forum[posts]</p>

第三排是最后发表的时间和人,对应的代码是:
<p>{lang forum_lastpost}:
        <!--{if is_array($forum['lastpost'])}-->
         <a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost">$forum[lastpost][dateline]</a>
         {lang forum_lastpost_by} <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
        <!--{else}-->
         {lang never}
        <!--{/if}-->
       </p>

为什么要说对应的代码那?就是因为这样你就可以自己安排哪些要哪些不要了,也可以把前面的几个代码加到自己想要的地方,非常的个性化。
9154次点击
0个回复  |  直到 2008-8-26 11:27:23
添加一条新回复
您需要登录后才可以回帖 登录 | 成为会员 新浪微博登陆

标签云|手机版|科技先生 ( 京ICP备07036130号 Powered by Discuz! X )

GMT+8, 2024-4-20 22:16