您的位置:首页 > 编程语言 > Go语言

Discuz!nt2.5在快速搜索中加入google搜索广告

2008-10-15 16:03 423 查看
先申请Google AdSense帐号,然后取的AdSense搜索广告代码.



1.更改_quicksearch.htm文件加入google搜索按钮

<div id="searchbar"><dl>

<dt id="quicksearch" class="s2" >帖子标题</dt>

<dd class="textinput"><input type="text" name="keywordf" value="" class="text"/></dd>

<dd><input name="searchsubmit" type="submit" value="" class="s3"/></dd>

<dd><input id="btnGoogle2" class="btn_zzk" type="button" value="Google搜索" /></dd></dl></div>

2 在javascript目录下的common.js文件中加入

function SearchGoogle2()

{

var keystr = encodeURIComponent(document.getElementById('quicksearch').value);

window.location = "/search.aspx?keyword="+keystr;

}

function SearchGoogle() {

var keystr = encodeURIComponent(document.getElementById('searchKeyword').value);

window.location = "/search.aspx?keyword=" + keystr;

}

3 在dnt.css中更改#searchbar宽度,并加入google按钮样式

#searchbar { border: 1px solid #ccc; height: 24px; margin-right: 0px; line-height: 22px; width: 222px; background:#FFF;}

#searchbar .btn_zzk

{

border-top-style: none;

border-right-style: none;

border-left-style: none;

border-bottom-style: none;

cursor: hand;

}

4 在你要显示的页放好AdSense搜索广告代码,我比较懒直接放在了http://www.izhufan.cn/search.aspx

专业制作模版,有需要的朋友请联系我.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: