帝国CMS内容页相关文章调用

标题包含关键字
①、比较粗糙的匹配,可能不太精确:title like ‘%$navinfor[keyboard]%’
②、精确的匹配,比较消耗资源:title regexp ‘(^|,)$navinfor[keyboard]($|,)’

关键字相同
①、比较粗糙的匹配,可能不太精确:keyboard like ‘%$navinfor[keyboard]%’
②、精确的匹配,比较消耗资源:keyboard regexp ‘(^|,)$navinfor[keyboard]($|,)’
格式1、
①、模糊匹配

  1. [e:loop={"select *  from phome_ecms_news where title like ‘%$navinfor[keyboard]%’ or keyboard like ‘%$navinfor[keyboard]%’ order by id desc limit 10",0,24,0}]
  2. <a href="<?=$bqsr[‘titleurl’]?>" target="_blank"><?=$bqr[‘title’]?></a> <br>
  3. [/e:loop]

复制代码

②、精确的匹配

  1. [e:loop={"select *  from phome_ecms_news where title regexp ‘(^|,)$navinfor[keyboard]($|,)’ or keyboard regexp ‘(^|,)$navinfor[keyboard]($|,)’ order by id desc limit 10",0,24,0}]
  2. <a href="<?=$bqsr[‘titleurl’]?>" target="_blank"><?=$bqr[‘title’]?></a> <br>
  3. [/e:loop]

复制代码

格式2、
①、模糊匹配

  1. [e:loop={‘news’,10,3,0,"keyboard like ‘%$navinfor[keyboard]%’ or title like ‘%$navinfor[keyboard]%’",”}]   
  2.    <li>·<a href="<?=$bqsr[‘titleurl’]?>" target="_blank"><?=esub($bqr[title],24)?></a></li>
  3. [/e:loop]

复制代码

  1. [e:loop={0,10,3,0,"keyboard like ‘%$navinfor[keyboard]%’ or title like ‘%$navinfor[keyboard]%’",”}]
  2. <a href="<?=$bqsr[‘titleurl’]?>" target="_blank"><?=$bqr[‘title’]?></a> <br>
  3. [/e:loop]

复制代码

温馨提示:本文最后更新于2022-09-12 11:37:52,某些文章具有时效性,若有错误或已失效,请在下方留言或联系丁塔克博客
© 版权声明
THE END
喜欢就支持一下吧
点赞8 分享
评论 抢沙发

请登录后发表评论