技术宅

当前位置:首页 > 网站教程 > 帝国教程

帝国教程

帝国CMS灵动标签调用包含指定短语关键词关键字文章的语法

时间:10-27 作者:
直接上代码: [e:loop={"select * from phome_ecms_news where title like &#39;%这里是关键词%&#39; and checked=1 order by newstime desc limit 10",10,24,0}] <a href="

直接上代码:


 
  1. [e:loop={"select * from phome_ecms_news where title like '%这里是关键词%' and checked=1 order by newstime desc limit 10",10,24,0}]
  2. <a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>
  3. [/e:loop]

短的:


 
  1. [e:loop={'news',10,18,0,"title like '%这里是关键词%'",''}]
  2. <a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a><br>
  3. [/e:loop]

放一个自己用的:


 
  1. [e:loop={"select * from {$dbtbpre}ecms_news where title like '%这里是关键词%' and classid=5 order by newstime desc limit 3",10,24,0}]
  2. <div class="col-12">
  3. <a href="<?=$bqsr['titleurl']?>"><img src="<?=$bqr[titlepic]?>" alt="<?=$bqr['title']?>" /></a>
  4. <a href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a>
  5. </div>
  6. [/e:loop]

classid是栏目id