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

网站建设 2022-07-27 08:12www.1681989.com免费网站
? 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 $mbook=$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 $mbookurl=sys_ReturnBqTitleLk($mbook);
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="<?=$mbookurl?>" target="_blank"><img src="<?=$mbook[titlepic]?>"></a><a href="<?=$mbookurl?>" target="_blank"><?=esub($mbook[title],28)?></a>
18 <p><?=esub($mbook[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_ReturnBqTitleLk($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]


Copyright © 2016-2025 www.1681989.com 推火网 版权所有 Power by