注:本文针对“嘉城社区网”所用模板进行修改,dz版本为4.1,其他版本及模板修改方式略有不同,仅供参考!
作者: yeego
演示:http://www.jiacheng.sh.cn
修改文件:index.htm
说明:
1.指定横排板块:
{eval $incompact=array();} 中"()"内填写参与横排的gid,用半角逗号隔开。
2.若要显示更多信息,可在合适位置加入以下代码
显示子论坛:- <!--{if isset($forum['subforums'])}--><br><span class="bold">{lang forum_subforums}:</span> $forum[subforums]<!--{/if}-->
复制代码 显示版主:- {lang forum_moderators}:$forum[moderators]
复制代码 显示板块简介:显示最新帖:- <!--{if is_array($forum['lastpost'])}--> 最新:<a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"><!--{eval echo cutstr($forum[lastpost][subject],25);}--></a><!--{else}-->
- 暂无主题
- <!--{/if}-->
复制代码 修改方法:
1.编辑模板文件index.htm,找到:- <!--{loop $forumlist $key $forum}-->
- ...中间部分省略...
- <!--{/loop}-->
复制代码 2.替换为:- {eval $incompact=array();}
- <!--{loop $forumlist $key $forum}-->
- <!--{if $forum['type'] == 'group' && $forumlist[($key + 1)]['type'] == 'forum'}-->
- <!--{if !in_array($forum[fid],$incompact)}-->
- <div class="header" style="line-height: 25px; height: 26px; width:100%; float:left;">
- <div class="topic">≡ <a href="index.php?gid=$forum[fid]">$forum[name]</a> ≡</div>
- <div class="smallform" style="line-height: 15px;height: 15px;">XML</div>
- <div class="smallform" style="line-height: 15px;height: 15px;"><a href="rss.php?fid=$fid&auth=$rssauth" target="_blank">RSS 2.0</a></div>
- <!--{if $forum['moderators']}--><div class="smallform" style="line-height: 15px;height: 15px;"><font color="{HEADERTEXT}">{lang forum_category_modedby}: $forum[moderators]</font></div><!--{/if}-->
- </div>
- <div class="category" style="width: 100%">
- <div class="category00" style="float: left; border-right: {INNERBORDERCOLOR} 1px solid; width: 6%"></div>
- <div class="category00" style="width: 14%">{lang forum_moderators}</div>
- <div class="category00" style="border-right: {INNERBORDERCOLOR} 1px solid; width: 24%">{lang forum_lastpost}</div>
- <div class="category00" style="border-right: {INNERBORDERCOLOR} 1px solid; width: 5%">{lang forum_posts}</div>
- <div class="category00" style="border-right: {INNERBORDERCOLOR} 1px solid; width: 5%">{lang forum_threads}</div>
- <div class="category00" style="border-right: {INNERBORDERCOLOR} 1px solid; border-left: {INNERBORDERCOLOR} 1px solid; width: 5%">{lang forum_todayposts}</div>
- <div class="category00" style="width: 40%">{lang forum_name}</div>
- </div>
- <!--{else}-->
- <div class="header" style="line-height: 25px; height: 26px; width:100%; float:left;">
- <div class="topic">≡ <a href="index.php?gid=$forum[fid]">$forum[name]</a> ≡</div>
- <div class="smallform" style="line-height: 15px;height: 15px;">XML</div>
- <div class="smallform" style="line-height: 15px;height: 15px;"><a href="rss.php?fid=$fid&auth=$rssauth" target="_blank">RSS 2.0</a></div>
- <!--{if $forum['moderators']}--><div class="smallform" style="line-height: 15px;height: 15px;"><font color="{HEADERTEXT}">{lang forum_category_modedby}: $forum[moderators]</font></div><!--{/if}-->
- </div>
- <!--{/if}-->
- <!--{elseif $forum['permission']}-->
- <!--{if !in_array($forum[fup],$incompact)}-->
- <div class="maxspeed">
- <div class="maxspeed00" style="float: left; border-right: {INNERBORDERCOLOR} 1px solid; background: {ALTBG1}; width: 6%; padding-top: 15px;">$forum[folder]</div>
- <div class="maxspeed00" style="background: {ALTBG1}; width: 14%;">
- <div class="mechille" style="text-align: center">$forum[moderators]</div></div>
- <div class="maxspeed00" style="border-right: {INNERBORDERCOLOR} 1px solid; background: {ALTBG2}; width: 24%">
- <div class="mechille">
- <!--{if $forum['permission'] == 1}-->
- <span style="color: #2653A6;">{lang private_forum} </span>
- <!--{else}-->
- <!--{if is_array($forum['lastpost'])}-->
-
- 主题:<a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"><!--{eval echo cutstr($forum[lastpost][subject],25);}--></a>
- <br />作者: <!--{if $forum['lastpost']['author']}-->$forum['lastpost']['author']<!--{else}-->{lang anonymous}<!--{/if}-->
- <br />时间: $forum[lastpost][dateline]
- <!--{else}-->
- <br />暂无主题
- <!--{/if}-->
- <!--{/if}-->
- </div>
- </div>
- <div class="maxspeed00" style="border-right: {INNERBORDERCOLOR} 1px solid; background: {ALTBG1}; width: 5%; padding-top: 12px;">$forum[posts]</div>
- <div class="maxspeed00" style="border-right: {INNERBORDERCOLOR} 1px solid; background: {ALTBG2}; width: 5%; padding-top: 12px;">$forum[threads]</div>
- <div class="maxspeed00" style="border-right: {INNERBORDERCOLOR} 1px solid; background: {ALTBG1}; width: 5%; padding-top: 12px;">$forum[todayposts]</div>
- <div class="maxspeed00" style="border-right: {INNERBORDERCOLOR} 1px solid; background: {ALTBG2}; width: 40%">
- <div class="mechille">$forum[icon] <a href="forumdisplay.php?fid=$forum[fid]"><span style="font-size: 12px;font-weight:bold;">$forum[name]</span></a><br /> $forum[description]
- <!--{if isset($forum['subforums'])}--><br><span class="bold">{lang forum_subforums}:</span> $forum[subforums]<!--{/if}--></div>
- </div>
- </div>
- <!--{else}-->
- <div class="maxspeed" style="float:left; width:33.26%; border-right: {INNERBORDERCOLOR} 1px solid">
- <div class="mechille">$forum[icon] <img src="{IMGDIR}/zoo.gif" /> <a href="forumdisplay.php?fid=$forum[fid]"><span style="font-size: 12px;font-weight:bold;">$forum[name]</span></a> $forum[description]<br />
- <!--{if is_array($forum['lastpost'])}--> 最新:<a href="redirect.php?tid=$forum[lastpost][tid]&goto=lastpost#lastpost"><!--{eval echo cutstr($forum[lastpost][subject],25);}--></a><!--{else}-->
- 暂无主题
- <!--{/if}--><br />
- {lang forum_threads}:$forum[threads] {lang forum_posts}:$forum[posts] {lang forum_todayposts}:$forum[todayposts] {lang forum_moderators}:$forum[moderators]</div>
- </div>
- <!--{/if}-->
- <!--{/if}-->
- <!--{/loop}-->
复制代码 |