新聞中心
Discuz建設(shè):X3.2 最新修改論壇首頁(yè)搜索框教程
Discuz X3.2安裝好了,默認(rèn)首頁(yè)的搜索框就是這樣的,如下圖所示:
[caption id="attachment_16037" align="alignnone" width="554"] discuz后臺(tái)[/caption]
今天無(wú)憂主機(jī)小編我給大家分享的是如何修改這個(gè)面積較大的搜索框,我把他改小了,代碼來(lái)源于互聯(lián)網(wǎng),小編這里操作使用的是默認(rèn)主題模板,如果大家有指定模板的話,記得找到相對(duì)應(yīng)的主題哦,現(xiàn)在在這里分享給大家,希望對(duì)大家有所幫助:
需要修改文件路徑:./template/default/common/ pubsearchform.htm
把文件pubsearchform.htm下載到本地,并且進(jìn)行操作,大約在12~70行代碼注釋掉,添加如下代碼:
<div id="search" class="{if $_G['setting']['srchhotkeywords'] && count($_G['setting']['srchhotkeywords']) > 5}scbar_narrow {/if}cl">
<form id="scbar_form" method="{if $_G[fid] && !empty($searchparams[url])}get{else}post{/if}" autocomplete="off" onsubmit="searchFocus($('scbar_txt'))" action="{if $_G[fid] && !empty($searchparams[url])}$searchparams[url]{else}search.php?searchsubmit=yes{/if}" target="_blank">
<input type="hidden" name="mod" id="scbar_mod" value="search" />
<input type="hidden" name="formhash" value="{FORMHASH}" />
<input type="hidden" name="srchtype" value="title" />
<input type="hidden" name="srhfid" value="$_G[fid]" />
<input type="hidden" name="srhlocality" value="$_G['basescript']::{CURMODULE}" />
<!--{if !empty($searchparams[params])}-->
<!--{loop $searchparams[params] $key $value}-->
<!--{eval $srchotquery .= '&' . $key . '=' . rawurlencode($value);}-->
<input type="hidden" name="$key" value="$value" />
<!--{/loop}-->
<input type="hidden" name="source" value="discuz" />
<input type="hidden" name="fId" id="srchFId" value="$_G[fid]" />
<input type="hidden" name="q" id="cloudsearchquery" value="" />
<div style="display: none; position: absolute; top:37px; left:44px;" id="sg">
<div id="st_box" cellpadding="2" cellspacing="0"></div>
</div>
<!--{/if}-->
<table cellspacing="0" cellpadding="0">
<tr>
<td class="search_icon_td"></td>
<td class="search_txt_td"><input type="text" name="srchtxt" id="search_txt" value="{lang enter_content}" autocomplete="off" x-webkit-speech speech /></td>
<td class="search_btn_td"><button type="submit" name="searchsubmit" id="search_btn" sc="1" class="search_pn" value="true"><strong class="xi2">{lang search}</strong></button></td>
</tr>
</table>
</form>
</div>
把原來(lái)的代碼替換掉以后,保存上傳到你的主題目錄下面的common文件里面,然后去后臺(tái)更新緩存,效果圖如下:
[caption id="attachment_16038" align="alignnone" width="379"]
discuz[/caption]
小技巧:這個(gè)搜索框可以移動(dòng)位置的哦,在主題文件common/ header.htm文件里面,隨意添加代碼: <!--{subtemplate common/pubsearchform}--> 來(lái)控制這個(gè)搜索的位置!
如果你不會(huì)操作的話,可以咨詢桂桂客服解答此問(wèn)題,聯(lián)系方式:15879061583
無(wú)憂主機(jī)相關(guān)文章推薦閱讀:
DISCUZ網(wǎng)站論壇如何添加使用支付寶支付功能設(shè)置
DISCUZ!X增強(qiáng)用戶體驗(yàn),低分辨率下自動(dòng)關(guān)閉對(duì)聯(lián)廣告
DISCUZ建設(shè):論壇版塊帖子內(nèi)容頁(yè)漂亮橫排圖片設(shè)置方法
DISCUZ建設(shè):QQ互聯(lián)注冊(cè)用戶提示:“抱歉,當(dāng)前存在網(wǎng)絡(luò)問(wèn)題或服務(wù)器繁忙,請(qǐng)您稍后再試,謝謝”
本文地址:http://m.love62.cn/discuz/16036.html
![1](/wp-content/themes/starow_z/img/o-1.png)
![1](/wp-content/themes/starow_z/img/o-2.png)
![1](/wp-content/themes/starow_z/img/o-3.png)
![1](/wp-content/themes/starow_z/img/o-4.png)
![1](/wp-content/themes/starow_z/img/o-5.png)
![1](/wp-content/themes/starow_z/img/o-6.png)
![1](/wp-content/themes/starow_z/img/o-7.png)