vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=263440

Use Google Custom Search In Navbar - Step By Step
by rajubd
10 May 2011 23:46

2 Attachment(s)
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 :

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

3. Then Open Navigation / Breadcrumb Templates Click Collapse button click navbar Template find <div id="globalsearch" class="globalsearch"> and <ul class="navbar_advanced_search"> remove all code between this with


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

Note : Replace http://www.mobilephonetalk.com with your won website name
Replace partner-pub-8038994048300561:7c8fy7cujxg with your won adsense code...

RobbieZ 11 May 2011 11:52

Nice work.

Doesnt work on a closed forum where you have to log in to view the site as google cant access this!

rajubd 13 May 2011 02:15

Quote:

Originally Posted by RobbieZ (Post 2194366)
Nice work.

Doesnt work on a closed forum where you have to log in to view the site as google cant access this!

Yes but you can use advanced or forum search..

obmob 03 Jun 2011 16:40

Works really nice, the template makes it even better. :)

rajubd 06 Jun 2011 21:28

Quote:

Originally Posted by obmob (Post 2203105)
Works really nice, the template makes it even better. :)

Thanks...

Vaira 09 Jun 2011 17:59

I got global search results, but not for the website specific only.

Did I miss something?
I have removed the partner-pub-xxxxxxx:xxxxxx-xxxxxx line completely since I don't have a ad sense account

Thanks.

Vaira 10 Jun 2011 12:10

OK I did some research....
This method is made to work with adsense only and is spread all over the net.

You simply cannot remove the line.

For non adsense users just go for that:
http://www.vbulletin.org/forum/showt...=241563&page=3

Ichigo88 11 Jun 2011 19:34

4.1.3 not work -.-

rajubd 11 Jun 2011 19:52

I am using it in my site with 4.1.3 ... try again

rajubd 11 Jun 2011 19:54

Quote:

Originally Posted by Vaira (Post 2205796)
OK I did some research....
This method is made to work with adsense only and is spread all over the net.

You simply cannot remove the line.

For non adsense users just go for that:
http://www.vbulletin.org/forum/showt...=241563&page=3

I didn't test it for non AdSense users thanks for info...

temsamane 12 Jun 2011 22:28

i tried the script, but it doesnt give me search results.

look at: http://www.rkempo.nl/forums/forum.php

help me with this issue please

rajubd 12 Jun 2011 22:41

describe what you did?

Vaira 13 Jun 2011 00:57

Quote:

Originally Posted by rajubd (Post 2206354)
I didn't test it for non AdSense users thanks for info...

You're welcome.
We are thinking about of getting an adsense account, and if not the other solution is right.
Thanks for your mod. :);)

BlueCheri 13 Jun 2011 10:28

Hi very nice, installed.

Getting following error;

400. That’s an error.
Your client has issued a malformed or illegal request. That’s all we know.


Using 4.1.2 version, Can you help me on this?

Thanx in advance.

temsamane 13 Jun 2011 18:33

this is my navbar code. where do i have to place the second code? i dont see globalsearch


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


obmob 13 Jun 2011 21:34

Maybe you need to revert that template. o.o

temsamane 14 Jun 2011 12:18

i reverted the navbar page. now i did everything fine, but get a google error

Your client has issued a malformed or illegal request.

temsamane 14 Jun 2011 12:24

Quote:

Originally Posted by BlueCheri (Post 2207031)
Hi very nice, installed.

Getting following error;

400. Thatís an error.
Your client has issued a malformed or illegal request. Thatís all we know.


Using 4.1.2 version, Can you help me on this?

i've got the same problem. and the search page layout is messed up (footer not visible).

BlueCheri 14 Jun 2011 13:07

Footer is visible in my case.

synseal 17 Jun 2011 12:24

Quote:

Originally Posted by temsamane (Post 2207541)
i've got the same problem. and the search page layout is messed up (footer not visible).

Footer visible but same error on 4.1.4

400. Thatís an error.
Your client has issued a malformed or illegal request. Thatís all we know.


