【笔记】帝国cms灵动标签循环栏目
1.循环指定栏目
[e:loop={"select * from {$dbtbpre}enewsclass where classid in(9,10,11,12,13) and showclass=0 order by classid ASC",0,24,0}] <li class="navLi"> <a href="<?=$bqsr[classurl]?>"><?=$bqr[classname]?></a> <? if($bqr[classid]==9){?> <img class="hotNew mfei" alt="" src="/skin/syd/img/mianfei[1].gif"> <?}elseif($bqr[classid]==10){?> <img class="hotNew" alt="" src="/skin/syd/img/remen[1].gif"></li> <?}?> </li> [/e:loop]
2.循环顶级栏目
[e:loop={"select * from {$dbtbpre}enewsclass where bclassid = 0 and showclass=0 order by classid ASC",0,24,0}] <li class="navLi"> <a href="<?=$bqsr[classurl]?>"><?=$bqr[classname]?></a> </li> [/e:loop]
3.循环指定栏目下的所有子栏目(二级栏目)
[e:loop={"select * from {$dbtbpre}enewsclass where classid in(2,3) and showclass=0 order by classid ASC",0,24,0}] <li> <h2 class="kgss firstH1"><?=$bqr[classname]?></h2> <?php $sql1=$empire->query("select * from phome_enewsclass where bclassid=$bqr[classid]"); while($bqr1=$empire->fetch($sql1)){ $classrurl=sys_ReturnBqClassname($bqr1,9); ?> <a href="<?=$classrurl?>"><?=$bqr1[classname]?> <?}?> </li> [/e:loop]
4.调用栏目名称:
<?=$class_r[栏目ID][‘classname’]?>