for($i=0;$i < $line;$i++){if($col>1) $likeType .= “<dl>/r/n”;for($j=0;$j<$col;$j++){if($col>1) $likeType .= “<dd>/r/n”;if($row=$dsql2->GetArray()){$row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);if(is_array($dtp2->CTags)){foreach($dtp2->CTags as $tagid=>$ctag){if(isset($row[$ctag->GetName()])){$dtp2->Assign($tagid,$row[$ctag->GetName()]);}elseif (preg_match(‘/^sonchannel[0-9]*$/’,$ctag->GetName())){$dtp2->Assign($tagid,lib_channel_son($ctag,$row['id'],$dsql3));}}}$likeType .= $dtp2->GetResult();}if($col>1) $likeType .= “</dd>/r/n”;}//Loop Colif($col>1){$i += $col – 1;$likeType .= ”</dl>/r/n”;}}//Loop for $ireset($dsql3);$dsql2->FreeResult();return $likeType;}?>在模板里面用 [field:sonchannel0] [/field:sonchannel0] 调用,这个是用来取子栏目用得(使用【sonchannel+数字】作为标签名是为了防止嵌套的时候无法正确解析标签),这个的作用就是当你的栏目有很多子栏目无限分级的时候方便你取子栏目的。实例一下:
<ul id="”left_nav”">{dede:channel type=’son’ typeid=’16′}<li><a href="”[field:typelink/]“">[field:typename/]</a> <ul>[field:sonchannel0]<li><a href="”[field:typelink/]“">[field:typename/]</a> <ul>[field:sonchannel1]<li><a href="”[field:typelink/]“">[field:typename/]</a> <ul>[field:sonchannel2]<li><a href="”[field:typelink/]“">[field:typename/]</a> <ul>[field:sonchannel3]<li><a href="”[field:typelink/]“">[field:typename/]</a></li>[/field:sonchannel3]</ul></li>[/field:sonchannel2]</ul></li>[/field:sonchannel1]</ul></li>[/field:sonchannel0]</ul></li>{/dede:channel}</ul>
新闻热点
疑难解答