標簽名稱:循環子欄目數據標簽 (sys_ForSonclassData)
格式:[listsonclass]欄目ID,顯示條數,標題截取數,是否顯示欄目名,操作類型,模板ID,只顯示有標題圖片,顯示欄目數[/listsonclass]
參數說明:
舉例說明:
[listsonclass]9,2,14,0,0,7,0,2[/listsonclass]那麼這個程序上是如何實現呢?可以參考下面:
<div class="sae_gl">
<?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}]
<?php
//這裡是取得該分類下的有圖片的最新數據
$commbook=$empire->fetch1("select title,titlepic,smalltext,titleurl,keyboard,groupid,classid,newspath,filename,id from phome_ecms_news where classid = ".$bqr[classid]." and titlepic!='' order by newstime desc limit 1");
$commbookurl=sys_ReturnBqTitleLink($commbook);
?>
<div class="gl_01" <?php $i++;if($i%2==0){echo 'id="gl_01"';} ?> >
<ol class="gl_c"><h3><?=$bqr[classname]?></h3><a href="<?=$public_r[newsurl].$bqr[classpath]?>">更多>></a></ol>
<div class="yd">
<dl>
<dt><a href="<?=$commbookurl?>"><img src="<?=$commbook[titlepic]?>" width="108px" height="85px" /></a></dt>
<dd><b><a href="<?=$commbookurl?>"><?=$commbook[title]?></a></b><a class="uus" href="#"><?=esub($commbook[smalltext],84)?></a></dd>
</dl>
<ol class="ga_ic">
<?php
//取得該分類下的最新數據
$newbook=$empire->query("select title,titlepic,smalltext,titleurl,keyboard,newstime,groupid,classid,newspath,filename,id from phome_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 class="riq"><?=date('Y-m-d',$r[newstime])?></span></li>
<?php
}
//顯示5條
?>
</ol>
</div>
<div class="bj_t"></div>
</div>
[/e:loop]
</div>