欢迎访问 舍力博客(www.shuyong.net)
{php} global $zbp; $array = $zbp->GetCategoryList('','',array('cate_Count'=>'DESC'),''); {/php} {foreach $array as $cate} <a href="{$cate->Url}" title="{$cate->Name}">{$cate->Name}</a> {/foreach}2、调用当前栏目下的所有子分类代码:
{php} $str=''; $where=array(array('=','cate_ParentID',$category->ID)); $array=$zbp->GetCategoryList(null,$where,array('cate_Order'=>'ASC'),null,null); foreach ($array as $cate){ $str.='<li><a href="'.$cate->Url.'">'.$cate->Name.'</a></li>'; } echo $str; {/php}3、调用指定分类下的所有子分类(categorys[1]的1表示分类id)
{php} global $zbp; foreach($zbp->categorys[1]->SubCategorys as $cate){ echo '<a href="'.$cate->Url.'" title="'.$cate->Name.'">'.$cate->Name.'</a></li>'; } {/php}4、指定多个分类的二级分类
{php} $array = explode(',',$zbp->Config('qyblue')->cblflid); {/php} {foreach $array as $id} <div class="fl1"><a href="{$categorys[$id].Url}" title="{$categorys[$id].Name}">{$categorys[$id].Name}</a></div> {foreach $zbp->categorys[$id]->SubCategorys as $cate} <div class="fl2"> <li><a href="{$cate->Url}" title="{$cate->Name}">{$cate->Name}</a></li> </div> {/foreach} {/foreach}
留言/评论:◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。