PDA

View Full Version : Add Google adsense search to your navbar dropdown


ericgtr
18 Dec 2005, 19:37
For any of you running adsense, using the adsense search on your site will generate more revenue. If you don't already have it setup, log into your adsense account and click on the "AdSense for Search" link then customize it to your liking. More so to make it fit better in the dropdown box. You may also add your site to the search, it will generate more clicks.

Now add it do your Search dropdown, in the navbar template find:

<td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td>
</tr>


Add this underneath:

<tr>
<td class="thead">Search Google</td>
</tr>
<!-- SiteSearch Google -->
replace this text with your adsense search code
<!-- SiteSearch Google -->

noppid
18 Dec 2005, 21:53
What an awsome idea! Thanks for sharing this!

ericgtr
18 Dec 2005, 22:06
Sure :) It's a boring Sunday and it's snowing out so I decided to share some of my template mods with the group.

Rich
19 Dec 2005, 00:27
Hello,

Since I added this in the other modification (same thing as this) I figure I will add it here too.

This attachment explains how to give the google search its own dropmenu which gives it more attention and more revenue for you.

This is the other thread that does the same thing as this one:

http://www.vbulletin.org/forum/showthread.php?t=91438&highlight=google

ericgtr
19 Dec 2005, 00:34
Thanks for this. The reason I decided to add this to the existing search is because that's the one I think most people will use, that's just me though :) Additionally, I was thinking about adding this to the search dropdown in the forum and thread views as well.

The Chief
19 Dec 2005, 01:22
installed and works great, thank you :)

/me clicks install

prawn
20 Dec 2005, 10:50
hey there!
thanks for that great idea.

i wanted to add that to my boards but i came across some more requirements i also worked out. i added the function to minimize the google form and stuff like that. you can take a look at what i mean by taking a quick visit on my forums here (http://www.kornworld.de/board/).

here's the code if you like it:
<tr>
<td class="thead"><a style="float:right" href="#top" onclick="return toggle_collapse('navbar_google')"><img id="collapseimg_navbar_google" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_navbar_google].gif" alt="" border="0" /></a>Google Suche</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite" id="collapseobj_navbar_google" style="$vbcollapse[collapseobj_navbar_google]">
<div align="center">
<!-- SiteSearch Google -->
<!-- GOOGLE ADSENSE CODE HERE -->
<!-- SiteSearch Google -->
</div>
</td>
</tr>

ericgtr
20 Dec 2005, 14:04
hey there!
thanks for that great idea.

i wanted to add that to my boards but i came across some more requirements i also worked out. i added the function to minimize the google form and stuff like that. you can take a look at what i mean by taking a quick visit on my forums here (http://www.kornworld.de/board/).

here's the code if you like it:
<tr>
<td class="thead"><a style="float:right" href="#top" onclick="return toggle_collapse('navbar_google')"><img id="collapseimg_navbar_google" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_navbar_google].gif" alt="" border="0" /></a>Google Suche</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite" id="collapseobj_navbar_google" style="$vbcollapse[collapseobj_navbar_google]">
<div align="center">
<!-- SiteSearch Google -->
<!-- GOOGLE ADSENSE CODE HERE -->
<!-- SiteSearch Google -->
</div>
</td>
</tr>

Nice addition, thanks! :)

ericgtr
21 Dec 2005, 21:46
Is it possible (using CSS) to get the google search button to look like the other buttons on your website (mine are "flat" using CSS)?

Could be but it may be against their TOS to edit anything that isn't provided from their builder page. They are very touchy about how their ads are displayed and every day I keep reading new horror stories about people's accounts getting yanked so I try not to touch anything like that lol.

ericgtr
21 Dec 2005, 21:54
Ahh Gotcha, not sure how that would be done myself.

prawn
21 Dec 2005, 23:26
Yeah I was ++++ed up once for asking people to click on my banner. They kicked my account and I tried to argue with them. They copied & pasted their f*ckin TOS everytime. I thought I was mailing with a computer. You really have to be careful there.
Don't think that this is possible. Even if it was possible they might say anything is forbidden that changes the appearance of their banners.

