Replace search with Google Custom Search
This mod assumes you have an adsense account and are using Google Custom Search.
You want to make sure your results page is named something other than the vb default search.php, this leaves the vb option open to those who click "advanced search" Open your template navbar find PHP Code:
<form action="search.php?do=process" method="post" id="navbar_search">
replace with the form line of the google supplied code example: PHP Code:
<form action="http://www.ahfb2000.com/google.php" id="cse-search-box">
find PHP Code:
<input type="hidden" name="s" value="{vb:raw session.sessionurl}" />
replace with the first 3 hidden input types in your google code example: PHP Code:
<input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxxxxxxxxxxxx" />
find PHP Code:
<input type="text" value="" name="query" class="textbox" />
replace with PHP Code:
<input type="text" value="" name="q" class="textbox" />
find PHP Code:
<input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="submit" onclick="document.getElementById('navbar_search').submit;" />
replace with PHP Code:
<input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="sa" onclick="document.getElementById('navbar_search').submit;" />
find PHP Code:
</form>
add this after PHP Code:
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>
Download No files for download. Screenshots |
Similar Mods
Add-On Releases MARCO1 Google Custom Search | vBulletin 3.8 Add-ons |