首页 资讯 关注 民生 区域 汽车 房产 图片 视频 本地新闻

技术

旗下栏目: 美食 商家 技术 优惠

discuz论坛把默认搜索栏移动到导航栏

来源:未知 作者:湛江网管理员 人气: 发布时间:2021-01-19
摘要:discuz论坛把默认搜索栏移动到导航栏 方法/步骤 (www.qdiche.com)Step:1打开template/default/common/common.css,找到以下代码,大概在595~607的位置 #scbar { overflow: hidden; height: 42px; line-height: 42px; border-top: 1px solid #FFF; border-

discuz论坛把默认搜索栏移动到导航栏

discuz论坛把默认搜索栏移动到导航栏

方法/步骤

  1. (www.qdiche.com)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; 

  2. (www.qdiche.com)将其替换为以下代码

    .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;}

  3. (www.qdiche.com)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}-->

  4. (www.qdiche.com)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}-->

  5. (www.qdiche.com)替换为:

                    <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}-->

  6. 6

    (www.qdiche.com)Step:4  将18*18png格式的搜索按钮图片上传到static/image/common目录下,请不要更改大小写,图片名称为Searchicon

    END

注意事项

  • 请在修改前备份文件


责任编辑:湛江网管理员
首页 | 资讯 | 关注 | 民生 | 区域 | 汽车 | 房产 | 图片 | 视频 | 本地新闻

湛江网_碧海银沙_湛江碧海银海网_银沙网_湛江碧海银沙论坛,湛江影响力大的论坛社区,关注湛江社会百态。湛江网友可在论坛内相互交流、分享快乐,设有聚焦港城、街拍湛江、银沙杂谈、湛江楼市、亲子乐园、饮食男女、驴游户外等版块。  技术支持:湛江易联

电脑版 | 移动版