帝国cms 循环调用标签的实例代码

发布时间:2019-07-14编辑:脚本学堂
在帝国cms循环调用标签的情况,还是会经常碰到的,今天为大家举一个这样的例子,有需要的朋友,不妨参考下。

cms/ target=_blank class=infotextkey>帝国cms循环调用标签的例子。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>帝国cms循环调用标签_www.jb200.com</title>
</head>
<body>
<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]?>">· <?=esub($r[title],10)?> </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>
    </body>
</html>