第一种 普通灵动标签调用1、 用名称的调用 tagname=<?=$bqr['tagname']?>[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}] <a rel="nofollow noopener noreferrer" href='<?=$public_r[newsurl]?>e/tags/?tagname=<?=$bqr['tagname']?>' class='tag-link-<?=$bqr['tagid']?>' title="<?=$bqr[num]?>个话题" style='font-size: 9pt;' target="_blank"><?=$bqr['tagname']?>(<?=$bqr[num]?>)</a>[/e:loop]或[e:loop={"select * from [!db.pre!]enewstags order by num DESC limit 20",0,24,0}] <?echo '<a rel="nofollow noopener noreferrer" href="/e/tags/?tagname='.urlencode($bqr['tagname']).'" target="_blank" title="'.$bqr["num'].'个话题" >'.$bqr['tagname'].'('.$bqr['num'].')</a>';?> [/e:loop]注释:[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}] sal查询tag <?=$public_r[newsurl]?>e/tags/?tagname=<?=$bqr['tagname']?> 即 http://127.0.0.1/e/tag/?tagname=tag名称 <?=$bqr['tagid']?> tag的id <?=$bqr[num]?> 如:关于“美女”的tag词有多少个,即统计tag相关数 <?=$bqr['tagname']?> tag名称:如“美女”2 用id的调用 tagid=<?=$bqr['tagid']?> 注释:不能用--用tagid做url地址不行[e:loop={"select * from [!db.pre!]enewstags order by tagid",0,24,0}]<li><a rel="nofollow noopener noreferrer" href="/e/tags/?tagid=<?=$bqr['tagid']?>" target="_blank"><?=$bqr['tagname']?></a></li>[/e:loop]第二种 灵动标签+php输出式[e:loop={"select * from [!db.pre!]enewstags order by num DESC limit 20",0,24,0}] <?echo '<a rel="nofollow noopener noreferrer" href="<?=$public_r[newsurl]?>e/tags/?tagname='.urlencode($bqr['tagname']).'" target="_blank" title="'.$bqr["num'].'个话题" >'.$bqr['tagname'].'('.$bqr['num'].')</a>';?> [/e:loop]------------------------------------------------------------------------------------------注意:如果想调用几条 添加limit 20 调用20条如:1、按ID调用(新的靠前)[e:loop={"select * from [!db.pre!]enewstags order by tagid limit 20",45,24,0}] tagid后加limit 202、按数量调用(信息数多的靠前)[e:loop={"select * from [!db.pre!]enewstags order by num DESC limit 20",0,24,0}] num DESC后加limit 20
以上就是帝国CMS用灵动标签调用tag的最详细好代码教程。作为班级的.一分子,我庄严宣誓:铭记自己的追求和理想,用最响亮的声音迎接朝阳,用最积极的心态走向课堂。不做怯懦的退缩,不做无益的彷徨,带着顽强的微笑,我要迎接更高的挑战。更多关于帝国CMS用灵动标签调用tag的最详细好代码教程请关注haodaima.com其它相关文章!