Hello friends,
For a long time I wanted to change my Vbulletin 4.1.3's search engine with Google's search engine.
I searched for forums, but I couldn't find a good solution. Yesterday, I made this change
And my original search box theme is not changed. (search box on the Navigation bar.)
If you want to look live example: http://www.ctrlpda.com
To do this: Go to AdminCP > Styles & Templates > Style manager
Choose "Edit template" right of the Style you want to modify. (I have 4 styles)
Then:
Double click to expand "Navigation / Breadcrump templates >>"
Then under expanded "Navigation / Breadcrump templates <<"
Double click "navbar"
find:
And Replace this code with:
And modify your:
<input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXXXXXXX" />
<input type="hidden" name="ie" value="ISO-8859-9" />
according to your google adsense partner id and forum language code.
And save template
That's all..
However if you want to remove "Advanced Search" link on your Navbar:
You should remove the code:
from "navbar" template under </form> tag 
I think that another important thing is:
target="_new" in the google search engine code:
_new : means, open search page in a new tab, if browser doesn't support new tab (ex: ie6, old browsers), it is opened in a new window.
if you want search page to be opened in a new window, you should change it to:
target="_blank"
This is my Google Search engine (right), and opened in new tab in Mozilla Firefox:

I wanted to share this information.
You can look live example to verify that it works..
For a long time I wanted to change my Vbulletin 4.1.3's search engine with Google's search engine.
I searched for forums, but I couldn't find a good solution. Yesterday, I made this change

If you want to look live example: http://www.ctrlpda.com
To do this: Go to AdminCP > Styles & Templates > Style manager
Choose "Edit template" right of the Style you want to modify. (I have 4 styles)
Then:
Double click to expand "Navigation / Breadcrump templates >>"
Then under expanded "Navigation / Breadcrump templates <<"
Double click "navbar"
find:
Code:
<form action="search.php?{vb:raw session.sessionurl}do=process" method="post" id="navbar_search" class="navbar_search"> <vb:comment><input type="hidden" name="s" value="{vb:raw session.sessionurl}" /></vb:comment> <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" /> <input type="hidden" name="do" value="process" /> <span class="textboxcontainer"><span><input type="text" value="" name="query" class="textbox" tabindex="99"/></span></span> <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search<vb:if condition="$stylevar['textdirection'] == 'rtl'">_rtl</vb:if>.<vb:if condition="(is_browser('ie') AND !is_browser('ie', 7) AND !is_browser('ie', 8))">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span> </form>
Code:
<form action="http://www.google.com.tr/cse" id="cse-search-box" target="_new" class="navbar_search"> <div> <input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXXXXXXX" /> <input type="hidden" name="ie" value="ISO-8859-9" /> <span class="textboxcontainer"><span><input type="text" value="" name="query" class="textbox" tabindex="99"/></span></span> <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search<vb:if condition="$stylevar['textdirection'] == 'rtl'">_rtl</vb:if>.<vb:if condition="(is_browser('ie') AND !is_browser('ie', 7) AND !is_browser('ie', 8))">gif<vb:else />png</vb:if>" name="submit" onclick="document.getElementById('cse-search-box').submit;" tabindex="100"/></span></span> </div> </form>
<input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXXXXXXX" />
<input type="hidden" name="ie" value="ISO-8859-9" />
according to your google adsense partner id and forum language code.
And save template

However if you want to remove "Advanced Search" link on your Navbar:
You should remove the code:
Code:
<ul class="navbar_advanced_search"> <li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li> </ul>

I think that another important thing is:
target="_new" in the google search engine code:
_new : means, open search page in a new tab, if browser doesn't support new tab (ex: ie6, old browsers), it is opened in a new window.
if you want search page to be opened in a new window, you should change it to:
target="_blank"
This is my Google Search engine (right), and opened in new tab in Mozilla Firefox:

I wanted to share this information.
You can look live example to verify that it works..

Comment