比如欄目下有動(dòng)作片,喜劇片,愛(ài)情片,且需循環(huán)以下代碼,顯示結(jié)果見(jiàn)附件
成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比華坪網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式華坪網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋華坪地區(qū)。費(fèi)用合理售后完善,十多年實(shí)體公司更值得信賴。
div class="AntVideoMain mb5px"
div class="Left"
div class="AntCom" style="height:210px;"
h2em class="Vod2"/ema href="" target="_blank"更多/a動(dòng)作片/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動(dòng)作片排行/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評(píng)論:?=$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評(píng)論:?=$bqr[plnum]?
lt;/em
/div[/e:loop]
/li
/ul
/div
/div
/div
/div
可以。只要是規(guī)律的都可以。
一些沒(méi)有規(guī)律的可以寫一個(gè)模板然后調(diào)用。
例子1 指定一個(gè)大欄目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 ?調(diào)用本欄目下的 且高亮
[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]
例子三全部調(diào)用 且 高亮
[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]