打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
更改dedecms的搜索框为多功能搜索

更改dedecms的搜索框为多功能搜索

时间:2010-11-05 23:31来源:仿站网 作者:www.copyie.com 点击:152次

    更改dedecms的搜索框为自己的多功能搜索框!


    把 head.htm 的 <form>与</form>之间的代码,替换为以下代码:
     

    1.  
    2.  
    3.  <form name=bf onSubmit="bottomForm();return false;">
    4.    <script>
    5.  function bottomForm(){
    6.  var $=document.bf.key.value;
    7.  if(document.bf.sto[0].checked)window.open("./plus/search.php?kwtype=0&keyword="+$,"a1");
    8.  if(document.bf.sto[1].checked)window.open("http://www.baidu.com/s?q1="+"&q6=blog.sina.com.cn","a2");
    9.  if(document.bf.sto[2].checked)window.open("http://www.google.com/search?hl=zh-CN&q="+"&as_sitesearch=blog.sina.com.cn","a3");
    10. // if(document.bf.sto[3].checked)window.open("http://www.gougou.com/search?id=1&search="+$,"a4");
    11. // if(document.bf.sto[4].checked)window.open("http://map.baidu.com/m?word="+$,"a5");
    12. // if(document.bf.sto[5].checked)window.open("http://bk.baidu.com/?kw="+"&submit=search","a6");
    13.  return false}
    14.  </script>  <div class="form">
    15.  <h4>搜索</h4>
    16. <!-- <input name="key" class="search-keyword" value="(输入搜索内容……)"> -->
    17. <input name="key" class="search-keyword" value="(输入搜索内容……)" onfocus="if(this.value=='(输入搜索内容……)'){this.value='';}"  onblur="if(this.value==''){this.value='(输入搜索内容……)';}">
    18.  <input name=sto type=radio value="0" checked=true>本站内
    19.  <input name=sto type=radio value="1"><a href="http://www.baidu.com">百度</a>
    20.  <input name=sto type=radio value="2"><a href="http://www.google.cn">Google</a>
    21. <!--
    22.  <input name=sto type=radio value="3"><a href="http://www.gougou.com">狗狗</a>
    23.  <input name=sto type=radio value="4"><a href="http://map.baidu.com">地图</a>
    24.  <input name=sto type=radio value="5"><a href="http://baike.baidu.com">百科</a>
    25. -->
    26.  <button type="submit" class="search-submit">搜索</button>
    27.  </div>
    28.  </form>


     
    复制代码
    1.  
    2.  
    3.  <form name=bf onSubmit="bottomForm();return false;">
    4.    <script>
    5.  function bottomForm(){
    6.  var $=document.bf.key.value;
    7.  if(document.bf.sto[0].checked)window.open("./plus/search.php?kwtype=0&keyword="+$,"a1");
    8.  if(document.bf.sto[1].checked)window.open("http://www.baidu.com/s?q1="+"&q6=blog.sina.com.cn","a2");
    9.  if(document.bf.sto[2].checked)window.open("http://www.google.com/search?hl=zh-CN&q="+"&as_sitesearch=blog.sina.com.cn","a3");
    10. // if(document.bf.sto[3].checked)window.open("http://www.gougou.com/search?id=1&search="+$,"a4");
    11. // if(document.bf.sto[4].checked)window.open("http://map.baidu.com/m?word="+$,"a5");
    12. // if(document.bf.sto[5].checked)window.open("http://bk.baidu.com/?kw="+"&submit=search","a6");
    13.  return false}
    14.  </script>  <div class="form">
    15.  <h4>搜索</h4>
    16. <!-- <input name="key" class="search-keyword" value="(输入搜索内容……)"> -->
    17. <input name="key" class="search-keyword" value="(输入搜索内容……)" onfocus="if(this.value=='(输入搜索内容……)'){this.value='';}"  onblur="if(this.value==''){this.value='(输入搜索内容……)';}">
    18.  <input name=sto type=radio value="0" checked=true>本站内
    19.  <input name=sto type=radio value="1"><a href="http://www.baidu.com">百度</a>
    20.  <input name=sto type=radio value="2"><a href="http://www.google.cn">Google</a>
    21. <!--
    22.  <input name=sto type=radio value="3"><a href="http://www.gougou.com">狗狗</a>
    23.  <input name=sto type=radio value="4"><a href="http://map.baidu.com">地图</a>
    24.  <input name=sto type=radio value="5"><a href="http://baike.baidu.com">百科</a>
    25. -->
    26.  <button type="submit" class="search-submit">搜索</button>
    27.  </div>
    28.  </form>



    其中,“blog.sina.com.cn” 换成你自己的独立域名

    原来的以下这段,似乎是用不上了,本人这样屏蔽掉:

    <!--
            <div class="tags">
              <h4>热门标签:</h4>
              <ul>
              {dede:tag row='10' getall='1' sort='month'}
                <li><a href='[field:link/]'>[field:tag /]</a></li>
              {/dede:tag}
              </ul>
            </div>
    -->

    此代码修改自本论坛的一位师兄的,谢谢他!

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Firefox搜索插件制作教程
Google和百度、雅虎的站内搜索代码
如何获取搜索引擎的来源和其中的关键字
服装店店长工作职责
最全的提交网站入口大全
获得来自搜索引擎的关键字
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服