Shame :(.

bosken 17 Jun 2011 14:51

1 Attachment(s)
Works fine on 4.1.4

BUT is there a way, how and where to change/remove the "google custom search gif" in the search field. Users THINK that its ONLY a regular google search.... I would like my own text like "Search the forum"

"<input type="text" class="textbox" name="q" value="" style="border: 1px solid rgb(126, 157, 185); padding: 2px; background: url(&quot;[url]http ://www.google.com/cse/intl/en/images/google_custom_search_watermark.gif&quot; ) no-repeat scroll left center rgb(255, 255, 255);">"

ARSamo 21 Jun 2011 16:14

Error:

404. Thatís an error.
The requested URL /cse?cx=partner-pub-xxxxxxxxxxxxxxxxxxx
was not found on this server. Thatís all we know.

what can i do now....?

ARSamo 21 Jun 2011 16:48

another error:

400. That’s an error.
Your client has issued a malformed or illegal request. That’s all we know.

rajubd 21 Jun 2011 17:17

did you activate AdSense for search from www.google.com/adsense ?

synseal 22 Jun 2011 12:06

Quote:

Originally Posted by rajubd (Post 2210942)
did you activate AdSense for search from www.google.com/adsense ?

How do you do this, this is not mentioned in the modification, if you mean do I have adsense set up then yes I do, but I wasn't aware that you had to activate AdSense for search?.

TIA.

rajubd 22 Jun 2011 19:48

in AdSense main dashboard you will find AdSense for content
AdSense for search
AdSense for feed etc

go to AdSense for search complete all step then do this modification

synseal 23 Jun 2011 21:05

1 Attachment(s)
Done all that now, thanks for your help but this unfortunatley does not work with 4.1.4.

All I get is this (pic).

the closest I get is if I replace the pub ID with the actual snippit from google but then I have 2 search boxes.

I am pretty good when it comes to installing template mods so I dont know why this isn't working for me?.

synseal 05 Jul 2011 14:29

1 Attachment(s)
Got it working, I was putting the wrong pub id in.

I was using the one in the top right hand corner when signed into adsense instead of the one in the code given :o

Installed.

Crotan 06 Jul 2011 20:49

While looking at your site as a demo (http://www.mobilephonetalk.com), I did a search but results on pages past the first tended to have buggy results.

I'm using Google Chrome, and there were gaps and white spaces between results but then I highlighted the text and it appeared. kinda wonky?

radiofranky 06 Jul 2011 23:45

the search result should be blend in with forum style, not as a google page.


cheers

synseal 07 Jul 2011 08:15

Quote:

Originally Posted by Crotan (Post 2217521)
While looking at your site as a demo (http://www.mobilephonetalk.com), I did a search but results on pages past the first tended to have buggy results.

I'm using Google Chrome, and there were gaps and white spaces between results but then I highlighted the text and it appeared. kinda wonky?

Strange, it seems fine at my end?.

Crotan 07 Jul 2011 21:42

Quote:

Originally Posted by synseal (Post 2217686)
Strange, it seems fine at my end?.

https://www.vbulletin.org/forum/external/2011/07/46.png

baghdad4ever 08 Jul 2011 19:14

doesn't worked

does work
by appsfinder
15 Jul 2011 19:39

Quote:

Originally Posted by baghdad4ever (Post 2218273)
doesn't worked

works fine in 4.1.4

Crotan 15 Jul 2011 21:50

Anybody else have another demo? of this working, the coders website has buggy results for me on Chrome

rajubd 17 Jul 2011 14:33

2 Attachment(s)
Quote:

Originally Posted by Crotan (Post 2220989)
Anybody else have another demo? of this working, the coders website has buggy results for me on Chrome

unable to find bug working well on 4.1.4 with Google Chrome
https://www.vbulletin.org/forum/external/2011/08/79.jpg
https://www.vbulletin.org/forum/external/2011/08/79.jpg

synseal 18 Jul 2011 09:49

Another demo http://www.techkings.org/forum/

Crotan 25 Jul 2011 16:24

Quote:

Originally Posted by rajubd (Post 2221469)
unable to find bug working well on 4.1.4 with Google Chrome

Look at results on pages past the first using chrome on your website. For some reason, there are gaps in the search results.

Quote:

Originally Posted by synseal (Post 2221849)

However, yours is fine for me, so maybe just a website issue instead of a incompatibility with chrome.

Thanks

DNN 03 Aug 2011 22:10

Quote:

Originally Posted by rajubd (Post 2221469)



followed your instructions and uploaded google.php to web root. when a test search is performed, the screen just goes blank. is running vB 4.1.3.


what else needs to be done so it can work?

DNN 03 Aug 2011 22:23

Quote:

Originally Posted by rajubd (Post 2221469)

not working on 4.1.3. Try searching on DNN and see that the search results come up blank. google.php is officially uploaded to root , and all other instructions are followed. what can be done now to make this work?

bosken 03 Aug 2011 23:13

Works great in 4.1.5 PL1

Check my site!

bosken 03 Aug 2011 23:15

Tried your page, only blank page after search, had that same error the other day... damn...what was that again....

bosken 03 Aug 2011 23:20

Yes, after upgrading from 4.1.4 to 5 it stopped working coz of templates upgrades or something, also got blank page.

Had to create a new template (as say in instruction above) MAke sure you have this template:

https://www.vbulletin.org/forum/external/2011/08/78.jpg

Large GOOGLE, if not, make a new one. then paste the code from above into that template. Thart sorted out my error...

DNN 03 Aug 2011 23:58

Quote:

Originally Posted by bosken (Post 2228974)
Tried your page, only blank page after search, had that same error the other day... damn...what was that again....

running 4.1.3.


what do you think is the issue with the page being blank ? followed all the directions to a "T", and [no haps] on it working

DNN 03 Aug 2011 23:59

Quote:

Originally Posted by bosken (Post 2228977)
Yes, after upgrading from 4.1.4 to 5 it stopped working coz of templates upgrades or something, also got blank page.

Had to create a new template (as say in instruction above) MAke sure you have this template:

https://www.vbulletin.org/forum/external/2011/08/78.jpg

Large GOOGLE, if not, make a new one. then paste the code from above into that template. Thart sorted out my error...

did you upload the google.php file to your root "as is" after downloading it, or, is there anything that needs to be changed in that file, in order for things to work?

DNN 04 Aug 2011 00:02

Quote:

Originally Posted by DNN (Post 2228991)
did you upload the google.php file to your root "as is" after downloading it, or, is there anything that needs to be changed in that file, in order for things to work?

Thank you for the kind help. Did as you said. LARGE GOOGLE, and it worked! =)


Thanks again and come by Drewry News Network, create a free account, and stay connected, so we can stay networking =)

Much appreciated!

DNN 04 Aug 2011 00:03

You can also ignore the previous post about "if you edited anything in the Google.php file" =)

trackpads 15 Sep 2011 01:21

Great Mod!

One question, I want to completely disable the search engine on my forum but when I do the google box disappears. Is there way to code it so its there if we disable the search?

Thanks!!!

-Jason

BlueCheri 16 Sep 2011 17:28

Does it work for 4.1.2?

rajubd 22 Sep 2011 11:06

Quote:

Originally Posted by BlueCheri (Post 2246853)
Does it work for 4.1.2?

Yes it does

appsfinder 29 Sep 2011 05:17

Hi how can i add this to the advanced search

all the best

ngocol 09 Oct 2011 13:59

instaled thanks

ahobilam 25 Oct 2011 16:59

I tried this
in VB 4.1.7
No luck?!

Gn_Snake 28 Oct 2011 20:31

Does it work for 4.1.7?

K!nG 26 Nov 2011 03:33

Just installed on 4.1.8 & working just fine :) Thanks

