直接用变量[!–class.keywords–]调用,显示结果显示“网站建设,企业网站,公司网站建设,网站建设报价,网站建设公司”
<?php $cr=$empire->fetch1("select classpagekey from {$dbtbpre}enewsclass where classid='$GLOBALS[navclassid]'"); echo $cr[classpagekey]; ?>
按逗号分离字符串
<?php $source = "网站建设,企业网站,公司网站建设,网站建设报价,网站建设公司";//按逗号分离字符串 $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>"; } ?>
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论(0)