V6.5在原來所有信息調(diào)用標(biāo)簽基礎(chǔ)上增加了兩個標(biāo)簽參數(shù):“附加SQL條件”和“顯示排序”,。
支持這兩個參數(shù)的標(biāo)簽有如下:
ecmsinfo,、靈動標(biāo)簽、phomenews,、phomenewspic,、phomeflashpic、phomeautopic,、listsonclass,、phomenewstext
以靈動標(biāo)簽為例,6.5版標(biāo)簽語法為:
[e:loop={欄目ID/專題ID,顯示條數(shù),操作類型,只顯示有標(biāo)題圖片,附加SQL條件,顯示排序}]模板代碼內(nèi)容[/e:loop]
其中“附加SQL條件”和“顯示排序”這兩個參數(shù),,如果不使用可以不設(shè)置或者則用''兩個單引號表示,。例如:
[e:loop={1,10,0,0,'',''}]和[e:loop={1,10,0,0}]是一樣的效果,。
舉例說明:
例子1:調(diào)用標(biāo)題包含“cms”的新聞
6.0以前版本要使用SQL調(diào)用,如下:
[e:loop={"select * from phome_ecms_news where title like '%cms%' and checked=1 order by newstime desc limit 10",10,24,0}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>[/e:loop]
而6.5版本用下面就可以實現(xiàn)上面效果:
[e:loop={'news',10,18,0,"title like '%cms%'",''}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>[/e:loop]
無需寫SQL語句,,而且調(diào)用父欄目時不需要按原來SQL調(diào)用寫全所有終極欄目ID,,更簡單更方便。
例子2:按DIGG頂數(shù)降序顯示新聞信息
6.0以前版本要使用SQL調(diào)用,,如下:
[e:loop={"select * from phome_ecms_news where checked=1 order by diggtop desc limit 10",10,24,0}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>[/e:loop]
而6.5版本用下面就可以實現(xiàn)上面效果:
[e:loop={'news',10,18,0,'','diggtop desc'}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>[/e:loop]
還支持多字段排序,,比如:'istop desc,id desc,title desc'
例子3:顯示一周內(nèi)信息點擊排行
6.0以前版本要使用SQL調(diào)用,如下:
[e:loop={"select * from phome_ecms_news where checked=1 and newstime>UNIX_TIMESTAMP()-86400*7 order by onclick desc limit 10",10,24,0}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>[/e:loop]
而6.5版本用下面就可以實現(xiàn)上面效果:
[e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*7','onclick desc'}]<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>[/e:loop]
上面是以靈動標(biāo)簽為例,,其他信息調(diào)用標(biāo)簽使用也是一樣,,參數(shù)后面直接加上面兩個參數(shù)即可。