感觉像是模仿Phpwind 9的,先上上图吧!注意:非官方默认模板的修改方法大概一致,请谨慎修改
Step:1 打开template/default/common/common.css,找到以下代码,大概在595~607的位置
- #scbar { overflow: hidden; height: 42px; line-height: 42px; border-top: 1px solid #FFF; border-bottom: 1px solid #E9EFF5; background: #E8EFF5; }
- .scbar_icon_td { width: 21px; background: url({IMGDIR}/search.png) no-repeat 0 -50px; }
- .scbar_txt_td, .scbar_type_td { background: url({IMGDIR}/search.png) repeat-x 0 -93px; }
- #scbar_txt { width: 400px; border: 1px solid #FFF; outline: none; }
- .scbar_narrow #scbar_txt { width: 260px; }
- .scbar_btn_td { width: 38px; background: url({IMGDIR}/search.png) no-repeat 8px -142px; }
- #scbar_btn { margin: 0; padding: 0; border: none; background: transparent none; box-shadow: none; }
- #scbar_btn strong { line-height: 84px; }
- .scbar_type_td { width: 61px; background: url({IMGDIR}/search.png) no-repeat 0 -193px; }
- #scbar_type { display: block; padding-left: 10px; text-align: left; text-decoration: none; }
- #scbar_type_menu { margin-top: -8px; }
- #scbar_hot { padding-left: 8px; height: 45px; overflow: hidden; }
- #scbar_hot strong, #scbar_hot a { float: left; margin-right: 8px; white-space: nowrap;
复制代码 将其替换为以下代码:
- .scbar{ float:left; margin-top:11px; margin-left:10px; margin-right:10px; width:181px; overflow:hidden;}
- #scbar{height: 26px; line-height:26px; border: none; border-radius: 5px; background: #FFFFFF;}
- #scbar_txt{ float: left; width: 150px; height: 26px; line-height: 26px; border: none; background: transparent; color: #444; font-size: 12px; text-indent: 5px; -webkit-transition: 0.2s width;transition: 0.2s width;}
- #scbar_btn{float: left; width: 18px; height: 18px; margin: 0; background: transparent url({STYLEIMGDIR}/Searchicon.png) no-repeat 0 0; border: none; text-indent: -9999px; cursor: pointer; *padding-right:5px; _padding-right:5px;}
复制代码 Step:2 打开template/default/common/header.htm,找到<!--{subtemplate common/pubsearchform}-->,并删除。之后找到<!--{hook/global_nav_extra}-->,替换为
- <div class="scbar"><!--{subtemplate common/pubsearchform}--></div>
- <!--{hook/global_nav_extra}-->
复制代码 Step:3 打开template/default/common/pubsearchform.htm,将以下代码,大概在41~75的位置
- <table cellspacing="0" cellpadding="0">
- <tr>
- <td class="scbar_icon_td"></td>
- <td class="scbar_txt_td"><input type="text" name="srchtxt" id="scbar_txt" value="{lang enter_content}" autocomplete="off" x-webkit-speech speech /></td>
- <td class="scbar_type_td"><a href="javascript:;" id="scbar_type" class="xg1" onclick="showMenu(this.id)" hidefocus="true">{lang search}</a></td>
- <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>
- <td class="scbar_hot_td">
- <div id="scbar_hot">
- <!--{if $_G['setting']['srchhotkeywords']}-->
- <strong class="xw1">{lang hot_search}: </strong>
- <!--{loop $_G['setting']['srchhotkeywords'] $val}-->
- <!--{if $val=trim($val)}-->
- <!--{eval $valenc=rawurlencode($val);}-->
- <!--{block srchhotkeywords[]}-->
- <!--{if !empty($searchparams[url])}-->
- <a href="$searchparams[url]?q=$valenc&source=hotsearch{$srchotquery}" target="_blank" class="xi2" sc="1">$val</a>
- <!--{else}-->
- <a href="search.php?mod=forum&srchtxt=$valenc&formhash={FORMHASH}&searchsubmit=true&source=hotsearch" target="_blank" class="xi2" sc="1">$val</a>
- <!--{/if}-->
- <!--{/block}-->
- <!--{/if}-->
- <!--{/loop}-->
- <!--{echo implode('', $srchhotkeywords);}-->
- <!--{/if}-->
- </div>
- </td>
- </tr>
- </table>
- </form>
- </div>
- <ul id="scbar_type_menu" class="p_pop" style="display: none;"><!--{echo implode('', $slist);}--></ul>
- <script type="text/javascript">
- initSearchmenu('scbar', '$searchparams[url]');
- </script>
- <!--{/if}-->
复制代码 替换为:
- <table cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" name="srchtxt" id="scbar_txt" value="{lang enter_content}" autocomplete="off" x-webkit-speech speech /></td>
- <td><button type="submit" name="searchsubmit" id="scbar_btn" sc="1" class="pn pnc" value="true"></button></td>
- </tr>
- </table>
- </form>
- </div>
- <ul id="scbar_type_menu" class="p_pop" style="display: none;"><!--{echo implode('', $slist);}--></ul>
- <script type="text/javascript">
- initSearchmenu('scbar', '$searchparams[url]');
- </script>
- <!--{/if}-->
复制代码 Step:4 将图片上传到static/image/common目录下,请不要更改大小写
Searchicon.zip
|