帝国cms封面模板页循环调用当前栏目下的子栏目以及子栏目下的栏目以及信息

 

<!-- 循环开始 -->
<?php
$Result = sys_ReturnEcmsLoopBq("select classid,classname from {$dbtbpre}enewsclass where bclassid='$GLOBALS[navclassid]' order by myorder,classid asc",0,24,0);
while($IndexClass=$empire->fetch($Result)){
  $ClassLink = sys_ReturnBqClassname($IndexClass,9);
?>
<div class="lm louti bj_mt26">
	<div class="lm_l fl">
		<div class="lm_title">
			<h3 class="fl">
				<em class="iconfont icon-xuexi1"></em>
				<a href="<?=$ClassLink?>" target="_blank" title="<?=$IndexClass[classname]?>"><?=$IndexClass[classname]?></a>
			</h3>
			<div class="lm_nav1 tag fl">
[e:loop={"select * from phome_enewsclass where bclassid=$IndexClass[classid] order by classid asc limit 5",0,24,0}]				
				<a href="<?=$bqsr[classurl]?>"  target="_blank" title="<?=$bqr[classname]?>" class="lm_btn"><?=$bqr[classname]?></a>
[/e:loop]	
			</div>			
			<a href="<?=$ClassLink?>" target="_blank" class="more cb fr">更多</a>
		</div>
		<div class="lm_rwap bj_mt30">
			<div class="lm_itme fl">
				<div class="pic_lb3">
<?php
$bqno=0;
  $ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],1,0,1,'','onclick DESC');
  while($ClassGoods=$empire->fetch($ResultG)){
    $bqsr=sys_ReturnEcmsLoopStext($ResultG);
$bqsr=sys_ReturnEcmsLoopStext($ClassGoods);
$bqno++;
?>
					<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="lb_img photo"><img src="<?=$ClassGoods[titlepic]?$ClassGoods[titlepic]:'/skin/images/'.rand(1,50).'.jpg'?>" alt="<?=$ClassGoods[title]?>"></a>
					<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="lb_bt chao"><?=$ClassGoods[title]?></a>
					<p class="chao2"><?=$ClassGoods[smalltext]?>...</p>
<?php
     }
     //显示1条
?> 
				</div>
<?php
$bqno=0;
  $ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],'2,6',0,0,'','onclick DESC');
  while($ClassGoods=$empire->fetch($ResultG)){
    $bqsr=sys_ReturnEcmsLoopStext($ResultG);
$bqsr=sys_ReturnEcmsLoopStext($ClassGoods);
$bqno++;
?>
<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="lb_5 chao"><span>荐</span><?=$ClassGoods[title]?><time><?=date('m-d',$ClassGoods[newstime])?></time></a>
<?php
     }
     //显示6条
?> 
			</div>
			<div class="lm_itme fr">
				<div class="pic_lb3">
<?php
$bqno=0;
  $ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],'1,1',0,1,'','onclick DESC');
  while($ClassGoods=$empire->fetch($ResultG)){
    $bqsr=sys_ReturnEcmsLoopStext($ResultG);
$bqsr=sys_ReturnEcmsLoopStext($ClassGoods);
$bqno++;
?>
					<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="lb_img photo"><img src="<?=$ClassGoods[titlepic]?>" alt="<?=$ClassGoods[title]?>"></a>
					<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="lb_bt chao"><?=$ClassGoods[title]?></a>
					<p class="chao2"><?=$ClassGoods[smalltext]?>...</p>

<?php
     }
     //显示1条
?> 
				</div>
<?php
$bqno=0;
  $ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],'1,6',0,0,'','newstime DESC');
  while($ClassGoods=$empire->fetch($ResultG)){
    $bqsr=sys_ReturnEcmsLoopStext($ResultG);
$bqsr=sys_ReturnEcmsLoopStext($ClassGoods);
$bqno++;
?>
<div  class="lb_5 lb_6 chao">
	<a href="<?=$bqsr['classurl']?>"  target="_blank" title="<?=$bqsr['classname']?>" class="lb_lm"><?=$bqsr[classname]?></a>
	<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="lb_bt"><?=$ClassGoods[title]?></a>
	<time><?=date('m-d',$ClassGoods[newstime])?></time>
</div>
<?php
     }
     //显示6条
?> 

			</div>
		</div>
	</div>
	<!-- 热门排行 -->
	<div class="r_hot fr">
		<div class="head head1"><h4 class="f16">热门排序</h4><span></span></div>
		<ul class="lm_hot sideMen bj_mt20">
<?php
$bqno=0;
  $ResultG = sys_ReturnEcmsLoopBq($IndexClass[classid],7,0,1,'','rand() DESC');
  while($ClassGoods=$empire->fetch($ResultG)){
    $bqsr=sys_ReturnEcmsLoopStext($ResultG);
$bqsr=sys_ReturnEcmsLoopStext($ClassGoods);
$bqno++;
?>
<?php //加入php代码
if ($bqno==1){ //指定第一条信息
$class = "on"; //第一条信息的样式
}
else{ //其它信息
$class = ""; //其它信息的样式
}
?>
			<li class="lb_w1 <?=$class?>">
				<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="lb_wimg"><em class="icon"></em></a>
				<div class="lb_nr">
					<span><?=$bqno?></span>
					<a href="<?=$ClassGoods[titleurl]?>" title="<?=$ClassGoods[title]?>" target="_blank" class="lb_bt chao2"><?=$ClassGoods[title]?></a>
					<a href="<?=$bqsr['classurl']?>"  target="_blank" title="<?=$bqsr['classname']?>" class="lb_lm"><?=$bqsr['classname']?></a>
				</div>
			</li>
<?php
     }
     //显示7条
?> 
			
		</ul>
	</div>
	<!-- 热门排行 -->
	<div class="clear"></div>
</div>
<?
}
?>
<!-- 循环结束 -->

http://wenxm.xiazaii.net/xuexiziliao/ 示例页面

图片[1]-帝国cms封面模板页循环调用当前栏目下的子栏目以及子栏目下的栏目以及信息-HostJL-VPS主机交流

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容