VIP福利
主页 > 建站问题 > CMS教程 > 帝国cms灵动标签实现循环子栏目数据

帝国cms灵动标签实现循环子栏目数据

? php 02 $bclassid=$GLOBALS[navclassid];//取得本栏目id 03 //取得本栏目下的子栏目 04 ? 05 [e:loop={select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid=$bclassid order by `classid` desc ,7,24,0}] 06 dl class = lbox 07 ? php 08 //这里是取得该分类下的有图片的最 […]



<?php
02 $bclassid=$GLOBALS[navclassid];//取得本栏目id
03 //取得本栏目下的子栏目
04 ?>
05 [e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` desc ",7,24,0}]
06 <dl class="lbox">
07 <?php
08 //这里是取得该分类下的有图片的最新数据
09 $commbook=$empire->fetch1("select title,titlepic,smalltext,titleurl,keyboard,groupid,classid,newspath,filename,id from {$dbtbpre}ecms_news where classid = ".$bqr[classid]." and titlepic!='' order by newstime desc limit 1");
10 $commbookurl=sys_ReturnBqTitleLink($commbook);
11 ?>
12 <dt>
13   <h5><a href="<?=$public_r[newsurl].$bqr[classpath]?>"><?=$bqr[classname]?></a></h5>
14   <span class="more"><a href="<?=$public_r[newsurl].$bqr[classpath]?>">更多</a></span></dt>
15 <dd>
16   <ul class="list">
17   <li class="p1"><a href="<?=$commbookurl?>" target="_blank"><img src="<?=$commbook[titlepic]?>"></a><a href="<?=$commbookurl?>" target="_blank"><?=esub($commbook[title],28)?></a>
18 <p><?=esub($commbook[smalltext],64)?>...</p>
19   </li>
20     <?php
21 //取得该分类下的最新数据
22     $newbook=$empire->query("select title,titlepic,smalltext,titleurl,keyboard,newstime,groupid,classid,newspath,filename,id from {$dbtbpre}ecms_news  where classid =".$bqr[classid]." order by newstime desc limit 5");
23     while($r=$empire->fetch($newbook)) {
24     ?>
25     <li><a href="<?=sys_ReturnBqTitleLink($r)?>" title="<?=$r[title]?>"><?=$r[title]?></a><span><?=date('Y-m-d',$r[newstime])?></span></li>
26     <?php
27      }
28      //显示5条
29     ?>
30   </ul>
31    </dd>
32   </dl>
33   [/e:loop]


说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!