由于⽹站使⽤DZ的侧重点不同,在搜索中可能需要更改默认搜索模块
⾸先到模板中搜索模块对应的⽂件,默认模板中搜索模块的地址是 template\default\common\pubsearchform.htm
有这样⼀些代码:
<!--{if $_G['setting']['search']}-->
<!--{eval $slist = array();}-->
<!--{if $_G['fid'] && $_G['forum']['status'] != 3 && $mod != 'group'}--><!--{block slist[forumfid]}--><li><a href="javascript:;" rel="curforum" fid="$_G[fid]">{lang search_this_forum}</a></li><!--{/block}--><!--{/if}-->
<!--{if $_G['setting']['portalstatus'] && $_G['setting']['search']['portal']['status'] && ($_G['group']['allowsearch'] & 1 || $_G['adminid'] == 1)}--><!--{block slist[portal]}--><li><a href="javascript:;" rel="article">{lang article}</a></li><!--{/block}
<!--{if $_G['setting']['search']['forum']['status'] && ($_G['group']['allowsearch'] & 2 || $_G['adminid'] == 1)}--><!--{block slist[forum]}--><li><a href="javascript:;" rel="forum" class="curtype">{lang thread}</a></li><!--{/block}--><!--{/if}-->
<!--{if helper_access::check_module('blog') && $_G['setting']['search']['blog']['status'] && ($_G['group']['allowsearch'] & 4 || $_G['adminid'] == 1)}--><!--{block slist[blog]}--><li><a href="javascript:;" rel="blog">{lang blog}</a></li><!--{/block} <!--{if helper_access::check_module('album') && $_G['setting']['search']['album']['status'] && ($_G['group']['allowsearch'] & 8 || $_G['adminid'] == 1)}--><!--{block slist[album]}--><li><a href="javascript:;" rel="album">{lang album}</a></
<!--{if $_G['setting']['groupstatus'] && $_G['setting']['search']['group']['status'] && ($_G['group']['allowsearch'] & 16 || $_G['adminid'] == 1)}--><!--{block slist[group]}--><li><a href="javascript:;" rel="group">$_G['setting']['navs'][3]['navname'] <!--{block slist[user]}--><li><a href="javascript:;" rel="user">{lang users}</a></li><!--{/block}-->
<!--{/if}-->
重点是这⼀句: class="curtype"
curtype是current type的简写,意思是默认的分类,现在这⼀句class是放在rel="forum"即论坛中的,所以默认搜索帖⼦
我们把class="curtype"这⼀句剪贴到rel="article"的后⾯,就会变为默认搜索⽂章了。
如果要变为默认搜索⽤户或者组也都是⼀样的道理。
减去小舞的所有衣服