简单调用:
[e:loop={"select * from phome_enewszt where ztimg<>'' order by onclick desc limit 5",10,24,0}]
<li>
<a href="/<?=$bqr['ztpath']?>/" title="<?=$bqr['ztname']?>">
<img src="<?=$bqr['ztimg']?>" alt="<?=$bqr['ztname']?>">
<p><?=$bqr['ztname']?></p>
</a>
</a></li>
[/e:loop]
高级玩法循环调用代码如下:
<?php
$ecms_bq_sql=sys_ReturnEcmsLoopBq("select ztid,ztpath,ztname from [!db.pre!]enewszt limit 100",0,24,0);
$bqno=0;
while($bqr=$empire->fetch($ecms_bq_sql))
{
$ztid=($bqr[ztid]);
$bqno++;
?>
模板代码内容 <a href="<?=$public_r[newsurl]?><?=$bqr['ztpath']?>/"><?=$bqr['ztname']?></a>
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq("select id,ztid,classid from [!db.pre!]enewsztinfo where ztid='$ztid' limit 10",0,24,0);
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$id=($bqr2[id]);
$bqno2++;
?>
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq("select titleurl,title,classid,titlepic from {$dbtbpre}ecms_{$class_r[$bqr2[classid]][tbname]} where id={$bqr2[id]}",0,24,0);
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<li><a href="<?=$bqsr3[titleurl]?>" target="_blank"><?=$bqr3[title]?></a></li>
<?php
}
?>
<?php
}
?>
<?php
}
?>
应用示例:标识码:333ttt
<?php
$ecms_bq_sql=sys_ReturnEcmsLoopBq("select ztid,ztpath,ztname from [!db.pre!]enewszt limit 4",0,24,0);
$bqno=0;
while($bqr=$empire->fetch($ecms_bq_sql))
{
$ztid=($bqr[ztid]);
$bqno++;
?>
<li>
<a href="/<?=$bqr['ztpath']?>/">
<div class="img">
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq("select id,ztid,classid from [!db.pre!]enewsztinfo where ztid='$ztid' limit 4",0,24,0);
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$id=($bqr2[id]);
$bqno2++;
?>
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq("select titleurl,title,classid,titlepic from {$dbtbpre}ecms_{$class_r[$bqr2[classid]][tbname]} where id={$bqr2[id]}",0,24,0);
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<img src="<?=$bqr3[titlepic]?>" alt="">
<?php
}
?>
<?php
}
?>
</div>
<p><?=$bqr['ztname']?></p>
</a>
</li>
<?php
}
?>
需要显示专题更新时间,就添加查询addtime,然后输出变量<?=date(“Y-m-d H:i:s”,$bqr[addtime])?>即可
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论(0)