首页指定板块横排完美版for DZ4.1
[color=#FF0000]注:本文针对“嘉城社区网”所用模板进行修改,dz版本为4.1,其他版本及模板修改方式略有不同,仅供参考![/color][color=#0000FF]作者: yeego
演示:[url]http://www.jiacheng.sh.cn[/url]
修改文件:index.htm[/color]
[b][color=#238E23]说明:[/color][/b]
1.指定横排板块:
{eval $incompact=array();} 中"()"内填写参与横排的gid,用半角逗号隔开。
2.若要显示更多信息,可在合适位置加入以下代码
显示子论坛:
[code]<!--{if isset($forum['subforums'])}--><br><span class="bold">{lang forum_subforums}:</span> $forum[subforums]<!--{/if}-->[/code]
显示版主:
[code]{lang forum_moderators}:$forum[moderators][/code]
显示板块简介:
[code]$forum[description][/code]
显示最新帖:
[code]<!--{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}-->[/code]
[b][color=#238E23]修改方法:[/color][/b]
1.编辑模板文件index.htm,找到:
[code]<!--{loop $forumlist $key $forum}-->
...中间部分省略...
<!--{/loop}-->[/code]
2.替换为:
[code]{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}-->[/code] ..................斑竹好专业啊~! [quote][b]原帖由 [i]星晨一怒[/i] 于 2007-6-11 16:38 发表[/b]
..................斑竹好专业啊~! [/quote]
果酱果酱~~只会一点皮毛,没有系统地学习:face12: 天书啊~~确实够厉害的:face27: 至少对我们这种网盲来说是专业级的
页:
[1]