They get like M$! ;)

ericgtr
21 Dec 2005, 23:33
Yeah, even though it technically wouldn't be changing their source code, it's still an alteration to the end result.

Moncal
26 Dec 2005, 15:11
Great idea. Thanks.

NineToez
28 Dec 2005, 10:05
Thanks! Great mod! My only wish would be to make the text box and button the exact same size as the vB to match (so I'm a little anal), but none the less a worthwhile mod.

Freezerator
30 Dec 2005, 22:13
<tr>
<td class="thead">Search Google</td>
</tr>
<!-- SiteSearch Google -->
replace this text with your adsense search code
<!-- SiteSearch Google -->


When i add this code, it breaks the table? I can't figure it out where it's happening. Can someone check this?

ericgtr
30 Dec 2005, 22:16
This is designed for 3.5.x are you still using 3.0.7? If so it's probably a matter of messing with it a little bit to get the format right in your template. I would look for you but my server is crashed at the moment.

Freezerator
30 Dec 2005, 22:17
I am sorry, i haven't updated my profile. I am using 3.5.2 since today :)

ericgtr
30 Dec 2005, 22:28
Okay, lets make sure that where it says:
replace this text with your adsense search code
is only replaced with the google code itself, no other. So you will want to start at <script> and end at </script> when pasting your code in.

Freezerator
30 Dec 2005, 22:34
http://forum.scooterforum.net/forum/

I have inserted the code, without the google script. As you can see, it looks like the table doesn't close correctly.

I have this code:


<td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td>
</tr>

<tr>
<td class="thead">Search Google</td>
</tr>
<!-- SiteSearch Google -->
replace this text with your adsense search code
<!-- SiteSearch Google -->

</tr>
</table>
</div>
<!-- / header quick search form -->

ericgtr
30 Dec 2005, 22:42
On your forum it looks like it's above the default search when it should be below.

Freezerator
30 Dec 2005, 22:46
You are right, and that is the problem. The code i have pasted here above shows that i have c/p it on the right spot right? It's underneath <td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td> so i can't see where it goes wrong.

ericgtr
30 Dec 2005, 22:56
Hmm.. without being able to look at my templates at the moment it's hard to tell but this does look suspect:

<tr>
<td class="thead">Search Google</td>
</tr>
<!-- SiteSearch Google -->
replace this text with your adsense search code
<!-- SiteSearch Google -->

</tr>
</table>

Looks like there are two closing tags, is that last </tr> in the template by default? You can do a "View Original" to tell.

XtremeOffroad
04 Jan 2006, 19:29
This is Great, Thanks for sharing.
Installed.

LBSources
05 Jan 2006, 01:42
Hmm.. without being able to look at my templates at the moment it's hard to tell but this does look suspect:

<tr>
<td class="thead">Search Google</td>
</tr>
<!-- SiteSearch Google -->
replace this text with your adsense search code
<!-- SiteSearch Google -->

</tr>
</table>

Looks like there are two closing tags, is that last </tr> in the template by default? You can do a "View Original" to tell.

works great ..

/me clicks install

venomx
13 Feb 2006, 19:15
I use the Adsense RevShare hack, I dont think I can use this.. I wish I could :(
Nice Mod ericgtr :)

RichieBoy67
13 Feb 2006, 20:00
I am having a strange problem. I add the code to the proper place and my forums become centered. I have no idea what is causing this.


never mind..... Thanks

ericgtr
13 Feb 2006, 23:36
I use the Adsense RevShare hack, I dont think I can use this.. I wish I could :(
Nice Mod ericgtr :)

I haven't looked at the code for that but it might not be too hard to integrate.

venomx
14 Feb 2006, 00:51
Well the revshare hack only works when its shown right below the first users post.. I cant seem to make it work elsewhere.. :(

bizpro
16 May 2006, 06:37
Installed and works great!

shanemcse
19 May 2006, 18:18
I had to remove "</table>" from the Google code to allow "New Posts: and
Todays Posts:" to not get cut off from the drop down menu. Is it OK to remove that from the google code?

</td></tr></table>
</form>
<!-- SiteSearch Google -->

oberheimhaven
20 May 2006, 03:12
guitars 101 lol:banana:

Langly
20 May 2006, 03:45
It works great but how can I remove the vbulletin search and only have the google search there?

Forumdayim.Net
20 May 2006, 14:12
Yes good...Thanks. :)

vBulletin THEN DAYLIGHT
20 May 2006, 21:42
It works great but how can I remove the vbulletin search and only have the google search there?

Remove this:

<tr>
<td class="thead">$vbphrase[search_forums]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<form action="search.php" method="post">
<input type="hidden" name="do" value="process" />
<input type="hidden" name="showposts" value="0" />
<input type="hidden" name="quicksearch" value="1" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="text" class="bginput" name="query" size="25" />&nbsp;$gobutton<br />
</form>
</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td>
</tr>

Langly
21 May 2006, 00:36
Remove it from where? forumhome, postbit, etc?


Remove this:

<tr>
<td class="thead">$vbphrase[search_forums]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<form action="search.php" method="post">
<input type="hidden" name="do" value="process" />
<input type="hidden" name="showposts" value="0" />
<input type="hidden" name="quicksearch" value="1" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="text" class="bginput" name="query" size="25" />&nbsp;$gobutton<br />
</form>
</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td>
</tr>

Kwak
23 May 2006, 21:15
Thank you . INstalled.

StephanieM
02 Jun 2006, 05:00
Thanks for the tip. I have it installed!

camuca
07 Jun 2006, 04:58
Nice idea. thanks

egyptsons
07 Jun 2006, 23:42
installed

libertylounge
26 Jul 2006, 00:04
I'd like to add it to my "Search this Forum" and "Search this Thread" as well

I thought I found where to edit in FORUMDISPLAY, but unfortunately whenever I attempt to search through it, it gripes at me about searching for an invalid user or some such :(

Any help would be appreciated.

nm, fixed it.

hydrazug
08 Aug 2006, 20:02
I emailed google asking them as I've heard you're not supposed to touch their code that you copy paste:

"Thanks for taking the time to clarify AdSense program policies with us. I
understand that you have altered the layout of the search boxes on
http://scatteredgenius.com/cmps_index.php and http://evilzug.com/stuff/ in
order to fit the page, however as you mentioned, these modifications are
against our policies. Please change the boxes back to their original form.

While we understand the importance of maintaining the quality of your site
and your site's user experience, modification of the AdSense for search
code is a violation of the AdSense program policies. We appreciate your
cooperation and understanding in this matter."

Gotta be careful!

For what it's worth, I pulled the search boxes I put up because they didn't fit into my layouts; I've not found a way to fit them in again/yet.

GoTTi
10 Aug 2006, 06:31
got this working for 3.6?

wildo69
13 Aug 2006, 08:29
not sure why, but when i use this in vb 3.6 (RC3) when i enter a search phrase and press enter (or click search) is runs the vb search.php and not the google search. it used to work fine in 3.5

any ideas?

GoTTi
14 Aug 2006, 17:00
i cant get it to show in 3.6

mattyk72
17 Aug 2006, 03:04
not sure why, but when i use this in vb 3.6 (RC3) when i enter a search phrase and press enter (or click search) is runs the vb search.php and not the google search. it used to work fine in 3.5

any ideas?

I'm having the same problem. Any fixes yet?

ericgtr
17 Aug 2006, 04:45
This was written for 3.5.x judging from the posts in here it's not working in 3.6, I will work on an update and bump this when I have something.

GoTTi
21 Aug 2006, 19:10
hows the 3.6 version coming?

ericgtr
21 Aug 2006, 19:30
I just tested it with 3.6 and it works the same. The only thing is in order to make it fit you will have to either tweak the vB code or the Google code due to the size of the input box. Keep in mind that Google's TOS states that you cannot change their code, what you do is up to you on that one. Maybe I will look at changing the default search size to match up, this would be a better alternative.

GoTTi
22 Aug 2006, 11:43
hmm when i tested it i got nothing that worked.

the search for google came up, but it would only search as if it was part of the forum.

GoTTi
02 Sep 2006, 18:22
got a fix on this yet?

KevNJ
04 Sep 2006, 02:29
*clicks install for vb3.6*

getting the wide google search but i can live with it. hopefully there will be a fix though.

curriertech
07 Sep 2006, 17:39
/me clicks installl & waits for 3.6 version.

Nathan2006
12 Sep 2006, 10:09
Thank you ericgtr

Works and looks great! :)

Install

Fusion2
31 Oct 2006, 02:57
I followed this process and it added the Google Search to my vBulletin Search.

But, when i try to search by it, it goes immediately to my vBulletin Search Forums and gives me an error message of "Please specify some words or valid user names to search on. There were no matches for those that you specified."

What could be the issue?

Chris-777
01 Nov 2006, 00:53
/me clicks install

Ohh-Dutch
06 Nov 2006, 22:30
To Fix The Width, Or Make It Look Cleaner, Search For This Code Directly Above The Google Code...
<input type="text" class="bginput" name="query" size="20" />&nbsp;$gobutton<br />

Replace It With This:
<input type="text" class="bginput" name="query" size="33" />&nbsp;$gobutton<br />

Tell Me If That Makes It Look Cleaner To You... If Not Change The size="33" To Whatever Number Fits... Mine Worked With Me Adding A <br> After The Google Image...

Heres A Screenie....

Ohh-Dutch
09 Nov 2006, 06:15
Is That Working For Anybody?

neverknow1
16 Nov 2006, 06:38
I followed this process and it added the Google Search to my vBulletin Search.

But, when i try to search by it, it goes immediately to my vBulletin Search Forums and gives me an error message of "Please specify some words or valid user names to search on. There were no matches for those that you specified."

What could be the issue?

yes.. it is a good one... i have just installed.. thank you for the hack...

:up: :cool:

BUT ... I do face the same problem with Fusion 2... refer to my attachment.

:confused:

Ohh-Dutch
16 Nov 2006, 18:16
yes.. it is a good one... i have just installed.. thank you for the hack...

:up: :cool:

BUT ... I do face the same problem with Fusion 2... refer to my attachment.

:confused:



Try Going Through The Steps Again, it Works Fine For Me....

fabianv
10 Dec 2006, 04:18
Yeah same problem as everyone with the mod searching the site and not google.. pity..

oh well.. *bump* :P

Lee A Burnett
10 Dec 2006, 21:22
Use the 3.6 template mod: http://www.vbulletin.org/forum/showthread.php?t=128274&highlight=google

It has to do with the <form action> call outside the dropdown table. The 3.6 mod resolves that issue.

BigJimTheLug
06 Jan 2007, 00:27
I used this mod and now my forum's "GO" button on the search menu does not work. How can I fix it? Thanks.

josepheseven
18 Aug 2007, 13:32
very nice and simple.....was looking for this ..... saw some others but they are really messy !

thanks for this ;)

works fine on 3.6.8

To Fix The Width, Or Make It Look Cleaner, Search For This Code Directly Above The Google Code...
<input type="text" class="bginput" name="query" size="20" />&nbsp;$gobutton<br />

Replace It With This:
<input type="text" class="bginput" name="query" size="33" />&nbsp;$gobutton<br />

Tell Me If That Makes It Look Cleaner To You... If Not Change The size="33" To Whatever Number Fits... Mine Worked With Me Adding A <br> After The Google Image...

Heres A Screenie....

thanks to u also....this helped me to make it better :)

alishahbazi
13 Jan 2009, 14:01
hi
whats this code for add search in menu for vbulletin 3.8.0 ???