帝国cms如何调用带链接的关键字词?

发布时间:2021-10-05 07:43

在帝国建站程序中,如何调用带链接的关键字词?比如说:直接用变量[!--class.keywords--]调用,显示结果显示“SEO优化,网络营销,SEM学习,自媒体营销,SEO博客,营销思维”。

帝国cms如何调用带链接的关键字词

帝国cms如何调用带链接的关键字词?

一起来学习学习吧、具体操作如下:

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

按逗号分离字符串

<?php 
$source = "SEO优化,网络营销,SEM学习,自媒体营销,SEO博客,营销思维";//按逗号分离字符串 
$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>"; 
} 
?>

怎么样,操作起来也是不是特别的简单,你也赶快去试试吧!

Vue3学习笔记之依赖注入Provide/Inject 网站建设

Vue3学习笔记之依赖注入Provide/Inject

Provide / Inject 通常,当我们需要从父组件向子组件传递数据时,我们使用 props。想象一下这样的结构:有一些深度嵌套的组件,而深层的子组件只需要父组件的部分内容。在这种情况下,如果...
Vue3全局实例上挂载属性方法案例讲解 网站建设

Vue3全局实例上挂载属性方法案例讲解

在大多数开发需求中,我们有时需要将某个数据,或者某个函数方法,挂载到,全局实例身上,以便于,在项目全局的任何位置都能够调用其方法,或读取其数据。 在Vue2 中,我们是在 main.js 中 直...