免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
返回列表 发帖

[论坛代码] 仿DZX2搜索框V2.0正式发布

更新内容:

1.修正了与一些风格不兼容的BUG
2.只在首页,主题列表和帖子内容页出现
3.新增百度搜索提示

首先进入后台,工具--数据调用--新建--自由代码

名称:
  1. 内部调用_搜索
复制代码
内容:
  1. <div id="zyhome" style="margin-top:-8px;">
  2. <div id="scbar" class="cl">
  3.   <form id="scbar_form" method="post" autocomplete="off" onsubmit="searchFocus($('scbar_txt'))" action="search.php?searchsubmit=yes" target="_blank">
  4.     <input type="hidden" name="formhash" value="b2e92bf7"/>
  5.     <table cellspacing="0" cellpadding="0">
  6.       <tbody>
  7.         <tr>
  8.           <td class="scbar_icon_td"></td>
  9.           <td class="scbar_txt_td">
  10.             <input type="text"  name="srchtxt" id="scbar_txt" onblur="if (value ==''){value='搜索其实很简单 ^_^'}" onfocus="if (value =='搜索其实很简单 ^_^'){value =''}" value="搜索其实很简单 ^_^" autocomplete="off" class=" xg1" baiduSug=1>
  11.           </td>
  12.           <td class="scbar_type_td">
  13.             <a href="javascript:;" id="scbar_type" class="showmenu xg1 xs2" onclick="showMenu(this.id)" hidefocus="true">帖子</a>
  14.           </td>
  15.           <td class="scbar_btn_td">
  16.             <button type="submit" name="searchsubmit" id="scbar_btn" class="pn pnc" value="true">
  17.               <strong class="xi2 xs2" color="#000000">搜索</strong>
  18.             </button>
  19.           </td>
  20.           <td class="scbar_hot_td">
  21.             <div id="scbar_hot">
  22.               <strong class="xw1">热搜: </strong>
  23. <a href="#" target="_blank" class="xi2">高仿门户站</a>
  24.               <a href="#" target="_blank" class="xi2">5D6D风格</a>
  25.               <a href="#" target="_blank" class="xi2">5D6D代码</a>
  26.               <a href="#" target="_blank" class="xi2">SClub代码</a>
  27.              </div>
  28.           </td>
  29.         </tr>
  30.       </tbody>
  31.     </table>
  32.   </form>
  33. </div></div>

  34. <script charset="gbk" src="http://www.baidu.com/js/opensug.js"></script>
复制代码
然后提交
进入模板管理
打开css_common模板
在最下面加上
  1. /*-------------------search----bar-------------------*/
  2. #zyhome{background:#ffffff;width: {WRAPWIDTH} ;margin: 0 auto 5px; }#scbar_form{text-align:left;}#scbar,#scbar_form,.scbar_icon_td,.scbar_txt_td,.scbar_type_td,.scbar_btn_td{background-image:url(http://zyhome.66rt.com/attachments/month_1206/12061309582ee56758aa7a5eb9.png);}#scbar{background-position:0px 0px;background-repeat:repeat-x;}#scbar td{padding:0px;}.scbar_icon_td{background-position:0px -74px;background-repeat:no-repeat;width:50px;}.scbar_txt_td{background-position:0px -222px;background-repeat:repeat-x;}#scbar_txt{width:400px;border:1px solid #FFF;outline:none;font-size:14px;}.xg1,.xg1 a{color:#999999}.xs2{font-size:14px}.scbar_type_td{background-position:0px -370px;background-repeat:no-repeat;}#scbar_type{display:block;padding-left:5px;text-align:left;text-decoration:none;}.showmenu{padding-right:16px;background:url(http://zyhome.66rt.com/attachments/month_1206/12062110260961a911ff5ae7af.gif) no-repeat 100% 50%;cursor:pointer;white-space:nowrap;}.scbar_btn_td{background-position:0px -296px;background-repeat:no-repeat;text-align:center;width:67px;}#scbar_btn{margin:0;padding:0;border:none;background:transparent none;}.pn strong{font-weight:700;line-height:21px;padding-bottom:0px;padding-left:10px;padding-right:10px;padding-top:0px;}#scbar_hot{padding-left:8px;height:45px;overflow:hidden;}#scbar_hot strong,#scbar_hot a{line-height:44px;float:left;margin-right:8px;white-space:nowrap;}.xw1{font-weight:700;}#scbar{border:1px solid #c2d5e3;border-top-width:0px!important;};}
  3. #sousuo{width: {WRAPWIDTH} ;margin: 0 auto 5px; }
复制代码
最后,打开discuz,forumdisplay,viewthread模板

找到
  1. {subtemplate header}
复制代码
在下面加上
  1. {eval request('内部调用_搜索');}
复制代码
即可!(3个模板都要加哦!)
分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友

有你支持更精彩 点击表情自动回复:

楼主这帖子太美,太漂亮了,顶,献花一朵.......!
看到楼主的这个帖子,我明白一定要低调.......!
哇,楼主你真是太给力了,这样的帖子都能找得到,佩服!
问候七喜乐园的朋友们,报个到并祝朋友们安康如意,永远开开心心!
楼主辛苦了,这帖子我很喜欢,找了很久,拿去收藏了,谢谢朋友啦!
这帖子真的让人感觉很舒服,我超喜欢,楼主真是太给力了!
超极囧囧的帖子,楼主你太雷了,真正把我给OUT了!
好贴
低调
给力
报到
收藏
喜欢
囧人

返回列表