在templates/default/目錄下forumdisplay.htm、discuz.htm與viewthread.htm這三個檔案中找...
<script type="text/javascript" src="forumdata/cache/google_var.js"></script>
<script type="text/javascript" src="include/javascript/google.js"></script>
然後將其替換為你google adsense的搜尋框程式碼即可!以我的搜尋框程式碼為例.....它是長這個樣子的
<style type="text/css">
@import url(http://www.google.com/cse/api/branding.css);
</style>
<div class="cse-branding-right" style="background-color:#FFFFFF;color:#000000">
<div class="cse-branding-form">
<form action="http://www.google.com.tw/cse" id="cse-search-box" target="_blank">
<div>
<input type="hidden" name="cx" value="partner-pub-你的google adsense帳號" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="20" />
<input type="submit" name="sa" value="搜尋" />
</div>
</form>
</div>
<div class="cse-branding-logo">
<img src="http://www.google.com/images/poweredby_transparent/poweredby_FFFFFF.gif" alt="Google" />
</div>
<div class="cse-branding-text">
自訂搜尋
</div>
</div>
不建議你copy我的程式碼,建議你建立一個新的Adsense for search,然後在設定過程中...
1.搜尋類型....選擇"只有我選取的網站"
2.選取的網站....輸入你的網站網址,不用http://
3.設定搜尋結果以開啟新視窗的方式顯示
最後到後台-->擴展設置-->Google搜索-->將Google搜索啟用,並將顯示 Google 搜索框:裡面三個選項都打勾
這種替換方式不用改到google.js,也不用擔心違反google的規範,而且會員搜尋時都是以你的網站內網頁搜尋結果為主,除非他更改搜尋選項....如下圖...
我已經更改完成!可看演示
http://www.ntd2u.net