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++;} < a href = 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);} < form action = {APP_PATH}index.php method = get target = _blank > < input type = hidden name = m value = search /> < input type = hidden name = c value = index /> < input type = hidden name = a value = init /> < input type = hidden name = typeid value = {$typeid} id = typeid /> < input type = hidden name = siteid value = {$siteid} id = siteid /> < input type = text class = text name = q id = q />< input type = submit value = 搜 索 class = button /> </ form > |