當(dāng)前位置:首頁(yè) >  站長(zhǎng) >  編程技術(shù) >  正文

帝國(guó)cms靈動(dòng)標(biāo)簽實(shí)現(xiàn)循環(huán)子欄目數(shù)據(jù)

 2020-10-29 14:45  來源: 黎青松SEO博客   我來投稿 撤稿糾錯(cuò)

  域名預(yù)訂/競(jìng)價(jià),好“米”不錯(cuò)過

<pre class="brush:html;">你知道帝國(guó)cms靈動(dòng)標(biāo)簽如何實(shí)現(xiàn)循環(huán)子欄目數(shù)據(jù)嗎?其實(shí)代碼很簡(jiǎn)單,下面小編就來介紹一下。</pre> <pre class="brush:html;"><?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
//這里是取得該分類下的有圖片的最新數(shù)據(jù)
$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
//取得該分類下的最新數(shù)據(jù)
    $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]</pre>

文章轉(zhuǎn)自:黎青松SEO博客

來源地址:http://www.alitaohuo.com/CMSjiaocheng/diguojiaocheng/1855.html

申請(qǐng)創(chuàng)業(yè)報(bào)道,分享創(chuàng)業(yè)好點(diǎn)子。點(diǎn)擊此處,共同探討創(chuàng)業(yè)新機(jī)遇!

相關(guān)標(biāo)簽
帝國(guó)cms

相關(guān)文章

熱門排行

信息推薦