由于网站使用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}--> <!--{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}--> <!--{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></li><!--{/block}--><!--{/if}--> <!--{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']</a></li><!--{/block}--><!--{/if}--> <!--{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"的后面,就会变为默认搜索文章了。
如果要变为默认搜索用户或者群组也都是一样的道理。