例子1 指定一个大栏目ID
成都创新互联公司专注于崇左企业网站建设,响应式网站开发,成都做商城网站。崇左网站建设公司,为崇左等地区提供建站服务。全流程专业公司,专业设计,全程项目跟踪,成都创新互联公司专业和态度为您提供的服务
[e:loop={"select * from [!db.pre!]enewsclass where classid in(1)",10,24,0}]
a href="/?=$bqr[classpath]?"?=$bqr[classname]?/a|?=$bqr[classid]?|?=$bqr[tbname]?
ul
?php
$ecms_bq_sql1=sys_ReturnEcmsLoopBq("select * from phome_enewsclass where bclassid in($bqr[classid])",10,24,0);
$bqno1=0;
while($bqr1=$empire-fetch($ecms_bq_sql1))
{
$bqsr1=sys_ReturnEcmsLoopStext($bqr1);
$bqno++;
?
a href="/?=$bqr1[classpath]?"?=$bqr1[classname]?/a|?=$bqr1[classid]?|?=$bqr1[tbname]?
ul
?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq("select * from phome_enewsclass where bclassid in($bqr1[classid])",10,24,0);
$bqno2=0;
while($bqr2=$empire-fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?
a href="/?=$bqr2[classpath]?"?=$bqr2[classname]?/a|?=$bqr2[classid]?|?=$bqr2[tbname]?
?php
}
? /ul
?php
}
?
/ul
[/e:loop]
例子2 调用本栏目下的 且高亮
[e:loop={"select classid,classname,classpath from [!db.pre!]enewsclass where bclassid = '".$class_r[$GLOBALS[navclassid]][bclassid]."' order by classid",0,24,0}]
?
$class="";
if($GLOBALS[navclassid]==$bqr[classid])
$class="current";
{
?
li class="?=$class?"
?=$bqr[num]?
a href="?=$public_r[newsurl]??=$bqr[classpath]?" target="_self"
?=$bqr[classname]?
/a/li
?php
}
?
[/e:loop]
例子三全部调用 且 高亮
[e:loop={'select classid,classname,classpath,wburl from [!db.pre!]enewsclass where bclassid=0 and showclass=0 order by myorder limit 9',0,24,0}]
li
a href="?php
if(empty($bqr[wburl]))
{
echo $public_r[newsurl].$bqr[classpath];
} else {
echo $bqr[wburl];
}
?" title="?=$bqr[classname]?" id="cid?=$bqr[classid]?" ?=currentPage($GLOBALS[navclassid],$bqr[classid])? target="_self"?=$bqr[classname]?/a/li
[/e:loop]
/ul
/div
ul class="subnav"
[e:loop={"select classid,classname,classpath from [!db.pre!]enewsclass where bclassid = '".$class_r[$GLOBALS[navclassid]][bclassid]."' order by classid",0,24,0}]
?
$class="";
if($GLOBALS[navclassid]==$bqr[classid])
$class="current";
{
?
li class="?=$class?"
?=$bqr[num]?
a href="?=$public_r[newsurl]??=$bqr[classpath]?" target="_self"
?=$bqr[classname]?
/a/li
?php
}
?
[/e:loop]
可以。只要是规律的都可以。
一些没有规律的可以写一个模板然后调用。
比如栏目下有动作片,喜剧片,爱情片,且需循环以下代码,显示结果见附件
div class="AntVideoMain mb5px"
div class="Left"
div class="AntCom" style="height:210px;"
h2em class="Vod2"/ema href="" target="_blank"更多/a动作片/h2
div class="AntNewVideo"
ul
[e:loop={0,5,3,1}]
li
div class="Img"
a href="?=$bqsr[titleurl]?"
target="_blank"img src="?=$bqr[titlepic]?" width="120"
height="90" //a
/div
div class="Ti"a href="?=$bqsr[titleurl]?"
target="_blank"?=$bqr[title]?/a/div
divem
class="pl"?=$bqr[onclick]?/emem
class="co"?=$bqr[plnum]?/em/div
/li[/e:loop]
/ul
/div
/div
/div
div class="Right"
div class="AntCom" style="height:210px;"
h2em class="Vod1"/ema href="" target="_blank"更多/a动作片排行/h2
div class="AntRankingVideo"
div class="AntVideoList"
ul
[e:loop={0,1,3,1}]li class="Current"
div class="in"a href="?=$bqsr[titleurl]?"
target="_blank"?=$bqr[title]?/aem播放:
lt;?=$bqr[onclick]?/emem评论:?=$bqr[plnum]?
lt;/em/div
div class="upimg"a
href="?=$bqsr[titleurl]?" target="_blank"img
src="?=$bqr[titlepic]?" width="130" height="100"
//a/div
/li[/e:loop]
[e:loop={0,4,3,1}]li class="de" style="line-height:22px; height:22px;"
div class="in"a
href="?=$bqsr[titleurl]?"
target="_blank"?=$bqr[title]?/aem播放:
lt;?=$bqr[onclick]?/emem评论:?=$bqr[plnum]?
lt;/em
/div[/e:loop]
/li
/ul
/div
/div
/div
/div