The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Replace search with Google Custom Search Details »» | |||||||||||||||||||||||||||||
Replace search with Google Custom Search
Developer Last Online: Dec 2018
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:
replace with the form line of the google supplied code example: PHP Code:
find PHP Code:
replace with the first 3 hidden input types in your google code example: PHP Code:
find PHP Code:
replace with PHP Code:
find PHP Code:
replace with PHP Code:
find PHP Code:
add this after PHP Code:
Screenshots
Show Your Support
|
Comments |
#72
|
|||
|
|||
looks promising, will check it out
|
#73
|
|||
|
|||
Well I finally got around the JS errors over at Google - no idea why I appeared to be the only one affected.
Anhow I now have it set up and I'd like to thank Dave-ahfb for the mod and also SemperFideles for making it a little easier to understand. :up: For my set up I wanted my registered users to be able to use the VB search plus the advanced search but I wanted to restrict guests to the Google site search only - I figure every little bit helps when it comes to reducing server load. For anyone who would like the same configuration, once you have your Google site search working properly, here's the template conditional I used in my navbar: find: Code:
<form action="search.php?do=process" method="post" id="navbar_search" class="navbar_search"> <input type="hidden" name="s" value="{vb:raw session.sessionurl}" /> <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.png" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span> </form> <ul class="navbar_advanced_search"> <li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li> replace it with: Code:
<!-- Start Conditional Google Search Box --> <vb:if condition="is_member_of($bbuserinfo, 1,3,4,22,49)"> <form action="http://www.YOUR/URL/TO/google.php" id="cse-search-box"> <input type="hidden" name="cx" value="partner-pub-XXXXXXXXXXXXXXXX:XXXXXXXXXXX" /> <input type="hidden" name="cof" value="FORID:9" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <span class="textboxcontainer"><span><input type="text" value="" name="q" class="textbox" /></span></span> <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="sa" onclick="document.getElementById('navbar_search').submit;" /> </span></span> </form> <script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script> <ul class="navbar_advanced_search"> <li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li> <vb:else /> <form action="search.php?do=process" method="post" id="navbar_search" class="navbar_search"> <input type="hidden" name="s" value="{vb:raw session.sessionurl}" /> <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.png" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span> </form> <ul class="navbar_advanced_search"> <li><a href="search.php{vb:raw session.sessionurl_q}" accesskey="4">{vb:rawphrase advanced_search}</a></li> </vb:if> <!-- End Conditional Google Search Box --> making sure you change the red text above to suit your system. Finally go to your usergroup manager and disable search for the usergroups you have listed in the conditional above and you're done. Mike |
#74
|
|||
|
|||
this just wont work for me - I have tried this 6 times checking and re-checking everything but still get a blank page on results.
On the adsense page it gives me a search results code and informs me to paste onto google.php but you say not to do this and to copy google.php exactly as you have it - Im confused |
#75
|
|||
|
|||
it is work on 4.0.3
|
#76
|
|||
|
|||
first step of navbar editing is wrong
the first line it says user must find it is very different from the line on this post =( |
#77
|
|||
|
|||
wampforum,
make sure to capitlaize the name of the temple like that ' GOOGLE' |
#78
|
|||
|
|||
works great, thanks Dave, installed on our test site for future deployment
and special thanks to SemperFi for the extended explanations! :up: |
#79
|
|||
|
|||
ah done it - not sure what I did worng but its working now.
Does anyone happen to know if theres a way to move the text of the serach results into the centre more? I have a dark style that uses a whote box which results are displayed within but the text starts touching the border and I would like a little gap between the border and the text |
#80
|
|||
|
|||
guys...you have tried this on 4.0.3?
|
#81
|
|||
|
|||
Please update for vb 4.0.3
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|