The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Use Google Custom Search In Navbar - Step By Step Details »» | |||||||||||||||||||||||||||||||
Use Google Custom Search In Navbar - Step By Step
Developer Last Online: Jan 2016
This mod will replace vb search in navbar with google custom search.. you can still use advance search from navbar. google search provide much better result when you try to search word under 4 letters..
1. First download google.php upload in your forum root 2. Go to your AdminCP Go to Styles & Templates -> Style Manager select Style then click Create New Template rename Template to GOOGLE Paste this code in google Template : Code:
{vb:stylevar htmldoctype} <html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html"> <head> <title>{vb:raw vboptions.bbtitle}</title> {vb:raw headinclude} </head> <body> {vb:raw header} {vb:raw navbar} <div id="pagetitle"> <h1>{vb:raw pagetitle}</h1> </div> <h2 class="blockhead">Google Custom Search</h2> <div class="blockbody"> <div class="blockrow"> <div id="cse-search-results"></div> <script type="text/javascript"> var googleSearchIframeName = "cse-search-results"; var googleSearchFormName = "cse-search-box"; var googleSearchFrameWidth = 800; var googleSearchDomain = "www.google.com"; var googleSearchPath = "/cse"; </script> <script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script> </div> </div> {vb:raw footer} </body> </html> Code:
<form action="http://www.mobilephonetalk.com/google.php" id="cse-search-box"> <input type="hidden" name="cx" value="partner-pub-8038994048300561:7c8fy7cujxg" /> <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> Replace partner-pub-8038994048300561:7c8fy7cujxg with your won adsense code... Download Now
Screenshots
Show Your Support
|
3 благодарности(ей) от: | ||
appsfinder, daviet, KILLERMG |
Comments |
#72
|
|||
|
|||
I set this up, my header was all mangled but it did send results, the only issue I have otehr than cosmetic is that its also showing google adds on the right side. In my industry (casinos) I am not permitted to try and use adsense to make or promote casinos. I simply want the site search.
Is this possible? Thanks, |
#73
|
|||
|
|||
Quote:
why??? |
#74
|
|||
|
|||
Good mod, working well in 4.1.12 although I can't see any reason why it wouldn't work in any of the versions mentioned as not working above.
I did change line 8 of google.php to a normal script name rather than 'test',so: Code:
define('THIS_SCRIPT', 'google'); Code:
<vb:if condition="THIS_SCRIPT != 'google'"> Code:
{vb:raw headinclude_bottom} Thanks for posting this - a real time saver in getting this working and well explained. |
#75
|
|||
|
|||
Just upgraded a site from vB3 to vB4, and need a good search system, Used to use Marco's google search in vB3 but thats not working with vB4. Anyway, tried doing this but the required template must have been done away with as I can't find it. Where can I make the required edit?
Quote:
|
#76
|
||||
|
||||
No, it's there, just search your templates for globalsearch and it should show up.
|
#77
|
|||
|
|||
Nope its not there, i searched for it and all it did was bring up 2 templates both having to deal with google chrome, nothing to do with the Navbar, they definitely did away with it, there is a similiar code in the Navbar template that says search, but when i tried to replace that it does not allow it. 4.2.0
|
#78
|
||||
|
||||
Google changed the script location, this should fix it if you are getting the generic 'nothing I can do URL".
In Templates: Navbar after this Code:
<div id="globalsearch" class="globalsearch"> Code:
<form action="http://www.yourdomain.com/yourforumurl/google.php" id="cse-search-box"> <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxxxxx:xxxxxxxxxx" /> <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/coop/cse/brand?form=cse-search-box&lang=en"></script> |
Благодарность от: | ||
sweetpotato |
#79
|
|||
|
|||
I had this installed and it works great, but it breaks the "New Posts" and the search. It shows the results but no posts.
https://www.vbulletin.com/forum/show...topped-Working |
#80
|
||||
|
||||
I installed this and it works, but the formatting isn't great.
|
#81
|
|||
|
|||
Still working on 4.2
For search advertising don't need to follow Google tos |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|