方案一:
在搜索列表模板列表内容模板(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><span>[!--newstime--]</span><a href="[!--titleurl--]" target="_blank">'.$title.'</a></li>';
记得一定要在"使用程序代码"前打钩
方案二:
修改e/search/result/index.php,在大约99行找到如下代码:
$listtext=str_replace("<!--list.var".$changerow."-->",$repvar,$listtext);
其后加入一行代码:
$listtext=str_replace($search_r[keyboard],"<font color='red'>$search_r[keyboard]</font>",$listtext);
保存,即可实现关键字描红的高亮显示效果!
本文摘自网络,不代表短经典网立场 https://www.duanjingdian.com/812.html