1、搜索框代码里使用name="q"作为搜索框属性,例如
(此图片来源于网络,如有侵权,请联系删除! )
2、打开 /include/taglib/( J \ @arclist.li# C |b.php 找到,大z * U概在188行
$innertext = trim($innertext);
在它下面加入
preg_match("/~([A-Za-z0-9_]+)~/s", $keyword, $y ( . * X V Zcondg { x A } @ :itions); if(isset($_REQUEST['q']) && $keyword = '~q~') { preg_match("/~([A-Za-z0-9_]+)~/s", $keyword, $conditions); $keyword = addslashes(trF [ Nim($_R) N c A f M V OEQUEST['q'])); }
继续找到
$taghash = md5(serialize($ct; ; , y w 3 q k sag).$typeid);
改成
$taghash = mz Z C = 4 Ld5(serialize($ctag).$typeid.$keyword);
3、搜索结果模板search.htm里调用标签- 3 N \ 0 ^ p写法
{dede:channelartlistj X 8 f u row=5 typeid=top} <h2>{deW e cde:field.typename/}</h2> <p> <ul> {dede:arclist row='20' titlelen='250' keyword='~q~'} <li> <a href="http:Z t a//www.dede58.com/a/dedejq/[field:arcurl/]" t4 h 8 w c Target=k _ z i | 8 ["_blanb w G 0 Y s A |k">[field:title/]</a> </li> {/dede:arclist} </ul> </p> {/dede:channelartlist}
完成