datoneer 01 Dec 2011 12:58

I cannot find this (vb version 4.1.5)

3. Then Open Navigation / Breadcrumb Templates Click Collapse button click navbar Template find <div id="globalsearch" class="globalsearch"> and <ul class="navbar_advanced_search"> remove all code between this with

GTX2 04 Dec 2011 08:00

any chance of not showing ads in navbar when search is done?
Just like i have conditionals for register and login script page, how can i add this one here?


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

This last one not working...

zeus_r6 07 Dec 2011 20:40

I'm seeing little to no search results where I got plenty using the vb search...ideas?

zeus_r6 07 Dec 2011 20:50

It's almost like it's not searching my site

ecitizen 26 Dec 2011 13:07

but dont work with persiton langueg

rajubd 26 Dec 2011 13:15

Quote:

Originally Posted by zeus_r6 (Post 2275684)
I'm seeing little to no search results where I got plenty using the vb search...ideas?

That means google not indexing your site properly

alghzil 29 Dec 2011 14:40

is this way legal?

mnms 04 Jan 2012 00:18

Installed on VB 4.1.6 in UTF-8.
it is working very well. thanks a lot for this mod ;)

Bellinis 02 Feb 2012 12:43

It's not working for me: Version 4.1.10

The page loads nicely, but no search results. Our site is well indexed in Google, so that should be no problem. Site: www.skodaforum.nl > select the VB4 default style to test it.

