帝国CMS模板调用当前栏目的tag或指定的tag
- 四种调用方法:
- 用法1:
[e:loop={"select DISTINCT([!db.pre!]enewstags.tagname),[!db.pre!]enewstags.tagid,[!db.pre!]enewstags.num from [!db.pre!]enewstags inner join [!db.pre!]enewstagsdata on [!db.pre!]enewstags.tagid = [!db.pre!]enewstagsdata.tagid where [!db.pre!]enewstagsdata.classid = 34 order by [!db.pre!]enewstags.num DESC limit 30",0,24}] <a href='<?=$public_r['newsurl']?>e/tags/?tagname=<?=$bqr['tagname']?>' title='<?=$bqr['num']?>个'><?=$bqr['tagname']?> (<?=$bqr['num']?>)</a> [/e:loop]
- 用法2:
[e:loop={"select a.tagname,a.num,b.tagid from [!db.pre!]enewstags a,[!db.pre!]enewstagsdata b where a.tagid=b.tagid and classid=34 group by tagid order by num desc limit 40",40,24,0}] <a href='<?=$public_r['newsurl']?>e/tags/?tagname=<?=$bqr['tagname']?>' title='<?=$bqr['num']?>个'><?=$bqr['tagname']?> (<?=$bqr['num']?>)</a> [/e:loop]
- 用法3:
用法4:[e:loop={"select a.*,b.* from [!db.pre!]enewstags a,[!db.pre!]enewstagsdata b where a.tagid=b.tagid and classid=34 group by b.tagid order by a.num desc limit 40",40,24,0}] <a href='<?=$public_r['newsurl']?>e/tags/?tagname=<?=$bqr['tagname']?>' title='<?=$bqr['num']?>个'><?=$bqr['tagname']?> (<?=$bqr['num']?>)</a> [/e:loop]
-
[e:loop={"select a.*,b.* from [!db.pre!]enewstags a LEFT JOIN [!db.pre!]enewstagsdata b ON a.tagid=b.tagid where classid=34 group by b.tagid order by a.num desc limit 100",0,24,0}] <a href='<?=$public_r['newsurl']?>e/tags/?tagname=<?=$bqr['tagname']?>' title='<?=$bqr['num']?>个'><?=$bqr['tagname']?> (<?=$bqr['num']?>)</a> [/e:loop]
- 用法1: