将Discuz的子论坛设置成横版紧凑排列方式
Categories
Archives
Links
  • baidu

将Discuz的子论坛设置成横版紧凑排列方式

Published on Thursday, September 14th, 2006 11:27 pm GMT
Category: Programming

  修改templates/default/forumdisplay_subforum.htm模版,将forumdisplay_subforum模版全选后替换成如下内容:

{eval $count=4;}
{eval $wid=’25%’;}
{eval $incompact=array(52);}
<!–{if in_array($forum[fid],$incompact)}–>
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
<tr><td colspan="$count" class="header"><table cellspacing="0" cellpadding="0" width="100%">
<tr class="smalltxt"><td class="bold"><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a> 子论坛列表</td><td align="right"><a href="###" onclick="toggle_collapse(’category_$forum[fid]’);"><img id="category_$forum[fid]_img" src="{IMGDIR}/collapsed_no.gif" border="0"></a></td></tr></table></td></tr>
<tbody id="category_$forum[fid]" style="$collapserules">
<tr class="altbg2">{eval $fcount = $count;}
<!–{else}–>
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
<tr class="header" align="center">
<td width="5%">&nbsp;</td>
<td width="51%">{lang forum_name}</td>
<td width="5%">{lang forum_threads}</td>
<td width="5%">{lang forum_posts}</td>
<td width="5%">{lang forum_todayposts}</td>
<td width="13%">{lang forum_lastpost}</td>
<td width="16%">{lang forum_moderators}</td>
</tr>
<!–{/if}–>

<!–{loop $sublist $sub}–>

<!–{if $sub[’permission’]}–><!–{if in_array($sub[fup],$incompact)}–> {eval $fcount–;}

<!–{if $fcount == -1}–></tr><tr class="altbg2">{eval $fcount = $count-1;}<!–{/if}–>

<td width="$wid" class="altbg2" align="left" onMouseOver ="this.style.backgroundColor=’{ALTBG1}’" onMouseOut ="this.style.backgroundColor=’{ALTBG2}’">

<table cellpadding="0" cellspacing="0" border="0" width="100%">

<tr>

<td align="left" width="40">$sub[folder]</td>

<td align="left" style="word-break: keep-all"><a href="forumdisplay.php?fid=$sub[fid]" title="$sub[description]"><span class="bold">$sub[name]</span></a>

<br><a title="{lang forum_lastpost}: $sub[lastpost][subject] &#13;&#10;最后回复: $sub[lastpost][dateline]">{lang forum_threads}: $sub[threads] {lang forum_posts}: $sub[posts] {lang forum_todayposts}:$sub[todayposts]</a>

<br><SPAN class=smalltxt>{lang forum_moderators}: </SPAN>$sub[moderators]</td></tr>
</table></td>
<!–{else}–>
<tr>

<td class="altbg1" align="center">$sub[folder]</td>

<td class="altbg2" align="left" onMouseOver="this.className=’altbg1′" onMouseOut="this.className=’altbg2′">

$sub[icon] <a href="forumdisplay.php?fid=$sub[fid]"><span class="bold">$sub[name]</span></a>

<br><span class="smalltxt">$sub[description]</span></td>

<td class="altbg1" align="center">$sub[threads]</td>

<td class="altbg2" align="center">$sub[posts]</td>

<td class="altbg2" align="center">$sub[todayposts]</td>

<!–{if $sub[’permission’] == 1}–>

<td class="altbg1" align="center"><span class="smalltxt">{lang private_forum}</span></td>

<!–{else}–>

<!–{if is_array($sub[’lastpost’])}–>

<td class="altbg1"><table cellpadding="0" cellspacing="0" border="0" width="100%">

<tr><td align="right" class="smalltxt" title="{lang forum_lastpost_in}: $sub[lastpost][subject]" nowrap>

$sub[lastpost][dateline] <br>{lang forum_lastpost_by} <!–{if $sub[’lastpost’][’author’]}–>$sub[’lastpost’][’author’]<!–{else}–>{lang guest}<!–{/if}–></td>

<td nowrap>&nbsp;<a href="redirect.php?tid=$sub[lastpost][tid]&goto=lastpost#lastpost"><img src="{IMGDIR}/lastpost.gif" border="0"></a></td>

</tr></table></td>

<!–{else}–>

<td class="altbg1" align="center"><span class="smalltxt">{lang never}</span></td>

<!–{/if}–>

<!–{/if}–>

<td class="altbg2" align="center" style="word-break: keep-all">$sub[moderators]</td>

</tr>
<!–{/if}–>
<!–{/if}–>
<!–{/loop}–>
<!–{if $fcount}–><td colspan="$fcount" bgcolor="{ALTBG2}"> </td><!–{/if}–>
</tr></tbody></table><br>

  需要设置的参数分别为:

{eval $count=4;} //横版(表格)个数
{eval $wid=’25%’;} //对应每个横版(表格)的宽度
{eval $incompact=array(52);} //要以非标准方式(紧凑方式)显示的父论坛id(这个要填的ID是父论坛的$fid,而不是子论坛,多个需要紧凑排列的父论坛ID用,隔开)

发表评论

将Discuz的子论坛设置成横版紧凑排列方式

上一篇:PHP 4.1.0 的 php.ini 的全文翻译
下一篇:DreamHost优惠码

Links