Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Add Google Custom Search to Navbar Drop-Down Menu Details »
Add Google Custom Search to Navbar Drop-Down Menu
Mod Version: 1.00, by asabet (Member) asabet is offline
Developer Last Online: Apr 2015 I like it Show Printable Version Email this Page

vB Version: 3.8.x Rating: (0 vote - 0 average) Installs: 3
Released: 20 Aug 2012 Last Update: Never Downloads: 0
Not Supported Template Edits Code Changes Re-usable Code Translations  

This is not supported. I am not a coder. This is just something that took me a long time to figure out, and I'm hoping it will come in handy for someone else.

Warning/disclaimer: I am not responsible if this breaks your site or makes it insecure. I will not help you fix your site if you harm it while doing this mod. Make sure to have a backup of any template you modify.

My goal was to encourage people to use Google search to search my site for 3 reasons, from most to least important:
  1. It gives better results than vBulletin search (IMO)
  2. It reduces the load on our server
  3. It generates a bit of ad revenue

At the same time, I wanted registered members to have the option to use the "Advanced Search" built into vBulletin, because this really comes in handy when you want to find a specific post by a specific member, in a specific forum, etc.

The result of this mod is that when unregistered guests click on "Search" in the Navbar, they get a Google Custom Search box only. When members click on "Search", they get the Google Custom Search box as well as a link to use the regular Advanced Search (see screenshot).

It's a very easy mod to do:

1) Go to Google.com/Adsense and create a custom search engine. After you do this, you will be presented with some code, the relevant portion of which will look like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Keep that part handy.

2) Go to your Navbar template and make a backup of it (copy the whole thing to a text file and save it in case you mess something up).

3) In your Navbar template, replace everything between


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

with the following:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Make sure to make the following substitutions in the code above:
  1. Replace the "XXXXXXXXXXXXXXXX:XXXXXXXXXX" in the code above with your own Adsense code.
  2. Replace "YYYYYYYY.com" with your site's name and/or address
  3. Replace "1" and "3" after "$bbuserinfo, " with the usergroup ids for your unregistered and awaiting email confirmation groups.

That's it. See the attachment for how this will look to your members (guests only see the Google search). Feel free to try it out on my site to see how it works.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	2012-08-20_0121.png
Views:	242
Size:	9.4 KB
ID:	140613  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Boolean Search in Search Drop-Down Menu Option in Navbar Neutral Singh vBulletin 3.5 Template Modifications 9 03 Jul 2007 21:58

Comments
  #2  
Old 20 Aug 2012, 05:50
ForceHSS's Avatar
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Have used this code from google long time ago and it works on vb4 as well
Reply With Quote
  #3  
Old 20 Aug 2012, 06:59
asabet asabet is offline
 
Join Date: Dec 2008
I was surprised that no one posted this before. Would have saved me about 5 hours of messing around .

How exactly do you get it to work in vB4, and do you have a site where I can check that out?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 07:57.

Layout Options | Width: Wide Color: