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

  • A+
所属分类:帝国cms教程

<?php
$bclassid=$GLOBALS[navclassid];//取得本栏目id
//取得本栏目下的子栏目
?>
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` desc ",7,24,0}]
<dl class="lbox">
<?php
//这里是取得该分类下的有图片的最新数据
$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");
$commbookurl=sys_ReturnBqTitleLink($commbook);
?>
<dt>
  <h5><a href="<?=$public_r[newsurl].$bqr[classpath]?>"><?=$bqr[classname]?></a></h5>
  <span class="more"><a href="<?=$public_r[newsurl].$bqr[classpath]?>">更多</a></span></dt>
<dd>
  <ul class="list">
  <li class="p1"><a href="<?=$commbookurl?>" target="_blank"><img src="<?=$commbook[titlepic]?>"></a><a href="<?=$commbookurl?>" target="_blank"><?=esub($commbook[title],28)?></a>
<p><?=esub($commbook[smalltext],64)?>...</p>
  </li>
    <?php
//取得该分类下的最新数据
    $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");
    while($r=$empire->fetch($newbook)) {
    ?>
    <li><a href="<?=sys_ReturnBqTitleLink($r)?>" title="<?=$r[title]?>"><?=$r[title]?></a><span><?=date('Y-m-d',$r[newstime])?></span></li>
    <?php
     }
     //显示5条
    ?>
  </ul>
   </dd>
  </dl>
  [/e:loop]

循环子栏目标签 1

<div class="channel">
<h2><span><a href='[!--the.classurl--]'>更多>></a></span><a href='[!--the.classurl--]'>[!--the.classname--]</a></h2>
<div class="channel-hd"> <div class="pic-area"><a href="[!--sonclass.titleurl--]"><img src="[!--sonclass.titlepic--]" width="120" height="100" /></a></div>
<div class="txt-area">
<h3><a href="[!--sonclass.titleurl--]" target="_blank">[!--sonclass.title--]</a></h3>
<p>[!--sonclass.text--]...<a href="[!--sonclass.titleurl--]">[详细]</a></p>
</div>
</div>
<ul>[!--empirenews.listtemp--]
<!--list.var1-->
[!--empirenews.listtemp--]

</ul>
</div>
<li><span>[!--newstime--]</span><a href="[!--titleurl--]" target="_blank">[!--title--]</a></li>
[listsonclass]'selfinfo',4,32,1,0,17,0,0,4,32,80,1[/listsonclass]

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: