帝国cms封面模板页循环调用当前栏目下的子栏目以及子栏目下的栏目以及信息
时间:2024年04月11日
/来源:网络
/编辑:佚名
<!-- 循环开始 -->
<?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.78moban.com/xuexiziliao/ 示例页面
<?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.78moban.com/xuexiziliao/ 示例页面
新闻资讯 更多
- 【帝国cms教程】帝国cms封面模板页循环调用当前栏目下的子栏目以及子栏目下的栏目以及信息04-11
- 【帝国cms教程】帝国cms根据标题自动在线生成标题缩略图图片优化版04-11
- 【帝国cms教程】帝国cms灵动标签调用相关文章04-11
- 【帝国cms教程】帝国cms扩展变量调用指定id的文章04-11
- 【帝国cms教程】帝国cms删除原有系统数据表和系统模型后,如何让数据表或者系统id连续性从1开始04-11
- 【帝国cms教程】帝国CMS删除某条或N条文章后如何保持文章id连续性04-11
- 【帝国cms教程】帝国cms会员注册如何取消选择注册会员类型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忘记登录密码 和忘记登录认证码以及多次登录 失败被锁定解决办法