帝国CMS用灵动标签调用tag的最详细教程,tags调用各种技巧大全!

1632人参与 |分类: 程序学习|时间:2019-01-02 19:22:42

第一种 普通灵动标签调用

1、 用名称的调用 tagname=

[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}]

' class='tag-link-' title='个话题' style='font-size: 9pt;' target="_blank">()

[/e:loop]

[e:loop={"select * from [!db.pre!]enewstags order by num DESC limit 20",0,24,0}]

echo ''.$bqr['tagname'].'('.$bqr['num'].')';

?>

[/e:loop]

注释:[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}] sal查询tag

e/tags/?tagname= 即 https://127.0.0.1/e/tag/?tagname=tag名称

tag的id

如:关于“美女”的tag词有多少个,即统计tag相关数

tag名称:如“美女”

2 用id的调用 tagid= 注释:不能用--用tagid做url地址不行

[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}]

[/e:loop]

第二种 灵动标签+php输出式

[e:loop={"select * from [!db.pre!]enewstags order by num DESC limit 20",0,24,0}]

echo ''.$bqr['tagname'].'('.$bqr['num'].')';

?>

[/e:loop]

------------------------------------------------------------------------------------------

注意:如果想调用几条 添加limit 20 调用20条

如:

1、按ID调用(新的靠前)

[e:loop={"select * from [!db.pre!]enewstags order by tagid limit 20",45,24,0}] tagid后加limit 20

2、按数量调用(信息数多的靠前)

[e:loop={"select * from [!db.pre!]enewstags order by num DESC limit 20",0,24,0}] num DESC后加limit 20