帝国CMS灵动标签调用包含指定短语关键词关键字文章的语法
时间:10-27
作者:
直接上代码: [e:loop={"select * from phome_ecms_news where title like '%这里是关键词%' and checked=1 order by newstime desc limit 10",10,24,0}] <a href="
直接上代码:
[e:loop={"select * from phome_ecms_news where title like '%这里是关键词%' and checked=1 order by newstime desc limit 10",10,24,0}]
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>
[/e:loop]
短的:
[e:loop={'news',10,18,0,"title like '%这里是关键词%'",''}]
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>
[/e:loop]
放一个自己用的:
[e:loop={"select * from {$dbtbpre}ecms_news where title like '%这里是关键词%' and classid=5 order by newstime desc limit 3",10,24,0}]
<div class="col-12">
<a href="<?=$bqsr['titleurl']?>"><img src="<?=$bqr[titlepic]?>" alt="<?=$bqr['title']?>" /></a>
<a href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a>
</div>
[/e:loop]
classid是栏目id
-
上一篇
帝国CMS灵动标签调用相关文章
标题包含关键字 ①、比较粗糙的匹配,可能不太精确:title like '%$navinfor[keyboard]%' ②、精确的匹配,比较消耗资源:title regexp '(^|,)$navinfor[keyboard]($|
- 下一篇
帝国CMS文章随机调用等一些常用标签
显示一周内信息点击排行 [e:loop={'news',10,18,0,'newstime>UNIX_TIMESTAMP()-86400*7','onclick desc'}] <a href="<?=$bqsr[titleurl]?>" targ