帝国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">&#xe6ec;</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">&#xe638;</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">&#xe6eb;</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">&#xe67a;</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-->
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。