帝国cms循环列出所有子栏目名,和当前子栏目下的文章列表和所有栏目信息数

<?php
$mesql=$empire->query(“select bclassid,classname,classid,sonclass,classpath from {$dbtbpre}enewsclass where bclassid in (2) order by myorder,classid”);
while($proMenu=$empire->fetch($mesql)){
$classurl=sys_ReturnBqClassname($proMenu,9); //栏目链接
$num=$empire->gettotal(“select count(*) as total from {$dbtbpre}ecms_news where “.($class_r[$proMenu[classid]] [islast]?”classid=’$proMenu[classid]'”:ReturnClass($class_r[$proMenu[classid]][sonclass])).” and checked=1″); //信息数
echo “<div class=’a_box’><h2 class=’a_title’><a href='”.$classurl.”‘>”.$proMenu[classname].”</a><span class=’num’>(“.$num.”)</span></h2>”;
if($proMenu[sonclass]){ //有子栏目是非终极栏目 列出子栏目
$mesql_sub=$empire->query(“select classname,classid,sonclass,classpath from {$dbtbpre}enewsclass where bclassid=”.$proMenu[classid]);
while($proMenu_sub=$empire->fetch($mesql_sub)){ //循环列出子栏目
echo “<div class=’b_box’>”;
$classurl=sys_ReturnBqClassname($proMenu_sub,9); //栏目链接
$num=$empire->gettotal(“select count(*) as total from {$dbtbpre}ecms_news where “.($class_r[$proMenu_sub[classid]] [islast]?”classid=’$proMenu_sub[classid]'”:ReturnClass($class_r[$proMenu_sub[classid]][sonclass])).” and checked=1″); //信息数
echo “<h2 class=’b_title’><a href='”.$classurl.”‘>”.$proMenu_sub[classname].”</a><span class=’num’>(“.$num.”)</span></h2>”;
$mesql_arti=$empire->query(“select * from {$dbtbpre}ecms_news where classid=”.$proMenu_sub[classid]);
if($proMenu_sub[classid]==$GLOBALS[navclassid]){ //如果是当前栏目SQL文章列表
echo “<ul class=’b_arti’>”;
$no=0;
while($proMenu_arti=$empire->fetch($mesql_arti)){
$titleurl=sys_ReturnBqTitleLink($proMenu_arti); //标题链接
$no++;
echo “<li><span class=’no’>”.$no.”</span><a href='”.$titleurl.”‘>”.$proMenu_arti[title].”</a></li>”;
}
echo “</ul>”;
}
echo “</div>”;
}

}else{ //终极栏目文章列表
if($proMenu[classid]==$GLOBALS[navclassid]){ //如果是当前栏目SQL文章列表
echo “<ul class=’a_arti’>”;
$mesql_arti=$empire->query(“select * from {$dbtbpre}ecms_news where classid=”.$proMenu[classid]);
$no=0;
while($proMenu_arti=$empire->fetch($mesql_arti)){
$titleurl=sys_ReturnBqTitleLink($proMenu_arti); //标题链接
$no++;
echo “<li><span class=’no’>”.$no.”</span><a href='”.$titleurl.”‘>”.$proMenu_arti[title].”</a></li>”;
echo “</ul>”;
}
}

}
echo “</div>”;
}
?>

 

人吐槽 人点赞

猜你喜欢

发表评论

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:帝国cms循环列出所有子栏目名,和当前子栏目下的文章列表和所有栏目信息数