帝国cms通过扩展变量调用栏目ID循环展示子栏目及子栏目下的文章信息
时间:2024年04月23日
/来源:网络
/编辑:佚名
说明一下:
以下 <?=$IndexClass[classname]?> 位置显示为父栏目名称,<?=$ClassLink?>为父栏目链接
想要显示当前信息所属的子栏目名称及链接,改成<?=$bqsr[classname]?>及<?=$bqsr[classurl]?>
<!-- 循环开始 -->
<?php
$Result = sys_ReturnEcmsLoopBq("select classid,classname from {$dbtbpre}enewsclass where classid in($public_r[add_zhann_home_classid]) order by myorder,myorder desc",0,24,0);
while($IndexClass=$empire->fetch($Result)){
$ClassLink = sys_ReturnBqClassname($IndexClass,9);
?>
<div class="con_lm bj_mt30 louti">
<div class="head_2 main">
<!-- 栏目标题 -->
<div class="fl lm_head_l">
<h3>
<em class="iconfont cb f24"></em>
<a href="<?=$ClassLink?>" target="_blank" title="<?=$IndexClass[classname]?>" class="f24 ca"><?=$IndexClass[classname]?></a>
</h3>
</div>
<!-- 栏目标题 -->
<div class="fr lm_head_r">
[e:loop={"select * from phome_enewsclass where bclassid=$IndexClass[classid] order by classid asc limit 25",0,24,0}]
<li><a href="<?=$bqsr[classurl]?>" target="_blank" class="head_ra chao fl"><?=$bqr[classname]?></a></li>
[/e:loop]
</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"><em class="iconfont cb f18"></em>热门图文</h4>
<a href="<?=$ClassLink?>" target="_blank" title="更多" class="more fr">更多</a>
</div>
<div class="hot_tw main bj_mt20">
<div class="bd">
<ul class="infoList">
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],2,0,1);
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<li>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="a_img photo hidden yj_10 chao"><img src="<?=$ClassGoods[titlepic]?>" alt="<?=$ClassGoods[title]?>"></a>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao bj_mt20 f18"><?=$ClassGoods[title]?></a>
<p class="chao3 c9 f13 bj_mt10"><?=$ClassGoods[smalltext]?></p>
<div class="li_b bj_mt10">
<time><?=date('m-d',$ClassGoods[newstime])?></time>
<a href="<?=$bqsr[classurl]?>" title="<?=$IndexClass[classname]?>" target="_blank" class="cb f13"><?=$bqsr[classname]?></a>
</div>
</li>
<?php
}
//显示2条
?>
</ul>
</div>
<div class="hd">
<ul class="num">
<li class="fl"><?=$bqno?></li>
</ul>
</div>
</div>
</div>
<div class="lm_nr_c fl">
<div class="head_3">
<h4 class="f18 nobold fl"><em class="iconfont ca f18"></em>最新文章</h4>
<a href="<?=$ClassLink?>" target="_blank" title="更多" class="more fr">更多</a>
</div>
<div class="lm_lb bj_mt20">
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],2,0,0,'','onclick DESC');
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<div class="lb_2">
<a href="<?=$ClassLink?>" title="<?=$IndexClass[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$IndexClass[classname]?></a>
<div class="fl lb_l">
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao bold"><?=$ClassGoods[title]?><time><?=date('m-d',$ClassGoods[newstime])?></time></a>
<p class="chao c9 f13"><?=$ClassGoods[smalltext]?></p>
</div>
</div>
<?php
}
//显示2条
?>
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],6,0,0,'','newstime DESC');
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<div class="lb_1">
<a href="<?=$ClassLink?>" title="<?=$IndexClass[classname]?>" target="_blank" class="lm_a chao fl"><?=$IndexClass[classname]?></a>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao fl"><?=$ClassGoods[title]?></a>
<time class="fr"><?=date('m-d',$ClassGoods[newstime])?></time>
</div>
<?php
}
//显示6条
?>
</div>
</div>
<div class="lm_nr_r fr">
<div class="head_3">
<h4 class="f18 nobold fl"><em class="iconfont cb f18"></em>热门排行</h4>
<a href="<?=$ClassLink?>" target="_blank" title="更多" class="more fr">更多</a>
</div>
<div class="lm_lb bj_mt20">
<div class="lb_3">
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],'2,1',0,0,'','onclick DESC');
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<div class="fl lb_on">
<span class="cf f24">0<?=$bqno?></span>
<time class="cf"><?=date('m-d',$ClassGoods[newstime])?></time>
</div>
<div class="fl lb_l">
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao bold"><?=$ClassGoods[title]?></a>
<div class="lb_l_b">
<a href="<?=$ClassLink?>" title="<?=$IndexClass[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$IndexClass[classname]?></a>
<p class="chao c9 f13"><?=$ClassGoods[smalltext]?></p>
</div>
</div>
<?php
}
//显示1条
?>
</div>
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],'3,8',0,0,'','onclick DESC');
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<div class="lb_1">
<span>0<?=$bqno+1?></span>
<a href="<?=$ClassLink?>" title="<?=$IndexClass[classname]?>" target="_blank" class="lm_a chao fl"><?=$IndexClass[classname]?></a>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao fl"><?=$ClassGoods[title]?></a>
<time class="fr"><?=date('m-d',$ClassGoods[newstime])?></time>
</div>
<?php
}
//显示8条
?>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<?
}
?>
<!--栏目循环end-->
以下 <?=$IndexClass[classname]?> 位置显示为父栏目名称,<?=$ClassLink?>为父栏目链接
想要显示当前信息所属的子栏目名称及链接,改成<?=$bqsr[classname]?>及<?=$bqsr[classurl]?>
<!-- 循环开始 -->
<?php
$Result = sys_ReturnEcmsLoopBq("select classid,classname from {$dbtbpre}enewsclass where classid in($public_r[add_zhann_home_classid]) order by myorder,myorder desc",0,24,0);
while($IndexClass=$empire->fetch($Result)){
$ClassLink = sys_ReturnBqClassname($IndexClass,9);
?>
<div class="con_lm bj_mt30 louti">
<div class="head_2 main">
<!-- 栏目标题 -->
<div class="fl lm_head_l">
<h3>
<em class="iconfont cb f24"></em>
<a href="<?=$ClassLink?>" target="_blank" title="<?=$IndexClass[classname]?>" class="f24 ca"><?=$IndexClass[classname]?></a>
</h3>
</div>
<!-- 栏目标题 -->
<div class="fr lm_head_r">
[e:loop={"select * from phome_enewsclass where bclassid=$IndexClass[classid] order by classid asc limit 25",0,24,0}]
<li><a href="<?=$bqsr[classurl]?>" target="_blank" class="head_ra chao fl"><?=$bqr[classname]?></a></li>
[/e:loop]
</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"><em class="iconfont cb f18"></em>热门图文</h4>
<a href="<?=$ClassLink?>" target="_blank" title="更多" class="more fr">更多</a>
</div>
<div class="hot_tw main bj_mt20">
<div class="bd">
<ul class="infoList">
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],2,0,1);
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<li>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="a_img photo hidden yj_10 chao"><img src="<?=$ClassGoods[titlepic]?>" alt="<?=$ClassGoods[title]?>"></a>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao bj_mt20 f18"><?=$ClassGoods[title]?></a>
<p class="chao3 c9 f13 bj_mt10"><?=$ClassGoods[smalltext]?></p>
<div class="li_b bj_mt10">
<time><?=date('m-d',$ClassGoods[newstime])?></time>
<a href="<?=$bqsr[classurl]?>" title="<?=$IndexClass[classname]?>" target="_blank" class="cb f13"><?=$bqsr[classname]?></a>
</div>
</li>
<?php
}
//显示2条
?>
</ul>
</div>
<div class="hd">
<ul class="num">
<li class="fl"><?=$bqno?></li>
</ul>
</div>
</div>
</div>
<div class="lm_nr_c fl">
<div class="head_3">
<h4 class="f18 nobold fl"><em class="iconfont ca f18"></em>最新文章</h4>
<a href="<?=$ClassLink?>" target="_blank" title="更多" class="more fr">更多</a>
</div>
<div class="lm_lb bj_mt20">
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],2,0,0,'','onclick DESC');
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<div class="lb_2">
<a href="<?=$ClassLink?>" title="<?=$IndexClass[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$IndexClass[classname]?></a>
<div class="fl lb_l">
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao bold"><?=$ClassGoods[title]?><time><?=date('m-d',$ClassGoods[newstime])?></time></a>
<p class="chao c9 f13"><?=$ClassGoods[smalltext]?></p>
</div>
</div>
<?php
}
//显示2条
?>
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],6,0,0,'','newstime DESC');
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<div class="lb_1">
<a href="<?=$ClassLink?>" title="<?=$IndexClass[classname]?>" target="_blank" class="lm_a chao fl"><?=$IndexClass[classname]?></a>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao fl"><?=$ClassGoods[title]?></a>
<time class="fr"><?=date('m-d',$ClassGoods[newstime])?></time>
</div>
<?php
}
//显示6条
?>
</div>
</div>
<div class="lm_nr_r fr">
<div class="head_3">
<h4 class="f18 nobold fl"><em class="iconfont cb f18"></em>热门排行</h4>
<a href="<?=$ClassLink?>" target="_blank" title="更多" class="more fr">更多</a>
</div>
<div class="lm_lb bj_mt20">
<div class="lb_3">
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],'2,1',0,0,'','onclick DESC');
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<div class="fl lb_on">
<span class="cf f24">0<?=$bqno?></span>
<time class="cf"><?=date('m-d',$ClassGoods[newstime])?></time>
</div>
<div class="fl lb_l">
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao bold"><?=$ClassGoods[title]?></a>
<div class="lb_l_b">
<a href="<?=$ClassLink?>" title="<?=$IndexClass[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$IndexClass[classname]?></a>
<p class="chao c9 f13"><?=$ClassGoods[smalltext]?></p>
</div>
</div>
<?php
}
//显示1条
?>
</div>
<?php
$bqno=0;
$ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],'3,8',0,0,'','onclick DESC');
while($ClassGoods=$empire->fetch($ResultG)){
$bqno++;
?>
<div class="lb_1">
<span>0<?=$bqno+1?></span>
<a href="<?=$ClassLink?>" title="<?=$IndexClass[classname]?>" target="_blank" class="lm_a chao fl"><?=$IndexClass[classname]?></a>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="bt_a chao fl"><?=$ClassGoods[title]?></a>
<time class="fr"><?=date('m-d',$ClassGoods[newstime])?></time>
</div>
<?php
}
//显示8条
?>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<?
}
?>
<!--栏目循环end-->
新闻资讯 更多
- 【帝国cms教程】帝国cms通过扩展变量调用栏目ID循环展示子栏目及子栏目下的文章信息04-23
- 【帝国cms教程】宝塔开启ssi (宝塔linux面板nginx开启ssi)04-23
- 【帝国cms教程】帝国CMS批量替换栏目的页面关键字和栏目简介 mysql数据库替换 函数 REPLACE04-23
- 【帝国cms教程】帝国cms查询关联匹配高效率sql语句/like替代语句04-23
- 【帝国cms教程】帝国cms导航php判断子栏目数量超出10个显示更多连接到父栏目地址04-23
- 【帝国cms教程】帝国CMS灵动标签栏目排序写法04-23
- 【帝国cms教程】帝国CMS内容页调用TAG的5种方法!包括PHP和灵动还有样式改造04-23
- 【帝国cms教程】帝国cms灵动标签php获取指定栏目下的子栏目名称链接以及子栏目文章及所属栏目名链接04-12
热门文章
- 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忘记登录密码 和忘记登录认证码以及多次登录 失败被锁定解决办法