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 |
#182
|
|||
|
|||
Confirmed working on 4.2 as per SemperFideles instructions:
http://www.supermotoforum.co.uk/ Thanks for the help! |
#183
|
|||
|
|||
Managed to get this working with two issues:
- it breaks my header style - logo not showing up, forumhome sidebar shows on the bottom of the page, and it shows a large blank space below the results. |
#184
|
|||
|
|||
Thanks first for the great effort and trying to share the good stuff...
I believe there is something missing here, which is google.php connection to the search box. I tested your way, but not really working as I expected. It opens new page on google search while actually we want the search to be taking place in the forum itself using the google.php... what I did is the following: 1- created google.php "or whatever you like to call it" 2- created a template for google search as mentioned earlier. 3- placed google script in headeinclude template from my google custom search similar to this one: Code:
<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> Code:
<form action .... vb code for search box + button </form> Code:
<form method="get" action="http://www.YOUR VB LINK.com/google.php" target="_blank" class="navbar_search"> <input type="hidden" name="sitesearch" value="YOUR VB LINK.com" id="pn"/> <span class="textboxcontainer"><span><input type="text" value="" name="q" class="textbox" tabindex="99"/></span></span> <span class="buttoncontainer"><span><input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search.png" name="submit" style="border:0; margin-left:5px;" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/></span></span> <input type="hidden" name="domains" value="YOUR VB LINK.com"/> </form> 5- Last step, I added <gcse:search></gcse:search> in my google.php custom page... Save the whole work and check it out... I tested it and works perfect. Thanks, and good luck. Quote:
|
#185
|
|||
|
|||
Quote:
It works fine for my site although i had to make a couple of style mods. My one question is: I have linked my CSE to my Adsense Account, but the ads are not displaying in the search results page, although adsense is working perfectly on my actual site. Is this an adsense problem, or is there something I still need to do? |
#186
|
|||
|
|||
I have no idea how that should work, sorry about that, mate
|
#187
|
|||
|
|||
The mod is working great on VB 4.2
However I have an issue. It is working ONLY on the custom theme and not on the default theme. Any idea how do I fix this? Thanks |
#188
|
|||
|
|||
I followed the instructions but doesn't work (eMesitis.gr vB4.2.2).
Unfortunately I get a blank page. I would appreciate any help. 1) I created a new Template called "GOOGLE": PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
#189
|
|||
|
|||
See mostly is happens when your running site on folder of root server..
In Google.php file uncomment below line Quote:
|
Благодарность от: | ||
Charis |
#190
|
|||
|
|||
Thanks mate but it didn't work.
I found my forum path using the following php: PHP Code:
After that I followed your instructions and uncomment the path line in google.php: PHP Code:
In google.php there are three lines: PHP Code:
Should I change the 'test' on the first line? |
#191
|
|||
|
|||
try to create only test.php there were some tutorials here see you have blank page on that too . If you have same problem on test.php then tell your host to fix permissions on your account
cause the problem you would be getting is 500 internal server error which would be either permission or path error |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|