帝国cmsPHP循环一级栏目子栏目以及子栏目下的栏目信息支持PHP7.x
时间:2024年04月11日
/来源:网络
/编辑:佚名
[e:loop={"select classid,classname,islast from {$dbtbpre}enewsclass where bclassid='0' and showclass=0 order by myorder,classid ASC limit 5",0,24,0}]
<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
?>
<li><a href="<?=$classurl?>" class="<?=$class?>"><h1><?=$bqr[classname]?></h1></a>
<?php
if(!$bqr[islast]) //判断是否终极栏目
{
?>
<ul>
<?php
//取得栏目下的子栏目
$newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid asc limit 4"); $i=0;
while($classr=$empire->fetch($newsclass))
{
$classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址
$i++;
?>
<a href="<?=$classrurl?>"><?=$classr[classname]?></a>
<?php
}
?>
</ul>
<div>
<h2>最新数据</h2>
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],5,0,0,'','');
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>
<li><a href="<?=$bqr2[titleurl]?>"><?=$bqr2[title]?></a></li>
<?php
}
?>
</div>
<div>
<h2>最热数据</h2>
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],5,0,0,'','onclick desc');
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<li><a href="<?=$bqr3[titleurl]?>"><?=$bqr3[title]?></a></li>
<?php
}
?>
</div>
<div>
<h2>最新数据2</h2>
<?php
$ecms_bq_sql4=sys_ReturnEcmsLoopBq($bqr[classid],'5,5',0,0,'','');
$bqno4=0;
while($bqr4=$empire->fetch($ecms_bq_sql4))
{
$bqsr4=sys_ReturnEcmsLoopStext($bqr4);
$bqno4++;
?>
<li><a href="<?=$bqr4[titleurl]?>"><?=$bqr4[title]?></a></li>
<?php
}
?>
</div>
<div>
<h2>最新数据3</h2>
<?php
$ecms_bq_sql5=sys_ReturnEcmsLoopBq($bqr[classid],'10,5',0,0,'','');
$bqno5=0;
while($bqr5=$empire->fetch($ecms_bq_sql5))
{
$bqsr5=sys_ReturnEcmsLoopStext($bqr5);
$bqno5++;
?>
<li><a href="<?=$bqr5[titleurl]?>"><?=$bqr5[title]?></a></li>
<?php
}
?>
</div>
<?php
}
?>
</li>
[/e:loop]
案例图:
[e:loop={"select classid,classname,islast from {$dbtbpre}enewsclass where classid in(1,2,3,4,5,6,7,8,9,100) and showclass=0 order by myorder,classid ASC",0,24,0}]
<div class="con_lm bj_mt30 louceng">
<div class="head_2 main">
<div class="fl lm_head_l">
<h3>
<i></i>
<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
?>
<a href="<?=$classurl?>" target="_blank" title="<?=$bqr[classname]?>" class="f24 ca"><?=$bqr[classname]?></a>
</h3>
</div>
<?php
if(!$bqr[islast]) //判断是否终极栏目
{
?>
<div class="fr lm_head_r">
<?php
//取得栏目下的子栏目
$newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid asc limit 4"); $i=0;
while($classr=$empire->fetch($newsclass))
{
$classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址
$i++;
?>
<a href="<?=$classrurl?>" target="_blank" class="head_ra chao fl"><?=$classr[classname]?></a>
<?php
}
?>
<a href="<?=$classurl?>" title="<?=$bqr[classname]?>" target="_blank" class="more"><?=$bqr[classname]?> >></a>
</div>
</div>
<div class="lm_nr main bj_mt20">
<div class="lm_nr_nr">
<div class="lm_nr_l fl bg2 yj_10 hidden">
<div class="head_3">
<h4 class="f18 nobold fl"><span></span>热门图文</h4>
<a class="more fr">HOT</a>
</div>
<div class="hot_tw main bj_mt20">
<div class="bd">
<ul class="infoList">
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],3,0,1,'','onclick DESC');
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>
<li>
<a href="<?=$bqr2[titleurl]?>" title="<?=$bqr2[title]?>" target="_blank" class="a_img photo hidden yj_10 chao"><img src="<?=$bqr2[titlepic]?>" alt="<?=$bqr2[title]?>"></a>
<a href="<?=$bqr2[titleurl]?>" title="<?=$bqr2[title]?>" target="_blank" class="bt_a chao bj_mt20 f18"><?=esub($bqr2[title],22,'…')?></a>
<p class="chao3 c9 f13 bj_mt10"><?=esub($bqr2[smalltext],98,'…')?></p>
<div class="li_b bj_mt10">
<time><?=date('m-d',$bqr2[newstime])?></time>
<a href="<?=$bqsr[classurl]?>" title="<?=$bqsr2[classname]?>" target="_blank" class="cb f13"><?=$bqsr2[classname]?></a>
</div>
</li>
<?php
}
//显示2条
?>
</ul>
</div>
<div class="hd">
<ul class="num">
<li class="fl on">1</li>
<li class="fl">2</li>
<li class="fl">3</li>
</ul>
</div>
<div class="hd">
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],1,1,0,0,'','onclick DESC');
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>
<a href="<?=$bqr2[titleurl]?>" target="<?=$bqr2[title]?>"><?=$bqr2[title]?></a><time class="fr"><?=date('m-d',$bqr2[newstime])?></time>
<?php
}
//显示1条
?>
</div>
</div>
</div>
</div>
<div class="lm_nr_c fl">
<div class="head_3">
<h5 class="f18 nobold fl"><span>
</span>最新文章</h4>
<a class="more fr">Article</a>
</div>
<div class="lm_lb bj_mt20">
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],2,0,0,'','onclick DESC');
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<div class="lb_2">
<a href="<?=$bqsr3[classurl]?>" title="<?=$bqsr3[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$bqsr3[classname]?></a>
<div class="fl lb_l">
<a href="<?=$bqr3[titleurl]?>" title="<?=$bqr3[title]?>" target="_blank" class="bt_a chao bold"><?=$bqr3[title]?><time><?=date('m-d',$bqr3[newstime])?></time></a>
<p class="chao c9 f13"><?=$bqr3[smalltext]?></p>
</div>
</div>
<?php
}
//显示2条
?>
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],6,0,0,'','newstime desc');
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<div class="lb_1">
<a href="<?=$bqsr3[classurl]?>" title="<?=$bqsr3[classname]?>" target="_blank" class="lm_a chao fl"><?=$bqsr3[classname]?></a>
<a href="<?=$bqr3[titleurl]?>" title="<?=$bqr3[title]?>" target="_blank" class="bt_a chao fl"><?=$bqr3[title]?></a>
<time class="fr"><?=date('m-d',$bqr3[newstime])?></time>
</div>
<?php
}
//显示6条
?>
</div>
</div>
<div class="lm_nr_r fr">
<div class="head_3">
<h6 class="f18 nobold fl"><span></span>热门排行</h4>
<a class="more fr">Rank</a>
</div>
<div class="lm_lb bj_mt20">
<div class="lb_3">
<?php
$ecms_bq_sql4=sys_ReturnEcmsLoopBq($bqr[classid],'2,1',0,0,'','onclick DESC');
$bqno4=0;
while($bqr4=$empire->fetch($ecms_bq_sql4))
{
$bqsr4=sys_ReturnEcmsLoopStext($bqr4);
$bqno4++;
?>
<div class="fl lb_on">
<span class="cf f24">0<?=$bqno?></span>
<time class="cf"><?=date('m-d',$bqr4[newstime])?></time>
</div>
<div class="fl lb_l">
<a href="<?=$bqr4[titleurl]?>" title="<?=$bqr4[title]?>" target="_blank" class="bt_a chao bold"><?=$bqr4[title]?></a>
<div class="lb_l_b">
<a href="<?=$bqsr4[classurl]?>" title="<?=$bqsr4[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$bqsr4[classname]?></a>
<p class="chao c9 f13"><?=$bqr4[smalltext]?></p>
</div>
</div>
<?php
}
//显示1条
?>
</div>
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($bqr[classid],'3,8',0,0,'','onclick DESC');
while($bqr4=$empire->fetch($ResultG)){
$bqsr=sys_ReturnEcmsLoopStext($bqr4);
$bqno++;
?>
<div class="lb_1">
<span>0<?=$bqno+1?></span>
<a href="<?=$bqsr4[classurl]?>" title="<?=$bqsr4[classname]?>" target="_blank" class="lm_a chao fl"><?=$bqsr4[classname]?></a>
<a href="<?=$bqr4[titleurl]?>" title="<?=$bqr4[title]?>" target="_blank" class="bt_a chao fl"><?=$bqr4[title]?></a>
<time class="fr"><?=date('m-d',$bqr4[newstime])?></time>
</div>
<?php
}
//显示8条
?>
</div>
</div>
<?php
}
?>
<div class="clear"></div>
</div>
</div>
[/e:loop]
<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
?>
<li><a href="<?=$classurl?>" class="<?=$class?>"><h1><?=$bqr[classname]?></h1></a>
<?php
if(!$bqr[islast]) //判断是否终极栏目
{
?>
<ul>
<?php
//取得栏目下的子栏目
$newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid asc limit 4"); $i=0;
while($classr=$empire->fetch($newsclass))
{
$classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址
$i++;
?>
<a href="<?=$classrurl?>"><?=$classr[classname]?></a>
<?php
}
?>
</ul>
<div>
<h2>最新数据</h2>
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],5,0,0,'','');
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>
<li><a href="<?=$bqr2[titleurl]?>"><?=$bqr2[title]?></a></li>
<?php
}
?>
</div>
<div>
<h2>最热数据</h2>
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],5,0,0,'','onclick desc');
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<li><a href="<?=$bqr3[titleurl]?>"><?=$bqr3[title]?></a></li>
<?php
}
?>
</div>
<div>
<h2>最新数据2</h2>
<?php
$ecms_bq_sql4=sys_ReturnEcmsLoopBq($bqr[classid],'5,5',0,0,'','');
$bqno4=0;
while($bqr4=$empire->fetch($ecms_bq_sql4))
{
$bqsr4=sys_ReturnEcmsLoopStext($bqr4);
$bqno4++;
?>
<li><a href="<?=$bqr4[titleurl]?>"><?=$bqr4[title]?></a></li>
<?php
}
?>
</div>
<div>
<h2>最新数据3</h2>
<?php
$ecms_bq_sql5=sys_ReturnEcmsLoopBq($bqr[classid],'10,5',0,0,'','');
$bqno5=0;
while($bqr5=$empire->fetch($ecms_bq_sql5))
{
$bqsr5=sys_ReturnEcmsLoopStext($bqr5);
$bqno5++;
?>
<li><a href="<?=$bqr5[titleurl]?>"><?=$bqr5[title]?></a></li>
<?php
}
?>
</div>
<?php
}
?>
</li>
[/e:loop]
案例图:
[e:loop={"select classid,classname,islast from {$dbtbpre}enewsclass where classid in(1,2,3,4,5,6,7,8,9,100) and showclass=0 order by myorder,classid ASC",0,24,0}]
<div class="con_lm bj_mt30 louceng">
<div class="head_2 main">
<div class="fl lm_head_l">
<h3>
<i></i>
<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
?>
<a href="<?=$classurl?>" target="_blank" title="<?=$bqr[classname]?>" class="f24 ca"><?=$bqr[classname]?></a>
</h3>
</div>
<?php
if(!$bqr[islast]) //判断是否终极栏目
{
?>
<div class="fr lm_head_r">
<?php
//取得栏目下的子栏目
$newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid asc limit 4"); $i=0;
while($classr=$empire->fetch($newsclass))
{
$classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址
$i++;
?>
<a href="<?=$classrurl?>" target="_blank" class="head_ra chao fl"><?=$classr[classname]?></a>
<?php
}
?>
<a href="<?=$classurl?>" title="<?=$bqr[classname]?>" target="_blank" class="more"><?=$bqr[classname]?> >></a>
</div>
</div>
<div class="lm_nr main bj_mt20">
<div class="lm_nr_nr">
<div class="lm_nr_l fl bg2 yj_10 hidden">
<div class="head_3">
<h4 class="f18 nobold fl"><span></span>热门图文</h4>
<a class="more fr">HOT</a>
</div>
<div class="hot_tw main bj_mt20">
<div class="bd">
<ul class="infoList">
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],3,0,1,'','onclick DESC');
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>
<li>
<a href="<?=$bqr2[titleurl]?>" title="<?=$bqr2[title]?>" target="_blank" class="a_img photo hidden yj_10 chao"><img src="<?=$bqr2[titlepic]?>" alt="<?=$bqr2[title]?>"></a>
<a href="<?=$bqr2[titleurl]?>" title="<?=$bqr2[title]?>" target="_blank" class="bt_a chao bj_mt20 f18"><?=esub($bqr2[title],22,'…')?></a>
<p class="chao3 c9 f13 bj_mt10"><?=esub($bqr2[smalltext],98,'…')?></p>
<div class="li_b bj_mt10">
<time><?=date('m-d',$bqr2[newstime])?></time>
<a href="<?=$bqsr[classurl]?>" title="<?=$bqsr2[classname]?>" target="_blank" class="cb f13"><?=$bqsr2[classname]?></a>
</div>
</li>
<?php
}
//显示2条
?>
</ul>
</div>
<div class="hd">
<ul class="num">
<li class="fl on">1</li>
<li class="fl">2</li>
<li class="fl">3</li>
</ul>
</div>
<div class="hd">
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],1,1,0,0,'','onclick DESC');
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>
<a href="<?=$bqr2[titleurl]?>" target="<?=$bqr2[title]?>"><?=$bqr2[title]?></a><time class="fr"><?=date('m-d',$bqr2[newstime])?></time>
<?php
}
//显示1条
?>
</div>
</div>
</div>
</div>
<div class="lm_nr_c fl">
<div class="head_3">
<h5 class="f18 nobold fl"><span>
</span>最新文章</h4>
<a class="more fr">Article</a>
</div>
<div class="lm_lb bj_mt20">
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],2,0,0,'','onclick DESC');
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<div class="lb_2">
<a href="<?=$bqsr3[classurl]?>" title="<?=$bqsr3[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$bqsr3[classname]?></a>
<div class="fl lb_l">
<a href="<?=$bqr3[titleurl]?>" title="<?=$bqr3[title]?>" target="_blank" class="bt_a chao bold"><?=$bqr3[title]?><time><?=date('m-d',$bqr3[newstime])?></time></a>
<p class="chao c9 f13"><?=$bqr3[smalltext]?></p>
</div>
</div>
<?php
}
//显示2条
?>
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],6,0,0,'','newstime desc');
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<div class="lb_1">
<a href="<?=$bqsr3[classurl]?>" title="<?=$bqsr3[classname]?>" target="_blank" class="lm_a chao fl"><?=$bqsr3[classname]?></a>
<a href="<?=$bqr3[titleurl]?>" title="<?=$bqr3[title]?>" target="_blank" class="bt_a chao fl"><?=$bqr3[title]?></a>
<time class="fr"><?=date('m-d',$bqr3[newstime])?></time>
</div>
<?php
}
//显示6条
?>
</div>
</div>
<div class="lm_nr_r fr">
<div class="head_3">
<h6 class="f18 nobold fl"><span></span>热门排行</h4>
<a class="more fr">Rank</a>
</div>
<div class="lm_lb bj_mt20">
<div class="lb_3">
<?php
$ecms_bq_sql4=sys_ReturnEcmsLoopBq($bqr[classid],'2,1',0,0,'','onclick DESC');
$bqno4=0;
while($bqr4=$empire->fetch($ecms_bq_sql4))
{
$bqsr4=sys_ReturnEcmsLoopStext($bqr4);
$bqno4++;
?>
<div class="fl lb_on">
<span class="cf f24">0<?=$bqno?></span>
<time class="cf"><?=date('m-d',$bqr4[newstime])?></time>
</div>
<div class="fl lb_l">
<a href="<?=$bqr4[titleurl]?>" title="<?=$bqr4[title]?>" target="_blank" class="bt_a chao bold"><?=$bqr4[title]?></a>
<div class="lb_l_b">
<a href="<?=$bqsr4[classurl]?>" title="<?=$bqsr4[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$bqsr4[classname]?></a>
<p class="chao c9 f13"><?=$bqr4[smalltext]?></p>
</div>
</div>
<?php
}
//显示1条
?>
</div>
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($bqr[classid],'3,8',0,0,'','onclick DESC');
while($bqr4=$empire->fetch($ResultG)){
$bqsr=sys_ReturnEcmsLoopStext($bqr4);
$bqno++;
?>
<div class="lb_1">
<span>0<?=$bqno+1?></span>
<a href="<?=$bqsr4[classurl]?>" title="<?=$bqsr4[classname]?>" target="_blank" class="lm_a chao fl"><?=$bqsr4[classname]?></a>
<a href="<?=$bqr4[titleurl]?>" title="<?=$bqr4[title]?>" target="_blank" class="bt_a chao fl"><?=$bqr4[title]?></a>
<time class="fr"><?=date('m-d',$bqr4[newstime])?></time>
</div>
<?php
}
//显示8条
?>
</div>
</div>
<?php
}
?>
<div class="clear"></div>
</div>
</div>
[/e:loop]
新闻资讯 更多
- 【帝国cms教程】帝国cmsPHP循环一级栏目子栏目以及子栏目下的栏目信息支持PHP7.x04-11
- 【帝国cms教程】帝国cms下载地址转码加密base6404-11
- 【帝国cms教程】火车头采集发布到帝国cms后为未(待)审核状态设置教程详解04-11
- 【帝国cms教程】帝国cms对接微信官方支付v3的微信支付签名验证失败解决办法(supe对接支付宝微信官方支付说明文档)04-11
- 【帝国cms教程】帝国cms历史上的今天开发实例/php实现获取农历(阴历)、节日、节气的类与用法示例04-11
- 【帝国cms教程】帝国cms内容页如何随机插入一张图片?04-11
- 【帝国cms教程】帝国cms用php分割/切割数组字段/多值字段并且单个输出04-11
- 【帝国cms教程】帝国cms单页循环调用所有专题/更新时间及对应专题下的文章标题和链接04-11
热门文章
- 178Moban源码谈谈免费源码与收费源码的区别
- 2帝国CMS忘记后台登陆用户名、密码、认证码的解决方法
- 3帝国CMS(EmpireCMS) v7.5后台任意代码执行漏洞及具体修复方法
- 4帝国CMS和WordPress 哪个好?哪个适合建站?
- 5如何解决Discuz的密码错误次数过多请15分钟后登陆的问题
- 6帝国cms灵动标签取得内容和栏目链接地址
- 7emlog pro 注册码“开心”教程(如果有一天,emlog官方版 或者 emlog免费版 跑路了,那用户怎么办?)
- 8帝国cms后台登录出现”您还未登录”怎么解决?
- 9织梦CMS在nginx下设置伪静态方法(附nginx伪静态规则)
- 10帝国cms7.5忘记登录密码 和忘记登录认证码以及多次登录 失败被锁定解决办法