无限星辰工作室-客户无限互联网动力之源

标题: Discuz!更换站内搜索百度搜索 [打印本页]

作者: crx349    时间: 2014-9-29 10:50
标题: Discuz!更换站内搜索百度搜索

教程如下:
打/template/default/common  里面header.htm
搜索
  1. <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>
复制代码

在代码之前加入如下代码:

  1. <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;">
  2. </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;">
  3. </span></div><div><span style="line-height: 1.5;"><div id="diy_search"></span>
  4. <span style="line-height: 1.5;"><form name="f1" action="<font color="Red">http://baidu.mahoupao.com/cse/search</font>" target="_blank"></span>
  5. <span style="line-height: 1.5;"><table ></span>
  6. <span style="line-height: 1.5;"><tr height="30"></span>
  7. <span style="line-height: 1.5;"><td width="250"></span>
  8. <span style="line-height: 1.5;"><input type="hidden" name="s" value="<font color="Red">1410740892868059645</font>"></span>
  9. <span style="line-height: 1.5;"><input type="hidden" name="ie" value="<font color="Red">gbk</font>"></span>
  10. <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>

  11. <span style="line-height: 1.5;"></td></span>
  12. <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>
  13. <span style="line-height: 1.5;"><td class="scbar_hot_td"></span>
  14. <span style="line-height: 1.5;"><div id="scbar_hot"></span>
  15. <span style="line-height: 1.5;"><!--{if $_G['setting']['srchhotkeywords']}--></span>
  16. <span style="line-height: 1.5;"><strong class="xw1">{lang hot_search}: </strong></span>
  17. <span style="line-height: 1.5;"><!--{loop $_G['setting']['srchhotkeywords'] $val}--></span>
  18. <span style="line-height: 1.5;"><!--{if $val=trim($val)}--></span>
  19. <span style="line-height: 1.5;"><!--{eval $valenc=rawurlencode($val);}--></span>
  20. <span style="line-height: 1.5;"><!--{block srchhotkeywords[]}--></span>
  21. <span style="line-height: 1.5;"><!--{if !empty($searchparams[url])}--></span>
  22. <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>
  23. <span style="line-height: 1.5;"><!--{else}--></span>
  24. <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>
  25. <span style="line-height: 1.5;"><!--{/if}--></span>
  26. <span style="line-height: 1.5;"><!--{/block}--></span>
  27. <span style="line-height: 1.5;"><!--{/if}--></span>
  28. <span style="line-height: 1.5;"><!--{/loop}--></span>
  29. <span style="line-height: 1.5;"><!--{echo implode('', $srchhotkeywords);}--></span>
  30. <span style="line-height: 1.5;"><!--{/if}--></span>
  31. <span style="line-height: 1.5;"></div></span>
  32. <span style="line-height: 1.5;"></td></span>

  33. <span style="line-height: 1.5;"></tr></span>
  34. <span style="line-height: 1.5;"></table></span>
  35. <span style="line-height: 1.5;"></form></span>
  36. <span style="line-height: 1.5;"></div></span></div>
复制代码


进入zhanzhang.baidu.com申请站内申请,然后根据申请的代码,把上面红色的部分替换掉。

如果后台不关闭纵横搜索和站内搜索,就可以两个搜索引擎同时使用。


来源:网络转载





欢迎光临 无限星辰工作室-客户无限互联网动力之源 (https://xmspace.net/) Powered by Discuz! X3.4