实现代码如下:
{loop subcat($catid) $c} {if $c[‘child‘]} {php $child = subcat($c[‘catid‘]);} <div class="wj_fenlei"> <div class="fenlei_pic"> <em><img src="{php echo $c[‘image‘];}" width="298" height="144" /></em> <div class="xmtit">{php echo $c[‘catname‘];}+</div> <div class="xian"> <span>{php echo "<a href=‘".$c[‘url‘]."‘ target=‘_blank‘>".$c[‘catname‘]."</a>";}</span> <div class="xm_a"> {loop $child $catc} {php $subcatid[] = $catc[‘catid‘];} {php echo "<a href=‘".$catc[‘url‘]."‘ target=‘_blank‘>".$catc[‘catname‘]."</a>";} {/loop} </div> </div> </div> <ul> {php $subcatid = implode(‘,‘, $subcatid);} {php $arr=explode(‘,‘,$subcatid);} {pc:get sql="SELECT * from v9_news where status=99 and catid in ($subcatid) order by id DESC LIMIT 0,4--" num="6" return="data"} {loop $data $r} <li> <a href="{$r[url]}" target="_blank" title="{$r[‘title‘]}">● [{$CATEGORYS[$r[catid]][catname]}] {str_cut($r[‘title‘],40)}</a></li> {/loop} {/pc} </ul> <div class="zs_more"> {php echo "<a href=‘".$c[‘url‘]."‘ target=‘_blank‘>我想了解更多".$c[‘catname‘]."知识</a>";} </div> </div> {php $subcatid = null;} {/if} {/loop}
时间: 2024-10-27 13:38:35