Please advise

Spika 10 Feb 2012 04:55

Quote:

Originally Posted by Bellinis (Post 2295343)
It's not working for me: Version 4.1.10

The page loads nicely, but no search results. Our site is well indexed in Google, so that should be no problem. Site: www.skodaforum.nl > select the VB4 default style to test it.

Please advise

Same problem. Only show results If I choose in Adsense "search the web" and not my forum.
Version 4.1.10

Thanks

ejup2009 17 Feb 2012 22:38

Don`t working in Vbulletin 4.1.9

raja811 25 Feb 2012 21:59

thank you

tafreeh 27 Feb 2012 23:07

good one. thanks a lot.

Question: How can i change color and look of a result page ?
Thanks

hurricane_sh 11 Mar 2012 07:03

Doesn't seem to work with 4.1.11, got blank page when click search, but works well with 4.1.10.

rajubd 11 Mar 2012 22:29

I have stopped using them because adsense didn't sent my pin code...

ctrenks 23 Apr 2012 21:34

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,

farazfaraz 28 Apr 2012 07:49

Quote:

3. Then Open Navigation / Breadcrumb Templates Click Collapse button click navbar Template find <div id="globalsearch" class="globalsearch"> and <ul class="navbar_advanced_search"> remove all code between this with
i can't find in my Templates!!

why???

hqarrse 10 May 2012 19:21

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:


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

and this allows use of sensibly named template conditionals such as:


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

The only other change needed, other than some layout tweaks, was to add the second header include to the template:


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

Also working fine with Everywhere Sidebar using the instructions for adding the sidebar to custom pages.

Thanks for posting this - a real time saver in getting this working and well explained.

Big-Pete 13 May 2012 18:24

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:

3. Then Open Navigation / Breadcrumb Templates Click Collapse button click navbar Template find <div id="globalsearch" class="globalsearch"> and <ul class="navbar_advanced_search"> remove all code between this with

Mellow 18 May 2012 12:16

No, it's there, just search your templates for globalsearch and it should show up.

RoG Aftermath 27 May 2012 18:05

Quote:

Originally Posted by Mellow (Post 2330399)
No, it's there, just search your templates for globalsearch and it should show up.

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

trackpads 28 May 2012 00:11

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
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add the following (first replace the URL and Partner ID from adsense:

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

If you dont see globalsearch it is because you have modified your Navbar template and need to revert it.

Jakobi 30 May 2012 00:20

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

dougdirac 15 Aug 2012 15:52

I installed this and it works, but the formatting isn't great.

rajubd 17 Aug 2012 16:03

Still working on 4.2
For search advertising don't need to follow Google tos

zascok 08 Sep 2012 23:08

nice! thank you.

halilkoca 21 Sep 2012 08:04

thank you it works on vbulletin 4.2.0.
i haven't got google adsense code but i made it from google webmaster tools. thanks.

sivaganeshk 23 Sep 2012 18:10

how to manage height in google.php ?
I see large space below.

dougdirac 23 Sep 2012 19:57

Quote:

Originally Posted by sivaganeshk (Post 2367973)
how to manage height in google.php ?
I see large space below.

This is an excellent question. I have the same problem. The page below is super long with no content. Also, I wish the Google search ads were just down the side. Not or the top and down the side.

sweetpotato 29 Sep 2012 22:52

Quote:

Originally Posted by dougdirac (Post 2368007)
This is an excellent question. I have the same problem. The page below is super long with no content. Also, I wish the Google search ads were just down the side. Not or the top and down the side.

You must use advanced search features and get the code. But with google search v1 code you cannot create a template, for v2 you cannot config for the search links to open in the same windows.

Spika 23 Feb 2013 11:36

1 Attachment(s)
Please

Does anyone know why my box goes lower than the others?

My input.box height is 17 px when other I see is 23 px
I donīt find where I can change this (google ads or VB)

Please help.
Attachment 143910

Delfi_r 12 Mar 2013 09:48

Installed and working fine!

stevectaylor 17 Mar 2013 17:43

Installed and working great.

One question is the fixed width, can this be changed to liquid?

Lpspider 01 Jun 2013 07:13

Installed but ever search is showing 404 Google image error on-site...

Edit: didn't see the solution a few posts above, will try that.

Edit: Still getting the error, followed by blank space.

Quote:

400. That’s an error.

Your client has issued a malformed or illegal request. That’s all we know.

fxdigi-cash 03 Jun 2013 15:45

i believe it is better to go to google custom search service and make your own customized search tool and then grab the html code and place it anywhere you like on your vb...

as easy as that :)

Cheers

dougdirac 20 Jun 2014 07:01

Recently found that the results page that is generated does not use the additional.css, so certain elements of my theme were broken.

How can I make sure the additional.css is loaded with this?

ramesh_umk3 21 Jun 2014 12:33

Quote:

<link rel="stylesheet" type="text/css" href="PATH/For/additional.css" />
add to the header and it should load up while page loading

SWSUSA 27 Jul 2015 20:03

I delete the events, as it negatively affects the speed of loading pages.

Удаляю этот мод, так как он отрицательно влияет на скорость загрузки страниц.

I should add that the site specified by the author mobilephonetalk contains unwanted software and locks the browser Google Chrome.

Добавлю, что сайт указанный автором mobilephonetalk содержит нежелательное ПО и блокируется браузером Google Chrome.

rcull 12 Mar 2017 04:19

I would have liked to keep the VBForum search box as well as this, but when I have them both, one bumps the other into the lower navigation bar.
4.2.3
Any suggestions?

It probably has to do with editing the "globalsearch" class (width; 180px; ), but I sure can't figure out how to find it:(


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


MarkFL 12 Mar 2017 04:58

Look in your "vbulletin-chrome.css" template for that class selector. :)

rcull 12 Mar 2017 17:07

1 Attachment(s)
Thanks for your help! I found it and played with it, but it must not be what I need:(

In case you or someone else can point me in the right direction, I would like the two searches to line up side by side in the navbar.

I have attached an image how one search box is displacing the second one to the line below it:

Alan_SP 12 Mar 2017 19:29

What I do is place Google code in navbar (choose your position), leaving vBulletin's search completely intact. In this way I have two search engines with Google one preferred (GCS input form is 100% wide).

rcull 13 Mar 2017 03:10

Alan,

That sounds like what I am trying to do. I am just having difficulty figuring out how. When I place it in the navbar, it displaces the VB search as shown in the image.

I tried placing it in the navbar_tabs template, but it displaced the last tab to the lower level.

I have seen it done on other sites, but I am not figuring it out. And I have been searching all over. All I find is the same replace default search.

Thanks

final kaoss 13 Mar 2017 05:55

I tend to use this. It works much better.
http://www.vbulletin.org/forum/showthread.php?t=266520

Alan_SP 16 Mar 2017 18:04

Quote:

Originally Posted by rcull (Post 2583782)
Alan,

That sounds like what I am trying to do. I am just having difficulty figuring out how. When I place it in the navbar, it displaces the VB search as shown in the image.

Sorry, I wasn't completely clear what I did on my site.

I placed code in navbar template, so it isn't in navbar per se, but it is visible in every page. You can see it here: https://slobodni.net

This way I still have completely working vB search and Google Custom Search available everywhere. I didn't want to change or modify vB search. And also I wanted to "force" users to use GCS as much as it is possible.


All times are GMT. The time now is 11:49.

Powered by vBulletin® Version 3.8.14
Copyright © 2022, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.