帝国CMS高级应用 灵动标签调用二级导航 循环子栏目和信息:
<div class="nav"> <div class="nav"> <div class="nav-inner"> <div class="clearfix nav-inner" id="menu"> <ul class="navlist"> <li><a rel="nofollow noopener noreferrer" href="[!---news.url--]"><span>网站首页</span></a></li> [e:loop={"select classid,classname,islast,sonclass from {$dbtbpre}enewsclass where bclassid='0' order by myorder,classid ASC limit 11",0,24,0}] <?php $classurl=sys_ReturnBqClassname($bqr,9); //取得栏目地址 $tbname=$class_r[$bqr[classid]][tbname]; //取得表名 $navshow=ReturnClassAddField($bqr[classid],'nav'); //取得栏目自定义字段navshow值?> <li><a rel="nofollow noopener noreferrer" href="<?=$classurl?>" target="_blank"><span> <?=$bqr[classname]?> </span></a> <?php //值为0时显示二级,值为1时不显示二级 if(!$navshow){ //终极栏目Start if(!$bqr[islast]) { //判断是否有子栏目Start if($bqr[sonclass]) { echo '<ul>'; //循环栏目下的子栏目Start $newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid desc limit 10"); while($classr=$empire->fetch($newsclass)) { $classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址 ?> <li><a rel="nofollow noopener noreferrer" href="<?=$classrurl?>"><?=$classr[classname]?></a></li> <?php } //循环栏目下的子栏目End echo '</ul>'; } //判断是否有子栏目End } //终极栏目End else //非终极栏目Start { $numinfo=$empire->gettotal("select count(*) as total from ".$dbtbpre."ecms_".$tbname." where classid=".$bqr[classid]); //统计子栏目信息 //判断终极栏目下是否有信息Start if($numinfo){ echo '<ul>'; //循环栏目下的信息Start $newsinfo=$empire->query("select title,id,classid,newspath,filename,groupid,titleurl from ".$dbtbpre."ecms_".$tbname." where classid=".$bqr[classid]." order by newstime desc limit 10"); while($infor=$empire->fetch($newsinfo)) { $titleurl=sys_ReturnBqTitleLink($infor); ?> <li><a rel="nofollow noopener noreferrer" href="<?=$titleurl?>"><?=$infor[title]?></a></li> <?php } //循环栏目下的信息End echo '</ul>'; } //判断终极栏目下是否有信息End } //非终极栏目End } ?> </li> [/e:loop] </ul> </div> </div> </div>
以上就是帝国CMS高级应用—灵动标签调用二级导航 循环子栏目和信息。我们最大的悲哀,是迷茫地走在路上,看不到前面的希望;我们最坏的习惯,是苟安于当下生活,不知道明天的方向。更多关于帝国CMS高级应用—灵动标签调用二级导航 循环子栏目和信息请关注haodaima.com其它相关文章!