帝国CMS栏目怎么调用关键词?(帝国CMS栏目调用关键字词并且分割逗号的方法)

  帝国CMS栏目怎么调用关键词?(帝国CMS栏目调用关键字词并且分割逗号的方法)

  很多的网友经常问到,帝国CMS栏目怎么调用关键词呢?有什么好的方法实现?其实这个问题不难实现,下面就由帝国CMS模板网小编来告诉大家帝国CMS栏目调用关键字词并且分割逗号的方法,一起来看看吧:

  直接用变量[!–class.keywords–]调用,显示结果显示“帝国模板,帝国CMS模板,帝国CMS模板下载”

<?php
$cr=$empire->fetch1("select classpagekey from {$dbtbpre}enewsclass where classid='$GLOBALS[navclassid]'");
echo $cr[classpagekey];
?>

  按逗号分离字符串:

<?php 
$source = "帝国模板,帝国CMS模板,帝国CMS模板下载";//按逗号分离字符串 
$hello = explode(',',$source); 
for($index=0;$index<count($hello);$index++) 
{ 
echo "<li>"; echo $hello[$index];echo "</li>"; 
} 
?>

  最后,在帝国cms,再结合sql查询语句:

<?php 
$cr=$empire->fetch1("select classpagekey from {$dbtbpre}enewsclass where classid='$GLOBALS[navclassid]'");
$source=$cr[classpagekey];
$hello = explode(',',$source); 
for($index=0;$index<count($hello);$index++) 
{ 
echo "<li>"; echo $hello[$index];echo "</li>"; 
} 
?>

  链接同步tags标签,如果没有建立标签,就需要到后台手动建立tags,然后系统自动匹配:

<?php 
$cr=$empire->fetch1("select classpagekey from {$dbtbpre}enewsclass where classid='$GLOBALS[navclassid]'");
$source=$cr[classpagekey];
$hello = explode(',',$source); 
for($index=0;$index<count($hello);$index++) 
{ 
echo "<li><a href='/e/tags/?tagname=$hello[$index]&tempid=8'>"; echo $hello[$index];echo "</a></li>"; 
} 
?>

  OK!搞定!大家赶紧去测试看看效果!

© 版权声明
THE END
喜欢就支持以下吧
点赞0赞赏
分享
相关推荐
  • 暂无相关文章
评论 抢沙发