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 |
#172
|
|||
|
|||
just installed on 4.1.11 and works well.
|
#173
|
|||
|
|||
This still works with vB 4.2. The specific details on page 3 were really helpful. The only small change I had to make is Google Custom Search now has new code.
So on Semper's instruction on page 3 of this thread (Step 4), I had to replace the partner-pub id code with my search engine's "Search Engine Unique ID" which can be found in the Control Panel of your Google Custom Search account. Should look something like xxxxxxxxxxxxxxxxx:xxxxxxxx Then I had to click "Make Money" in the left column of the Google Custom Search Control panel and sync my AdSense account to my Google Custom Search account. The Search Engine Unique ID has now replaced the partnerpub ID. But the partner-pub still works if you're using it. |
#174
|
|||
|
|||
It doesn't works for me -> here is my navbar code:
Code:
<div id="navbar" class="navbar"> <ul id="navtabs" class="navtabs floatcontainer<vb:if condition="$show['member'] AND $notifications_total"> notify</vb:if>"> {vb:raw template_hook.navtab_start} {vb:raw navigation} {vb:raw template_hook.navtab_end} </ul> <vb:if condition="$vboptions['enablesearches']"> <div id="globalsearch" class="globalsearch"> <form action="http://testforum.insidegames.ch/google.php" id="cse-search-box"> <input type="hidden" name="cx" value="pub-6521811265209589" /> <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:raw template_hook.navbar_advanced_search} </ul> </div> </vb:if> </div> </div><!-- closing div for above_body --> <div class="body_wrapper"> <div id="newcrumb"> <div id="crumbL"> <div id="breadcrumb" class="breadcrumb"> <ul class="floatcontainer"> <li class="navbithome"><a href="index.php{vb:raw session.sessionurl_q}" accesskey="1"><img src="{vb:stylevar imgdir_misc}/navbit-home.png" alt="{vb:rawphrase home}" /></a></li> {vb:raw navbits.breadcrumb} {vb:raw navbits.lastelement} </ul> <hr /> </div> </div> <!-- crumb --> <div id="crumbR"> <ul> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_rss'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_rss}"><img src="{vb:stylevar imgdir_misc}/icon-rss.png" /></a></li></vb:if> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_twitter'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_twitter}"><img src="{vb:stylevar imgdir_misc}/icon-twitter.png" /></a></li></vb:if> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_facebook'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_facebook}"><img src="{vb:stylevar imgdir_misc}/icon-facebook.png" /></a></li></vb:if> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_linkedin'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_linkedin}"><img src="{vb:stylevar imgdir_misc}/icon-linkedin.png" /></a></li></vb:if> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_myspace'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_myspace}"><img src="{vb:stylevar imgdir_misc}/icon-myspace.png" /></a></li></vb:if> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_blogger'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_blogger}"><img src="{vb:stylevar imgdir_misc}/icon-blogger.png" /></a></li></vb:if> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_youtube'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_youtube}"><img src="{vb:stylevar imgdir_misc}/icon-youtube.png" /></a></li></vb:if> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_flickr'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_flickr}"><img src="{vb:stylevar imgdir_misc}/icon-flickr.png" /></a></li></vb:if> <vb:if condition="!empty($vbulletin->options['ws_bluepearl_sp_google'])"><li><a href="{vb:raw vboptions.ws_bluepearl_sp_google}"><img src="{vb:stylevar imgdir_misc}/icon-google.png" /></a></li></vb:if> </ul> </div> <br clear="all" /> </div> <!-- newcrumb --> {vb:raw ad_location.ad_navbar_below} {vb:raw ad_location.global_below_navbar} <vb:if condition="$show['notices'] AND THIS_SCRIPT != 'register'"> <form action="profile.php?do=dismissnotice" method="post" id="notices" class="notices"> <input type="hidden" name="cx" value="pub-6521811265209589" /> <input type="hidden" name="cof" value="FORID:10" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <input type="hidden" id="dismiss_notice_hidden" name="dismiss_noticeid" value="" /> <input type="hidden" name="url" value="{vb:raw return_link}" /> <ol> {vb:raw notices} </ol> </form> </vb:if> 400. That’s an error. Your client has issued a malformed or illegal request. That’s all we know. |
#175
|
|||
|
|||
Quote:
|
#176
|
|||
|
|||
Does this show using an iframe within the site template? Or open in a new window?
|
#177
|
|||
|
|||
Quote:
After hour and a half of trying to figure out why I'm getting a blank page, Sonata saves me from pulling out my hair. Also, thanks to OP for the mod. Very much appreciated. :up: techbytes |
#178
|
|||
|
|||
There is an update for this with the latest (v2) version of google custom search. I really like the google cse in vbulletin. It's much faster and with some styling in the css even the Google cse v2 will work in vbulletin 4.2
This short instruction will help if you use a two-page CSE as shown in the documentation at Multiple search boxes and results sections. Already mentioned here: 1. Create the google.php file as mentioned on page 3 in this thread. 2. Create the GOOGLE template as mentioned on page 3 in this thread. Now the new stuff. 1. headinclude template copy the script-snippet at the bottom of your headinclude template. Code:
<!-- google cse --> <script> (function() { var cx = '00000000000000:aaaaaaaaaaa'; ///////////////CHANGE THIS TO YOUR OWN ID //// var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> <!-- / google cse --> 2. navbar template Display the search form in the navigation Search for <form action="search.php .... comment the normal search form Code:
<vb:comment><form action .... a few lines </form></vb:comment> Code:
<div id="globalsearch" class="globalsearch"> <gcse:searchbox-only></gcse:searchbox-only> but first edit the 3. GOOGLE Template Should look like this: Code:
<div class="blockrow"> <gcse:search></gcse:search> </div> If you only want to show the search results you can use <gcse:searchresults-only></gcse:searchresults-only> 4. additional.css template The search form will look broken at first. You should modify at least the following styles: Code:
input.gsc-input { font-size:11px !important; } #globalsearch .gsc-input-box { border:none !important; height:22px !important; } #globalsearch input.gsc-search-button-v2 { padding:4px 20px !important; margin-top:1px !important; } |
3 благодарности(ей) от: | ||
CAG CheechDogg, fxdigi-cash, Spika |
#179
|
||||
|
||||
Quote:
Thank you very much! |
#180
|
|||
|
|||
Installed and works for my forum, check the link to see.
http://www.railtransit-cbtc.com/CBTC...ity/forum.php? |
#181
|
|||
|
|||
SemperFideles's instructions on the 3rd page worked for my 4.2 forum. Thanks SemperFideles!!!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|