详情页

帝国CMS搜索页模板,搜索的关键字结果标题加红的方法!

时间:2023年12月29日

编辑:佚名

帝国CMS搜索页模板,搜索的关键字结果标题加红的方法!
经常会有互联网的朋友问到帝国CMS建站的相关问题,例如帝国CMS搜索页模板,搜索的关键字结果标题怎么设置加红呢?今天帝国CMS模板网就来告诉大家帝国CMS搜索页模板,搜索的关键字结果标题加红的方法,一起来看看吧:
在搜索列表模板列表内容模板(list.var) (*)加上以下代码
$searchid = $_GET['searchid'];
$search=$empire->fetch1("select keyboard from {$dbtbpre}enewssearch where searchid='$searchid' limit 1");
$keyboard = $search['keyboard'];
$title=str_replace($keyboard,"<font color='red'>$keyboard</font>",$r[title]);
$smalltext=str_replace($keyboard,"<font color='red'>$keyboard</font>",$r[smalltext]);
$listtemp='
<li><a href="[!--titleurl--]" title="[!--oldtitle--]" target="_blank">'.$title.'</a>
<div class="media-box-note">'.$smalltext.'</div></li>';
在使用程序代码前打钩,如下图所示:

帝国cms搜索页模板关键字加红的方法
好了,到这里是结束了,大家自行去测试吧!
相关文章
猜你需要