帝国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>';
在修改模板处使用程序代码前打钩就可以了