Discuz!更换站内搜索百度搜索
教程如下:
打/template/default/common里面header.htm
搜索
<div><span style="line-height: 1.5;"><!--{ad/subnavbanner/a_mu}--></span></div><div><span style="line-height: 1.5;"><!--{subtemplate common/pubsearchform}--></span></div>
在代码之前加入如下代码:
<div><span style="line-height: 1.5;"><style type="text/css"></span></div><div><span style="line-height: 1.5;"><!-- </span></div><div><span style="line-height: 1.5;">#diy_search {transparent;color: #000000;margin: 6px auto;}</span></div><div><span style="line-height: 1.5;">#diy_search .search_txt, #srchtxt { border-color: #999999 #CCCCCC #CCCCCC #999999;border-style: solid;border-width: 1px;height: 25px;margin-left: 5px;padding: 2px; float:left;}</span></div><div><span style="line-height: 1.5;">#diy_search table {border: 1px solid #CDCDCD; margin-top: 5px;}</span></div><div><span style="line-height: 1.5;">
</span></div><div><span style="line-height: 1.5;">--></span></div><div><span style="line-height: 1.5;"></style> </span></div><div><span style="line-height: 1.5;">
</span></div><div><span style="line-height: 1.5;"><div id="diy_search"></span>
<span style="line-height: 1.5;"><form name="f1" action="<font color="Red">http://baidu.mahoupao.com/cse/search</font>" target="_blank"></span>
<span style="line-height: 1.5;"><table ></span>
<span style="line-height: 1.5;"><tr height="30"></span>
<span style="line-height: 1.5;"><td width="250"></span>
<span style="line-height: 1.5;"><input type="hidden" name="s" value="<font color="Red">1410740892868059645</font>"></span>
<span style="line-height: 1.5;"><input type="hidden" name="ie" value="<font color="Red">gbk</font>"></span>
<span style="line-height: 1.5;"><input type="text" name="q" id="scbar_txt" value="{lang enter_content}" autocomplete="off" x-webkit-speech speech class="search_txt"onMouseOver="this.focus()" onMouseOut="if(this.value=='')this.value='';" onFocus="this.select()" onClick="if(this.value=='{lang enter_content}')this.value=''"/></span>
<span style="line-height: 1.5;"></td></span>
<span style="line-height: 1.5;"><td class="scbar_btn_td"><button type="submit" name="searchsubmit" id="scbar_btn" sc="1" class="pn pnc" value="true" ><strong class="xi2">{lang search}</strong></button></td></span>
<span style="line-height: 1.5;"><td class="scbar_hot_td"></span>
<span style="line-height: 1.5;"><div id="scbar_hot"></span>
<span style="line-height: 1.5;"><!--{if $_G['setting']['srchhotkeywords']}--></span>
<span style="line-height: 1.5;"><strong class="xw1">{lang hot_search}: </strong></span>
<span style="line-height: 1.5;"><!--{loop $_G['setting']['srchhotkeywords'] $val}--></span>
<span style="line-height: 1.5;"><!--{if $val=trim($val)}--></span>
<span style="line-height: 1.5;"><!--{eval $valenc=rawurlencode($val);}--></span>
<span style="line-height: 1.5;"><!--{block srchhotkeywords[]}--></span>
<span style="line-height: 1.5;"><!--{if !empty($searchparams)}--></span>
<span style="line-height: 1.5;"><a href="<font color="Red">http://baidu.mahoupao.com</font>/cse/search?q=$valenc&source=hotsearch{$srchotquery}&s=<font color="Red">1410740892868059645</font>" target="_blank" class="xi2" sc="1">$val</a></span>
<span style="line-height: 1.5;"><!--{else}--></span>
<span style="line-height: 1.5;"><a href="<font color="Red">http://baidu.mahoupao.com</font>/cse/search?q=$valenc&source=hotsearch{$srchotquery}&s=<font color="Red">1410740892868059645</font>" target="_blank" class="xi2" sc="1">$val</a></span>
<span style="line-height: 1.5;"><!--{/if}--></span>
<span style="line-height: 1.5;"><!--{/block}--></span>
<span style="line-height: 1.5;"><!--{/if}--></span>
<span style="line-height: 1.5;"><!--{/loop}--></span>
<span style="line-height: 1.5;"><!--{echo implode('', $srchhotkeywords);}--></span>
<span style="line-height: 1.5;"><!--{/if}--></span>
<span style="line-height: 1.5;"></div></span>
<span style="line-height: 1.5;"></td></span>
<span style="line-height: 1.5;"></tr></span>
<span style="line-height: 1.5;"></table></span>
<span style="line-height: 1.5;"></form></span>
<span style="line-height: 1.5;"></div></span></div>
进入zhanzhang.baidu.com申请站内申请,然后根据申请的代码,把上面红色的部分替换掉。
如果后台不关闭纵横搜索和站内搜索,就可以两个搜索引擎同时使用。
来源:网络转载
页:
[1]