PHPCMS v9 全站搜索

这个不需要设置模板吧,,给你个完整的搜索代码你看看吧

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{php $j=0}
{php $search_model = getcache( search_model_ .$siteid, search );}
{loop $search_model $k=>$v}
{php $j++;}
<ahref= javascript:; onclick= setmodel({$v[ typeid ]}, $(this)); style= outline:medium none; hidefocus= true {if $j==1 && $typeid=$v[ typeid ]} class= on {/if}>{$v[ name ]}</a>{if $j != count($search_model)}<span> | </span>{/if}
{/loop}
{php unset($j);}
<formaction= {APP_PATH}index.php method= get target= _blank >
<inputtype= hidden name= m value= search />
<inputtype= hidden name= c value= index />
<inputtype= hidden name= a value= init />
<inputtype= hidden name= typeid value= {$typeid} id= typeid />
<inputtype= hidden name= siteid value= {$siteid} id= siteid />
<inputtype= text class= text name= q id= q /><inputtype= submit value= 搜 索 class= button />
</form>