问答频道的分类由一行更改为二行
已有 1044 次阅读2013-8-29 22:03
|个人分类:网站动态|
频道
原来的代码:
<div class="box_head"><div><strong>按分类浏览</strong></div></div>
<div class="box_body">
<table width="100%" cellpadding="3">
{loop $maincat $k $v}
{if $k%2==0}<tr>{/if}
<td><a href="{$MOD[linkurl]}{$v[linkurl]}">{set_style($v[catname],$v[style])}</a> <span class="f_gray px10">({$v[item]})</span></td>
{if $k%2==1}</tr>{/if}
{/loop}
</table>
</div>
更改为:
<div class="box_head"><div><strong>问题分类</strong></div></div>
<div class="box_body">
<table width="100%" cellpadding="3">
{php $child = get_maincat(0, $moduleid, 1);}
{loop $child $i $c}
{if $i%2==0}<tr>{/if}
<td><a href="{$MOD[linkurl]}{$c[linkurl]}"><strong class="px14">{set_style($c[catname], $c[style])}</strong></a> <span class="f_gray px10">({$c[item]})</span> </td>
{if $i%2==1}</tr>{/if}
{/loop}
</table>
</div>