PDA

View Full Version : vB Google Adsense for Search plus Integration


davidw
14 Aug 2007, 12:02
Since the hooks came out in the navigation bar, I had been working on a new release as seen in my previous modification. I have recently pushed myself to finish this hack but I have plans for addons to it :).

This is under the assumption you have your key information:
1) Your pub
(your pub ID/property information - usually starts with pub- and then some numbers)
2) Your cof usually found in your adsense code here:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


This example is what I am using and what a lot of others are using:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Step 1:
Upload searchresults.php to your site's root.
Example: http://www.yoursite.com/searchresults.php

Step 2:
Install the product
Go to Admincp => Plugins & Products => Manage Products => [Add/Import Product] => Browse for product-davidw_vb_google_search.xml => Import

Step 3:
Configure your Admincp options
Go to Admincp => vBullitin Options => vBulletin Options => Find vB Google Search (Adsense) then click [Edit Settings]
Edit your Pub ID, Cof, and your desired width of the iframe for your results. I use 800 in the screenshot, but you can change this based on your needs.

Step 4:
If you are using Version 1.2 1.3, or higher you must edit (or at least check) the searchresults.php to ensure it is correct for your site.

vBAdvanced Optional
Step 5:
Go to Admincp => vBA CMPS => Default Settings => Under Options Portal Output Global Variables
Add (or make sure they are present) these varaiables:
template_hook
google_navadsearch
google_label_site
google_label_web
homeurl

Step 6:
Click on Edit Modules. Click on Search Forums (module).
Under Module Tools, find Select Action (very top) and choose Copy.

In your new (copy) of the Search Forums Module, change the name of your module to whatever you want (I chose "Search").
Under the Template Module Options heading, edit the adv_portal_ area.
Change it from search to search_google

Next,
Under Module Shell Template Options, in the Form Code box,
Change


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


To


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


Make sure this URL is the correct full path to your searchresults.php file.


LEGACY VERSION - Applies to vb_google_legacy_1_2.zip vb_google_legacy_1_3.zip(or higher) only
- Very similar to Version 1.2 1.3 and higher except instead of using a hook this will work for previous 3.6 versions (should work with any 3.6 version).
-- -- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Navigation / Breadcrumb Templates => navbar => find


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Add, under $google_navadsearch
-- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Search Templates => search_forums => under $navbar, add $google_siteadsearch

Also, you must ensure that $google_navadsearch does not go in between <form> tags. If your navbar is a modified old-style template, you will have an extended <form> section. Make changes similar to this...
change this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


to


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


and change


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


to


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Changelog
Version 1.4
- Added support for vBAdvanced module (rather than going to my hack on vBAdvanced.com)

Version 1.3
- Added missing template cache plugins from XML file (had the template cache in the file, just lost it along the way in the XML).

Version 1.2
- Allows you to put your searchresults.php file in any directory, but you must edit the path in the searchresults.php file to the location of searchresults.php.
- Removed unnecessary xml information.
- Fixed a small bug in the product
- Added search.php functionality :)
-- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Search Templates => search_forums => under $navbar, add $google_siteadsearch
- Set default values so that it is easier to configure. You must still edit these values.

Version 1.1
- Change default "site" to your site's name or put a link to a small logo there.
- Change default "web" to "Google" or put their logo in there.


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

This is their logo if you don't have it.
- Only added the ability to allow you to easily add your own logos or change the text from the admincp.

Version 1.0
- Original

davidw
14 Aug 2007, 12:05
I have a manual limited version of this here: http://www.vbulletin.org/forum/showthread.php?t=128274

projectego
14 Aug 2007, 12:19
/me clicks install :D

alqloob alsahya
14 Aug 2007, 14:14
god jop nice :)

davidw
14 Aug 2007, 14:52
Edit: Updated the product - one of the templates had a typo.

Zaiaku
14 Aug 2007, 19:56
Excellent mod!

Chester87
14 Aug 2007, 19:59
Verry nice mod.

iogames
14 Aug 2007, 20:44
If it's a 'DAVIDW' I'll install it!
Can you add the Google Logo or the option for Own logo?

United32
14 Aug 2007, 20:47
Thank you very much! And for integration, wow.... :up:

MOTM, definately! :)

davidw
14 Aug 2007, 23:13
If it's a 'DAVIDW' I'll install it!
Can you add the Google Logo or the option for Own logo?Where did you have in mind?

Thank you very much! And for integration, wow.... :up:

MOTM, definately! :)Actually, I'm not even done yet. I'm going to be adding more :)

davidw
15 Aug 2007, 11:39
I have added an optional new 1.1 version that allows anyone to change the choices by the radio buttons to logos (images) if they so desire :) - and I have supplied the link to the default logo above.

Zaiaku
17 Aug 2007, 22:50
Is there a templete edit that needs to be done? I installed it and its not appearing in the dropdown search menu.

JMH11788
18 Aug 2007, 18:31
Is there a templete edit that needs to be done? I installed it and its not appearing in the dropdown search menu.

well the navbar hook is gone now so that is why you dont see it.

davidw
20 Aug 2007, 02:31
You should have

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

in your navbar, if you don't - this will not work.

Search for

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

and look a couple rows above:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


Your navbar may differ a little - this is where the hook resides:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



If you do not have that hook in there, you must edit your navbar and place that hook in there to use this modification. If you still can't get this version to work, here is a manual but limited version - http://www.vbulletin.org/forum/showthread.php?t=128274

AquilaEagle
20 Aug 2007, 18:59
I've installed and it is appearing in my Nav Bar, but when i actually do a search I just get a blank screen?? it's not going to google, it's going to some page on my site??

Help please?

AquilaEagle
20 Aug 2007, 21:31
Double checked everything, and re-installed it. Still not working. It seems to go to searchresults.php but with a load of code on the end of the url, just showing a blank page. I've followed the instructions word for word. No worky. :(

davidw
20 Aug 2007, 23:26
Ok, here's a possible manual fix for boards like this. I will work on an update later with a final working result.

Upload searchresults.php to your forum directory (since that is where it is appearing - It looks like a redirect somehow).

Then reimport this attached product (based on version 1.1)

davidw
21 Aug 2007, 03:40
Also, try this special searchresults.php file I created. You will need to edit line 8


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

and put your forum's path in there for this to work. I have it working on my site (tested it). I created a dummy directory called forums that only has the one file in it. Let me know how it works for you.

AquilaEagle
21 Aug 2007, 18:41
Ok, here's a possible manual fix for boards like this. I will work on an update later with a final working result.

Upload searchresults.php to your forum directory (since that is where it is appearing - It looks like a redirect somehow).

Then reimport this attached product (based on version 1.1)Thanks david. I have done this and it seems to half work, I did a search but I get a blank result. I get the Google search results page, but it is empty of any results.

AquilaEagle
21 Aug 2007, 19:58
Also. the dropdown only appears for members, not for guests - any way I can change that?

Irfan Faruki
23 Aug 2007, 19:16
Thanks david. I have done this and it seems to half work, I did a search but I get a blank result. I get the Google search results page, but it is empty of any results.

I am having the same problem.. Any ideas ?

davidw
23 Aug 2007, 23:59
How is your forum set up? Is it behind /forums/? Can you PM me the info? Btw, don't forget to click install.

Riccardo83
27 Aug 2007, 04:57
I dont get it working either on alizee-forum.com

It shows the searchresult.php correctly with theme. It also says

Your Google Search Results

but there is nothing underneath, footer and header work...

davidw
27 Aug 2007, 11:34
The searchresults.php is in its correct location. If you used any version other than the initial 1.0 (especially the one in the thread here alone), you must go to your admincp and enter your information in there.

Step 3:
Configure your Admincp options
Go to Admincp => vBullitin Options => vBulletin Options => Find vB Google Search (Adsense) then click [Edit Settings]

If you don't, you will get exactly what you see.

Don't forget to click install.

Riccardo83
27 Aug 2007, 12:30
i entered all information....

it still doesnt work....

GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:00 00FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1

and my pub google code.. logo as well....

please help me what could it be, 700 is iframe width, could it be that my galt is wrong?

AquilaEagle
27 Aug 2007, 14:15
I dont get it working either on alizee-forum.com

It shows the searchresult.php correctly with theme. It also says

Your Google Search Results

but there is nothing underneath, footer and header work...
This is what is happening on mine now.

All my info is in the adminCP too. I've not managed to catch you to help yet david.

Also it only appears for registered users, can I change it so everyone sees it in the menu?

Riccardo83
27 Aug 2007, 19:49
Hope this is gonna be fixed soon.

Also a suggestion would be, to have this search available for guests, but not letting them use the forum search engine.

Brings more adsense visits and reduces serverload.

davidw
28 Aug 2007, 01:06
I've added version 1.2 (at the top). I've fixed a few things and hopefully this will fix the problem. I noticed a couple possible issues that weren't being reported but might be related to what you two are seeing. You may want to uninstall the product and import the new 1.2 product, and overwrite the searchresults.php file after making the necessary changes to it. Let me know how this works.

Riccardo83
28 Aug 2007, 05:02
im afraid to say i still dont see any search results... ?

maybe anytyhing wrong with my google settings?

Although the sourcecode of the page shows



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Riccardo83
28 Aug 2007, 05:07
also, i like the way u have it on ur forum, but u dont use searchresults.php or so?

davidw
28 Aug 2007, 11:21
I do use the searchresults.php (otherwise this wouldn't work). I am also using 1.2 version as well.

Riccardo83
28 Aug 2007, 11:26
ok, i added u on msn, but ur not online. i would really love to get this working.

AquilaEagle
28 Aug 2007, 19:08
I'm still getting a blank results page with v1.2 - completely uninstalled and re-installed. edited the searchresults.php file, and it is in /forum/

69197

Zaiaku
28 Aug 2007, 20:47
To bad this doesn't work on all versions of 36x. I really don't want to have to upgrade my other forum to add this to it.

davidw
29 Aug 2007, 02:20
Give me a day or two and I'll see if I can find a script to work around the hook for earlier versions.

Riccardo83
29 Aug 2007, 02:28
But first we should get it working at all for 3.6.8 ? Any news why AquilaEagle and me dont get it working?

davidw
29 Aug 2007, 02:29
This version (for earlier versions) should also help you and AquilaEagle out as well. It should be released tomorrow.

Riccardo83
29 Aug 2007, 02:59
Great, thanks mate for helping me u got it working. Apparently guys double check ur Galt code as well!

WarLion
29 Aug 2007, 21:00
i have the samee result im install this mod pretty good BTW but with no result only the searchresults.php in blank

i hope you can tell me whats is wrong thanks for this cool mod

edit

ifinally maake it work you the only thing i edit is the template "google_navadsearch"

i change a few lines not to much i just see the original code from google adsense and add a few lines



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


this is a code for mexican or spanish webs the las red text es (espaņol) if you are from us change to en (english)
the rest you can leavee just like that is a hidden text

also in vB Google Search (Adsense) option on Your Forum's Path i only put the name of the php n this case searchresults.php cuz you are already in your domine if you put all the adress the resul migth bee
http://yoursite.com/forum/searchresult.phphttp://wwwyoursite......,
and also in the searchresults.php on the line 8 i change the path and thats all i need now is working now thankts for you mod is soo cool

i know this is almost equal to the one from davidw i dont know what i did the only this s woring now dot ask i donīt know what i did

and also i add class to button and textfield you can change it to fit your sikin

sorry for my english mexican here

davidw
29 Aug 2007, 23:28
To bad this doesn't work on all versions of 36x. I really don't want to have to upgrade my other forum to add this to it.Added a release to the list that should help you out. :)

davidw
29 Aug 2007, 23:33
also in vB Google Search (Adsense) option on Your Forum's Path i only put the name of the php n this case searchresults.php cuz you are already in your domine if you put all the adress the resul migth bee
http://yoursite.com/forum/searchresult.phphttp://wwwyoursite......,
and also in the searchresults.php on the line 8 i change the path and thats all i need now is working now thankts for you mod is soo cool

i know this is almost equal to the one from davidw i dont know what i did the only this s woring now dot ask i donīt know what i did

and also i add class to button and textfield you can change it to fit your sikin

sorry for my english mexican hereGlad that it is working for you. The reason I have the forum path to show the full from http:// to ... .php is because of

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

However, this is mainly aimed at those who have their searchresults.php located in a different directory other than the root location. Otherwise searchresults.php or ./searchresults.php should work just fine. Don't forget to click install :)

AquilaEagle
30 Aug 2007, 19:14
Mine is working now, thanks to david for his help -my GALT number had a character missing at the end :)

djbaxter
30 Aug 2007, 20:18
I'm still getting a blank results page with v1.2 - completely uninstalled and re-installed. edited the searchresults.php file, and it is in /forum/


Same problem here. I've tried both versions - same issue. Double checked the GALT and pub codes. Both look OK.

davidw
30 Aug 2007, 23:56
What do you have for your GALT and what do you have for "Your Forum's Path" in the AdminCP?

The example I use, which a lot of people have, is this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

djbaxter
31 Aug 2007, 00:11
GALT:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Path:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

davidw
31 Aug 2007, 00:14
Change your galt to what I have (previous post) and test that.

Also try it with these forum paths


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


and your original.

djbaxter
31 Aug 2007, 00:15
OK. I don't know exactly why but it is a GALT problem. I took mine from the code Google gave me. I just substituted your string instead and if I use yours, it works.

Is the GALT string unique to a specific publisher? Or can I use yours as a generic string?

davidw
31 Aug 2007, 00:20
Mine is generic. You can play with the hex codes and see the different outcomes, but the one I supply is generic for multiple use. The one that google supplies a lot of times is specifically for one specific purpose (notice it has your domain in the GALT) and not meant to be altered cosmetically (breaks it).

djbaxter
31 Aug 2007, 01:12
Thanks, David. Working fine now. :)

forte
01 Sep 2007, 00:13
Is it possible to have a different cof code for each skin? Since it doesnt blend well with my other skin.

WarLion
01 Sep 2007, 00:28
is any posible way to integrate to vbadvance workk like a charm in the forum but in my index is not show any idea?

davidw
01 Sep 2007, 00:50
is any posible way to integrate to vbadvance workk like a charm in the forum but in my index is not show any idea?
I'm looking into a navigation bar solution for that myself, however, in the meantime, I have this (at vbadvanced) that works nicely for users (it's also what I've used since I wrote it)... http://www.vbadvanced.com/forum/showthread.php?p=82852

davidw
01 Sep 2007, 01:00
Is it possible to have a different cof code for each skin? Since it doesnt blend well with my other skin.

Yes, it is entirely possible. I'm not sure if it is probable though.

What you'd have to do is go into each template (for each child style or alternate style)

Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => google Templates => google_navadsearch =>
Find:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


Replace with:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



You'll also want to do this for google_siteadsearch as well.

This should work. I am not 100% because I've not tested it, but in theory it makes sense.

toucan42
01 Sep 2007, 02:19
I am confused by your instructions as to template edits. I have uploaded the xml and I am looking at the navbar template - what exactly do I need to add/change in my templates?

Changelog
LEGACY VERSION - Applies to vb_google_legacy_1_2.zip only
- Very similar to Version 1.2 except instead of using a hook this will work for previous 3.6 versions (should work with any 3.6 version).
-- -- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Navigation / Breadcrumb Templates => navbar => find
Code:

$vbphrase[advanced_search]</a></td>
</tr>

Add, under $google_navadsearch
-- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Search Templates => search_forums => under $navbar, add $google_siteadsearch


This is just confusing to me. Sorry =/

toucan42
01 Sep 2007, 02:30
OK I added $google_siteadsearch under $navbar in the search_forums template and now I get the integration into the advanced search page.

The results page, however, throws the following error:
Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/talkwhat/public_html/searchresults.php on line 8

Also it is not showing in the dropdown on the navbar though I added "$google_navadsearch"

toucan42
01 Sep 2007, 02:56
OOPS - I fixed the line 8 issue - still can't figure out how to get this integrated into the dropdown, though. Anyone?

davidw
01 Sep 2007, 04:45
By default you shouldn't have to change anything in the templates. The only thing you should have to edit is in the admincp options. What version of vb do you have? If you are using the legacy version and you have follow the instructions and you are showing the searchresults.php page correctly (without results) when you go to http://www.. ..com/searchresults.php but it is not showing up at all in the drop-down then there is a very good chance that another hack is interfering with this one. This is possible.

I will be back on Monday.

WarLion
01 Sep 2007, 05:16
I'm looking into a navigation bar solution for that myself, however, in the meantime, I have this (at vbadvanced) that works nicely for users (it's also what I've used since I wrote it)... http://www.vbadvanced.com/forum/showthread.php?p=82852
thanks dvidw i will try

forte
01 Sep 2007, 05:19
Yes, it is entirely possible. I'm not sure if it is probable though.

What you'd have to do is go into each template (for each child style or alternate style)

Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => google Templates => google_navadsearch =>
Find:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


Replace with:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



You'll also want to do this for google_siteadsearch as well.

This should work. I am not 100% because I've not tested it, but in theory it makes sense.

It works. Thanks a lot!:D

iogames
07 Sep 2007, 02:23
Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/iogamesc/public_html/searchresults.php on line 8

Warning: main(./global.php) [function.main]: failed to open stream: No such file or directory in /home/iogamesc/public_html/searchresults.php on line 19

Fatal error: main() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/iogamesc/public_html/searchresults.php on line 19

:(

djbaxter
07 Sep 2007, 06:09
Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/iogamesc/public_html/searchresults.php on line 8

Warning: main(./global.php) [function.main]: failed to open stream: No such file or directory in /home/iogamesc/public_html/searchresults.php on line 19

Fatal error: main() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/iogamesc/public_html/searchresults.php on line 19

iogames, I suspect you need to correct the file path in file searchresults.php

From your errors above, it seems that line 8 reads



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



However, your forum is at a subdomain:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



My guess is you need to edit line 8 in searchresults.php to read as follows:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Try that. If it doesn't work, email me.

davidw
09 Sep 2007, 12:19
iogames, any news?

djbaxter
09 Sep 2007, 14:05
iogames, any news?

Yes. We continued the discussion via PM and email. The fix I suggested worked, although he also seems to have a conflict with another plugin he's using - vBMailer, I believe. He was going to get on to vBMAiler support to try to fix that.

davidw
09 Sep 2007, 19:48
I am going to be working on a newer version that, if successful, lets you have full and complete control on the CSS of the outcome.

If anyone has any requests or ideas of what they'd like to see in future releases, let me know - this mod has much potential :)

JayT123
11 Sep 2007, 12:03
Anyway to change the frame height? I have tons of white space after the results. I tried adding an FrameHeight var but that doesn't work.

davidw
11 Sep 2007, 23:14
Unfortunately, no - I have tried this myself and have found that adding a height value will not work. There are other scripts out there that do not work like this that do have an adjustable height, but I do not know why Google has disallowed it here. However, keep in mind, as soon as I find a way to allow different heights or if there is a change from Google, I will let everyone know.

JayT123
11 Sep 2007, 23:25
What about adding a css for the iframe? Won't that override it?

davidw
11 Sep 2007, 23:48
That's something I've played with, but haven't had any luck.

Theoretically, and its only a theory, an iframe within an iframe would work, but wouldn't necessarily be visually pleasing (its possible), but its a stab.

mdcdeve
29 Sep 2007, 05:31
Hiya, i'm having some problems with 1.2. It works fine from the search.php page but when i use it from the drop down box in the navbar it always says "Please specify some words or valid user names to search on. There were no matches for those that you specified."

davidw
29 Sep 2007, 17:02
That's really weird considering google has nothing to do with the site's search system. Do you have a demo link I can view this on? Also, please don't forget to click install.

mdcdeve
29 Sep 2007, 22:38
That's really weird considering google has nothing to do with the site's search system. Do you have a demo link I can view this on? Also, please don't forget to click install.
Heya, thanks for replying. Heres a link you can check it out at.

user:mod
pass:mod

http://www.mdcdeve.com/forums/
http://www.mdcdeve.com/forums/search.php

davidw
30 Sep 2007, 01:24
Ok, that's really weird - which version of 1.2 are you using? search or legacy? if legacy, can you post a snippet where you've added the code?

dfe
30 Sep 2007, 16:28
I am running 3.6.8., also having a prob with the searchresults file, when trying to search I get the error below.

The file searchresults.php and global.php is in the same directory, both in /forum on the domain.

Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/domain.co.za/httpdocs/searchresults.php on line 16

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='.:') in /var/www/vhosts/domain.co.za/httpdocs/searchresults.php on line 16

davidw
30 Sep 2007, 19:26
Did you edit the searchresults.php file and mark the location in your admincp options?

mdcdeve
30 Sep 2007, 23:01
Ok, that's really weird - which version of 1.2 are you using? search or legacy? if legacy, can you post a snippet where you've added the code?


Hiya, i'm using the legacy version. Here's where i placed the code.

Navbar


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



search_forums


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

dfe
01 Oct 2007, 04:45
Did you edit the searchresults.php file and mark the location in your admincp options?


Hi I think I am missing you somewhere.

I have entered the 3 values in AdminCP for PUB, COF and Frame width.
I placed a copy of the searchresults.php in the same directory as the forum (/forum on my domain), but I noticed now that it was looking for it in root.

I now edited the search results page to change the path for the global.php file to ./forum/global.php but still getting the same error.

You mention "mark the location in AdminCP", how do you mean? Where must this be marked?

SemperFideles
01 Oct 2007, 12:06
I'm sorry but I am extremely confused. The installation instructions for this are very hard to follow and there are a lot of files.

Assuming I want to install version 1.2 on a 3.6.8 site:

1. Which file(s) should I download?
2. Should I generate my own cof information from Adsense?
3. After I've installed and configured the 1.2 site, are there any templates I should modify or is that for the legacy version?

davidw
01 Oct 2007, 12:24
Hi I think I am missing you somewhere.

I have entered the 3 values in AdminCP for PUB, COF and Frame width.
I placed a copy of the searchresults.php in the same directory as the forum (/forum on my domain), but I noticed now that it was looking for it in root.

I now edited the search results page to change the path for the global.php file to ./forum/global.php but still getting the same error.

You mention "mark the location in AdminCP", how do you mean? Where must this be marked?
What version are you using? If you are running 1.2 then the last spot has a URL path to your searchresults.php file - this is for your template (for no template edits). If you are not running 1.2, you may want to download vb_google_search_1_2.zip (3rd option) and install that one. This will allow you to fully use it on forums that are outside of root areas (have /forum or /forums)



I'm sorry but I am extremely confused. The installation instructions for this are very hard to follow and there are a lot of files.

Assuming I want to install version 1.2 on a 3.6.8 site:

1. Which file(s) should I download?
2. Should I generate my own cof information from Adsense?
3. After I've installed and configured the 1.2 site, are there any templates I should modify or is that for the legacy version?
1. If you are running 3.6.8, then you want vb_google_search_1_2.zip (3rd option) - the other is for older versions that do not have the hook locations.
2. You can try generating your own cof information but some have success, other have not. If yours does not work, use what I have supplied, that will work - and you should still be able to play with the hex colors to change it to your desire.
3. The templates to modify are only for the legacy version.

roady89
16 Oct 2007, 16:29
Which version should I install on 3.6.7? I tried 2 different versions. One I got a blank page and the other I got an error 406 page.

roady89
16 Oct 2007, 20:30
I got it to work. The GALT code google is generating does not have two "1" at the end of the code like yours does. Its ony producing one "1" and not two "1"'s. I placed an addition 1 on the end and it works. You can see it here if you wanna check it out. Custom Golf Carts (http://www.buggiesgonewild.com/)

Thanks for the great MOD. Clicked installed.
3.6.7

davidw
16 Oct 2007, 23:26
Good job - I'm usually not on until evenings most of the time so I'm glad you got it sorted out.

yoyoyoyo
01 Nov 2007, 13:20
what do I need to change in the xml in order to remove the site search? I would rather that people use the site search engine, but want to keep the google search plugin-based

davidw
01 Nov 2007, 23:55
If you are referring to the search.php usage, nothing will be done there (or seen) unless you put in the $google_siteadsearch - all it will be is a template. However, if you want to remove it all, just find this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

and this

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

and remove both of those.

Btw, don't forget to click install :)

yoyoyoyo
02 Nov 2007, 02:07
what I was asking is how to make the google search just the www and not your site

davidw
02 Nov 2007, 02:25
oh, take that option out of the templates

Find and remove:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


and


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


you could also remove both instances of


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

but that's up to you

yoyoyoyo
02 Nov 2007, 05:04
ok thanks much!

on another note, microstats is showing this:
Uncached templates: google_navadsearch (1)
Uncached templates: google_siteadsearch (1)

how do I fix that?

davidw
02 Nov 2007, 12:07
That's weird - let me look into that tonight.

davidw
03 Nov 2007, 00:50
For some reason when I started on this project, I omitted it, this is the missing plugin -



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

I will upload an update later.

davidw
03 Nov 2007, 01:19
Ok, latest and greatest has been uploaded :) (I won't send an update since the version difference is negligible.)

psychotronic
03 Nov 2007, 03:51
dear david
the $google_navadsearch i put on the navbar template
but just show on on forum page..
i use vBadvanced CMPS but they not showing up on the navbar
do i miss something?

thanks before

davidw
03 Nov 2007, 04:02
That is something I'm still working on as well - I'm having an issue with the navbar in vbadvanced with a few items that use hooks.

yoyoyoyo
03 Nov 2007, 04:53
thanks for the update

psychotronic
03 Nov 2007, 12:30
That is something I'm still working on as well - I'm having an issue with the navbar in vbadvanced with a few items that use hooks.


I found it david..

- Admin CP> vBa CMPS > Default Settings> Main Options>
- Under the 'Portal Output Global Variables' setting you will need to add "google_navadsearch"

and.. voilaaaa.. they show up!!!!

davidw
03 Nov 2007, 13:49
That's funny - I've already put it there - I may have misspelled it on my site though. Thanks for looking into that. :)

davidw
03 Nov 2007, 13:50
thanks for the updateNo problem - it should have been there in the first place ;) - I'm surprised it wasn't brought up sooner, tbh.

powerful_rogue
06 Nov 2007, 15:09
Hi,

Kind of managed to get it working!

If you search via the drop down box (google or my site) it comes back with the following error:

1. Please specify some words or valid user names to search on. There were no matches for those that you specified.

However, If I search via the search.php page it works fine!

Any sugegstions at all?

powerful_rogue
06 Nov 2007, 20:50
One more question!

Would it be possible to create a vbadvance module that shows the google search box? When people search using it they are then taken to the searchresults.php page. Ive tried to have a play around but could seem to get it to work.

davidw
06 Nov 2007, 23:26
I actually have a vbadvanced version at vbadvanced.com (I guess I could release it here).

http://www.vbadvanced.com/forum/showthread.php?p=82852 and also post 3 - I've not updated it in a while but is still usable (just needing a couple modifications to it).

davidw
06 Nov 2007, 23:31
Hi,

Kind of managed to get it working!

If you search via the drop down box (google or my site) it comes back with the following error:

1. Please specify some words or valid user names to search on. There were no matches for those that you specified.

However, If I search via the search.php page it works fine!

Any sugegstions at all?Can you tell me your website so I can see what is going on?

powerful_rogue
06 Nov 2007, 23:33
Hi,

Thanks for the reply :)

My site is www.DoverLocals.co.uk

Also without wishing to be a pain, is there anyway to reduce the amount of space after the results. Ive attached an image to show you.

Thanks

Dave

davidw
06 Nov 2007, 23:59
As far as the "whitespace" below the results, that can't (currently) be altered at the moment due to the code Google supplied (unalterable iframe height). However, I am always on the lookout for new code so that this can be improved.

Looking at your site, you are using a version of vB that may not take full advantage of the full version of the code (as I have noticed with another member who had a similar issue as you). After looking into it, it was discovered that the legacy version worked best.

Which version are you using? Have you tried using the legacy version?

powerful_rogue
07 Nov 2007, 11:40
Im currently using the 1.3 legacy version. I also made all the alterations in the first post.

davidw
07 Nov 2007, 11:59
Can you PM me the section of code that pertains to this in your navbar? Also a temp login account to see what is going on as clicking on search just takes me to search.php. I will be back tonight (I work during the days).

oldengine
07 Nov 2007, 21:27
I notice in your screen shot that the Google results are crowded up against the left hand side of the white background. I think that the previous hack by someone else did this also, but is there any margin value capability? Maybe an extra white table around it?

Great hack by the way! I just installed it and after adding an extra 1 to the GALT it works. With only 1 as in my google code, it returns an empty result screen.

I am on 3.6.8 and it's also working on the current versions of PhotoPost vBGallery and vBAdvanced Links.

Does anyone know the reason for GAULT 1 or 11 ?

davidw
08 Nov 2007, 23:28
I notice in your screen shot that the Google results are crowded up against the left hand side of the white background. I think that the previous hack by someone else did this also, but is there any margin value capability? Maybe an extra white table around it?That's something that is currently out of my control as it is set in an iFrame controlled by Google. Hopefully in a later release, that can be fixed.

Great hack by the way! I just installed it and after adding an extra 1 to the GALT it works. With only 1 as in my google code, it returns an empty result screen.

I am on 3.6.8 and it's also working on the current versions of PhotoPost vBGallery and vBAdvanced Links.

Does anyone know the reason for GAULT 1 or 11 ?I'm not sure, but I think the difference between the 1 and the 11 is how the code is processed.

I do appreciate the compliments. In the future I will add more flexibility in a phase-in/phase-out period as I did with previous versions.

powerful_rogue
09 Nov 2007, 18:11
I actually have a vbadvanced version at vbadvanced.com (I guess I could release it here).

http://www.vbadvanced.com/forum/showthread.php?p=82852 and also post 3 - I've not updated it in a while but is still usable (just needing a couple modifications to it).

Ive installed this module and it works a treat :)

Is there anyway though for it to bring up the results in the searchresults.php page?

Raffaele
09 Nov 2007, 20:07
Hi David,

i got the pub but where do you get the GALT at the adsence site??

Thank you for the help
RV

powerful_rogue
09 Nov 2007, 20:27
Once google has generated the search code - you can locate the GALT in that.

davidw
09 Nov 2007, 22:55
Ive installed this module and it works a treat :)

Is there anyway though for it to bring up the results in the searchresults.php page?
Not in the current form, but I am going to be working on a new version - that module will work on any version of vb (which is what it was intended for). I will post something when I have it created.

davidw
09 Nov 2007, 22:57
Hi David,

i got the pub but where do you get the GALT at the adsence site??

Thank you for the help
RV

If you don't find the GALT you can use what I have at the top of the thread.

Don't forget to click Install :)

powerful_rogue
09 Nov 2007, 23:53
Not in the current form, but I am going to be working on a new version - that module will work on any version of vb (which is what it was intended for). I will post something when I have it created.

Superb. Cant wait for it to be released. For the time being, is there anyway the page can be edited so a logo or such like shows up?

davidw
10 Nov 2007, 00:50
Let me see what I can do
temporarily try this...
change the vba template from


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


to


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


and [from step 3 of the adsense.txt file] change


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


to


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


This should technically work, but I've not tested it

Remember make a backup of what you have before changing anything. Of course, you will also need to add any variables to the admincp just like in this post. http://www.vbulletin.org/forum/showpost.php?p=1374757&postcount=93

The_Gun_Man
10 Nov 2007, 02:33
Is there any reason why the

vbulletin3_logo_white.gif
navbits_finallink_ltr.gif
navbits_start.gif

Don't showup on the search results page? I've tried both versions and the same results. I have the default skin.

davidw
10 Nov 2007, 03:10
No, they should show up. I am pulling $header and $navbar - do you have a link to your site I can view?

Btw, don't forget to click Install :)

powerful_rogue
10 Nov 2007, 09:25
Let me see what I can do
temporarily try this...
change the vba template from


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


to


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


and [from step 3 of the adsense.txt file] change


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


to


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


This should technically work, but I've not tested it

Remember make a backup of what you have before changing anything. Of course, you will also need to add any variables to the admincp just like in this post. http://www.vbulletin.org/forum/showpost.php?p=1374757&postcount=93

Thanks for that, I gave it a go but it threw up loads of errors. Not sure if this was caused by me not adding:

you will also need to add any variables to the admincp as I wasnt sure what I needed to add. Also where does the pub code go?

Was a little bit confused. Thanks anyway

Dave

powerful_rogue
10 Nov 2007, 09:50
One more question without wishing to be pain!

On the normal search where it shows the header - is is possible to have links open in a new tab or actually within the site itself?

davidw
10 Nov 2007, 15:44
The pub is being called from the adminCP - originally the module kept it in a secondary location.
To open in a new page, you would edit this part
<form method="get" action="{$vboptions['google_forum_path']}" target="_top">
and change top to blank.
I may have time to work on this today.

davidw
10 Nov 2007, 16:20
I found it david..

- Admin CP> vBa CMPS > Default Settings> Main Options>
- Under the 'Portal Output Global Variables' setting you will need to add "google_navadsearch"

and.. voilaaaa.. they show up!!!!
Some people may need to add the variable template_hook there as well for it to show up correctly (as that is what I had overlooked).

davidw
10 Nov 2007, 17:18
Ok, I have a working prototype on my site now :)
Edit: I have updated the modification to add the vbadvanced (version 1.4).

powerful_rogue
10 Nov 2007, 20:54
Thanks for the update :D

Ive got it all installed, however one problem with the vbadvance module. When I hit search, it takes me to the searchresults.php page, however this is blank.

Is the same for searching the site and searching google, however it works fine when searching via the dropdown navbar.

davidw
10 Nov 2007, 20:59
That's weird - as I have it working as such on my own site and it displays results.
Edit - try reverting your adv_portal_ template if you used the 1.4 version.
All the information is stored in the new template and the old template takes you to blank results.

powerful_rogue
10 Nov 2007, 21:03
That's weird - as I have it working as such on my own site and it displays results.
Edit - try reverting your adv_portal_ template if you used the 1.4 version.

Sorry David, lost me on that one :erm:

I started from scratch on the VBA module and followed these steps:

Step 5:
Go to Admincp => vBA CMPS => Default Settings => Under Options Portal Output Global Variables
Add (or make sure they are present) these varaiables:
template_hook
google_navadsearch
google_label_site
google_label_web
homeurl

Step 6:
Click on Edit Modules. Click on Search Forums (module).
Under Module Tools, find Select Action (very top) and choose Copy.

In your new (copy) of the Search Forums Module, change the name of your module to whatever you want (I chose "Search").
Under the Template Module Options heading, edit the adv_portal_ area.
Change it from search to search_google

Next,
Under Module Shell Template Options, in the Form Code box,
Change
Code:

<form action="{$vbulletin->options[bburl]}/search.php" method="post" name="search"> <input name="s" type="hidden" value="" /> <input name="do" type="hidden"

value="process" /> <input name="sortby" type="hidden" value="lastpost" /> <input name="forumchoice" type="hidden" value="0" />

To
Code:

<form method="get" action="http://www.yoursite.com/searchresults.php" type="hidden" name="search" target="_blank">

Make sure this URL is the correct full path to your searchresults.php file.

davidw
10 Nov 2007, 21:27
You have the old style vba module, not the new one (from the template in 1.4). The Go button should be to the right of the text box.
This is what it should look like:

powerful_rogue
10 Nov 2007, 21:30
You have the old style vba module, not the new one (from the template in 1.4). The Go button should be to the right of the text box.

Ah right. How do I get the new template. I imported the new xml file for the mod, however at the time I still had the old vba search mod.

davidw
10 Nov 2007, 21:35
click on the old template you created and on the right side click Revert
The new template (that is created from the XML) will show up under vBadvanced CMPS Templates

powerful_rogue
10 Nov 2007, 21:39
click on the old template you created and on the right side click Revert
The new template (that is created from the XML) will show up under vBadvanced CMPS Templates

Superb! Thank you :D

One more question, now ive reverted the template, the VBA box is a bit wider then before - is there an easy way to edit the width?

davidw
10 Nov 2007, 21:50
Yes, you can either edit the XML and reupload so that nothing has to be reverted later if changers are to be made, or edit the template.

Either way, in the template in your styles (or in the XML) find this:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

and change the size="21" to whatever shorter size fits. 21 is what I use on my site. In the future I may make that an adminCP variable.

powerful_rogue
10 Nov 2007, 21:56
Fantastic :D

Thank you very much for all your support. This really is a fantatsic mod with excellent support. Nominated for MOTM

davidw
10 Nov 2007, 22:00
Thank you - but to be honest, I can only support it when I'm available (usually evenings and most weekends).

oldengine
13 Nov 2007, 17:07
Has anyone come up with a way to provide this Google site search to unregistered users, but NOT give them access to the general vBulletin search tool?

(admin - usergroup manager - Can Search Forums NO)

In other words, let Google do the work for unregistered users and save our server load.

davidw
13 Nov 2007, 22:00
Hmm, interesting - I'll have to look into that.

oldengine
14 Nov 2007, 16:17
After trying the above for a bit, I have turned my vBulletin search back on for unregistered users and I switched to the Fulltext search engine. I use the captcha for general searches and I link to the really popular "Todays Posts" from my front page.

Google search results are not totally impressive on my site. I think they are blocking "common words" and in my case, "famous" is not a common word - it's the brand name for a popular piece of equipment. My Google site: results return 166,000 pages and of course no one but Google will shape the order of those listings.

Keeping server load down and keeping new readers doesn't quite mix. If I put VBSEO on, the load will go up for that too. Anyway, enough of me, I still think this is a valuable hack. Combining vB search and Google search will cover all the bases.

davidw
15 Nov 2007, 02:13
I wanted to integrate this even further but there were a few restrictions with forms that prevented me from doing so. However, I am all for more ideas on adding to this :)

tom209
18 Nov 2007, 12:39
Hi

Thank you for the extension.

Unfortunately, I have noticed that it Firefox works with Internet Explorer


Does anybody have a solution?

THANKS

davidw
18 Nov 2007, 13:57
Unfortunately, I have noticed that it Firefox works with Internet Explorer What do you mean?

tom209
18 Nov 2007, 22:10
Hi

I had this problem with Internet Explorer is not Google appears when I click on the Search button, but when I use Firefox to search everything will click.

Example:

So it is with Internet Explorer appears when I click on the Search:

http://www.pcwango.de/test/ie.png

So it is with Firefox when I click on the Search:

http://www.pcwango.de/test/fi.png


Do you have a solution?

THANKS

davidw
18 Nov 2007, 22:38
Have you tried logging out, clearing you cookies, and clearing your cache in Internet Explorer - then logging back in?

tom209
19 Nov 2007, 00:05
Hello

Yes, I have. I have even tested three different computers. One was even a Vista with Internet Explorer 7th But unfortunately, is the same.
I even thought maybe this is only when I am connected. Unfortunately the same

I do not know why

davidw
19 Nov 2007, 00:56
Do you have a way for me to look at this at your site? I am curious as why your site does not work, while others do.

popowich
14 Jan 2008, 16:16
How can I remove the vBulletin search and only have the Google powered searches?

Is it possible to have this be the search tool that guests are presented with?

-Raymond

davidw
15 Jan 2008, 00:35
Are you using the regular version or the legacy version? Also, which location are you wanting to set the google for guests? If it is just the navigation bar, one thing you can try is going to your navbar template and finding this


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


and replace with this


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


if you just only want to hide everything from guests, but show it to everyone else, this should work (but I've not tested it).


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Where it says 5,6,7 add all the usergroups you want to use there.

chevy01xtreme
27 Jan 2008, 05:36
i am lost on how to install this. i am running 3.6.8 pl2

davidw
27 Jan 2008, 14:16
As long as you are running 3.6.8 or higher, you can use vb google search 1 4.zip rather than the legacy version.

Simplified instructions:
Step 1:
Open up searchresults.php and edit the location to where you will upload it (preferably to the site's root location)
Upload searchresults.phpt.
Example: http://www.yoursite.com/searchresults.php

Step 2:
Install the product
Go to Admincp => Plugins & Products => Manage Products => [Add/Import Product] => Browse for product-davidw_vb_google_search.xml => Import

Step 3:
Configure your Admincp options
Go to Admincp => vBullitin Options => vBulletin Options => Find vB Google Search (Adsense) then click [Edit Settings]
Edit your Pub ID, Cof, and your desired width of the iframe for your results. I use 800 in the screenshot, but you can change this based on your needs.
This information is located at the top of each of these threads.

Don't forget to click install for support. If you are still having issues, PM me and I will help you out as best as I can.

chevy01xtreme
27 Jan 2008, 17:55
As long as you are running 3.6.8 or higher, you can use vb google search 1 4.zip rather than the legacy version.

Simplified instructions:
Step 1:
Open up searchresults.php and edit the location to where you will upload it (preferably to the site's root location)
Upload searchresults.phpt.
Example: http://www.yoursite.com/searchresults.php

Step 2:
Install the product
Go to Admincp => Plugins & Products => Manage Products => [Add/Import Product] => Browse for product-davidw_vb_google_search.xml => Import

Step 3:
Configure your Admincp options
Go to Admincp => vBullitin Options => vBulletin Options => Find vB Google Search (Adsense) then click [Edit Settings]
Edit your Pub ID, Cof, and your desired width of the iframe for your results. I use 800 in the screenshot, but you can change this based on your needs.
This information is located at the top of each of these threads.

Don't forget to click install for support. If you are still having issues, PM me and I will help you out as best as I can.
ok done this. how do i now get this to show up...i9 think i have the searchresults.php path wrong

this is teh error i get when trying to search Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /home/gsxrforu/public_html/searchresults.php on line 19

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/gsxrforu/public_html/searchresults.php on line 19

also how do i get this box to match teh size of the rest of teh column

davidw
27 Jan 2008, 21:30
Where is your searchresults.php file located?
Also, the line
chdir('/path/to/your/forums/');
This is for your root directory. If your root directory is public_html then that line should read
chdir('/home/gsxrforu/public_html/');
It will not find global.php within searchresults.php

davidw
27 Jan 2008, 21:31
also how do i get this box to match teh size of the rest of teh column

http://www.vbulletin.org/forum/showpost.php?p=1379973&postcount=127

chevy01xtreme
27 Jan 2008, 21:59
Where is your searchresults.php file located?
Also, the line
chdir('/path/to/your/forums/');
This is for your root directory. If your root directory is public_html then that line should read
chdir('/home/gsxrforu/public_html/');
It will not find global.php within searchresults.php
teh searchresults.php is in the root directory... if not there where does it go.. still dont work :(

davidw
27 Jan 2008, 22:03
Can you PM me site details (location, location of searchresults.php, etc)?

chevy01xtreme
28 Jan 2008, 15:34
Can you PM me site details (location, location of searchresults.php, etc)?
thank you for helping me to get it to work :)

ARB4HOSTING.COM
29 Jan 2008, 12:02
thanks ....

MrEyes
27 Feb 2008, 11:19
Hello,

I seem to be running into some problems getting this up and running under vb3.6.8 pl2.

Everything seems to have installed without errors, however the google search dialogs do not appear in the nav bar drop down boxes.

Now the following might be relevant, my navbar code is not in the navbar template it is in the header template. The hook for "navbar_search_menu" is present in the template so I assume this should not matter.

I might be wrong, however I was under the impression that google searching options would appear in the default vBulletin search.php page. If my "impression" is right, then the search dialogs are not displayed.

If I open the searchresults.php page, this opens correctly but obviously doesn't include any search results

I have also tried to add this to vBadvanced CMPS v3.0 RC2, the search dialog appears but when I search I get no results (or errors for that matter) displayed in searchresults.php

This is what I have done so far:

1) Downloaded vb_google_search_1_4.zip
2) Edited the searchresults.php to contain the correct forum path (line 8)
3) Uploaded searchresults.php to the root of the webserver (same directory as the VB index page)
4) Imported the product XML via AdminCP
5) Via AdminCP - vB Google Search (Adsense) set the following options

- Google Pub ID - using the value from https://www.google.com/adsense/account-settings. Interestingly this is prefixed with "partner", i.e. "partner-pub-1234567", I have added this without the "partner-" part

- Google cof code - Using the code as created in the adsense for search wizard in google adsense managment

- Google Frame Width - Set to 90%

- Image/Text for site - Set to the url of the site

- Image/Text for Google - No change made, using the default value of "web"

- Your Forum's Path - Entered the full URL to the searchresults.php

6) In AdminCP - vBa CMPS - Default Settings - Main Options - Portal Output Global Variables, added:

template_hook
google_navadsearch
google_label_site
google_label_web
homeurl

This was previously empty

7) In AdminCP - vBa CMPS - Edit Modules, selected "Search Forums" and under "Module Tools" selected "Copy"

8) Named the module copy to "Google Search"

9) In [Module] Main Options - Template Module Options - Template to Include, added "search_google"
Under the Template Module Options heading, edit the adv_portal_ area.
Change it from search to search_google

10) In [Module] Module Wrapper Template Options - Form Code, edited code to read:

<form method="get" action="http://www.mysite.com/searchresults.php" type="hidden" name="search" target="_blank">

Thats is everything in the "Form Code" box

11) In AdminCP - vBa CMPS - Edit Modules - Google Search, selected "Add/Remove" from pages and used the normal CMPS process for adding the module to the bottom of the centre column.

So anybody got any ideas?

Also one other question, has anybody got this running on 3.7?

EDIT : I have managed to get the CMPS not displaying results issue resolved (sort of), this was due to the configuration I had created in the google wizard, choosing the "Open results within my own site" options seems to have done the trick. However even though I selected a width of 800px the results are displayed in a thin column (around 300px). Additionally the bottom of the results is cut off and the search results page does not display a search dialog where users can re-search for other terms

Bloom21
28 Feb 2008, 17:36
As long as you are running 3.6.8 or higher, you can use vb google search 1 4.zip rather than the legacy version.

Simplified instructions:
Step 1:
Open up searchresults.php and edit the location to where you will upload it (preferably to the site's root location)
Upload searchresults.phpt.
Example: http://www.yoursite.com/searchresults.php



I assume this should read to your DIR of where you forum ROOT resides... thats why the fellow above is getting those errors.

davidw
28 Feb 2008, 18:15
Hello,

I seem to be running into some problems getting this up and running under vb3.6.8 pl2.

Everything seems to have installed without errors, however the google search dialogs do not appear in the nav bar drop down boxes.

Now the following might be relevant, my navbar code is not in the navbar template it is in the header template. The hook for "navbar_search_menu" is present in the template so I assume this should not matter. As long as your header template contains the relevant hook location navbar_search_menu then it should work – if it is not present, it will not work. You could try editing your template and ensuring both are present just in case.
$google_navadsearch
$template_hook[navbar_search_menu]

I might be wrong, however I was under the impression that google searching options would appear in the default vBulletin search.php page. If my "impression" is right, then the search dialogs are not displayed. This will display once you add the variable $google_siteadsearch

-- Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Search Templates => search_forums => under $navbar, add $google_siteadsearch

If I open the searchresults.php page, this opens correctly but obviously doesn't include any search resultsJust opening the searchresults.php page will do just that. If you see the header, footer, etc., but no results, from just opening the page with no reference, its working correctly.

I have also tried to add this to vBadvanced CMPS v3.0 RC2, the search dialog appears but when I search I get no results (or errors for that matter) displayed in searchresults.php

This is what I have done so far:

1) Downloaded vb_google_search_1_4.zip
2) Edited the searchresults.php to contain the correct forum path (line 8)
3) Uploaded searchresults.php to the root of the webserver (same directory as the VB index page)
4) Imported the product XML via AdminCP
5) Via AdminCP - vB Google Search (Adsense) set the following options

- Google Pub ID - using the value from https://www.google.com/adsense/account-settings. Interestingly this is prefixed with "partner", i.e. "partner-pub-1234567", I have added this without the "partner-" part

- Google cof code - Using the code as created in the adsense for search wizard in google adsense managment

- Google Frame Width - Set to 90%

- Image/Text for site - Set to the url of the site

- Image/Text for Google - No change made, using the default value of "web"

- Your Forum's Path - Entered the full URL to the searchresults.php

6) In AdminCP - vBa CMPS - Default Settings - Main Options - Portal Output Global Variables, added:

template_hook
google_navadsearch
google_label_site
google_label_web
homeurl

This was previously empty

7) In AdminCP - vBa CMPS - Edit Modules, selected "Search Forums" and under "Module Tools" selected "Copy"

8) Named the module copy to "Google Search"

9) In [Module] Main Options - Template Module Options - Template to Include, added "search_google"
Under the Template Module Options heading, edit the adv_portal_ area.
Change it from search to search_google

10) In [Module] Module Wrapper Template Options - Form Code, edited code to read:

<form method="get" action="http://www.mysite.com/searchresults.php" type="hidden" name="search" target="_blank">

Thats is everything in the "Form Code" box

11) In AdminCP - vBa CMPS - Edit Modules - Google Search, selected "Add/Remove" from pages and used the normal CMPS process for adding the module to the bottom of the centre column.

So anybody got any ideas?

Also one other question, has anybody got this running on 3.7?

EDIT : I have managed to get the CMPS not displaying results issue resolved (sort of), this was due to the configuration I had created in the google wizard, choosing the "Open results within my own site" options seems to have done the trick. However even though I selected a width of 800px the results are displayed in a thin column (around 300px). Additionally the bottom of the results is cut off and the search results page does not display a search dialog where users can re-search for other terms I’ve not tested this with vbadvanced 3.0 or 3.7 (yet) but that is coming up shortly.

Bloom21
28 Feb 2008, 20:45
anyone get this to actually work on 3.6.8 L2?

Here is my navbar piece where I am supposed to add:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



This doesn't work at all on the actual site.

davidw
28 Feb 2008, 22:05
I have it running on 3.6.8 PL2 with no issues (but it is in the navbar, not the header). Another option is to put the template code in there manually.

Where the $google_navadsearch is in your header, take that out and put in this


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


and make changes where are necessary.

Bloom21
28 Feb 2008, 22:08
um my post was about the NAV bar

MrEyes
29 Feb 2008, 16:55
As long as your header template contains the relevant hook location navbar_search_menu then it should work – if it is not present, it will not work. You could try editing your template and ensuring both are present just in case.
$google_navadsearch
$template_hook[navbar_search_menu]

Checking the template shows this hook, the following is the relevant template snippet:

<tr>
<td class="vbmenu_option"><a href="blog_search.php?do=search">Advanced Search</a></td>
</tr>
$google_navadsearch
$template_hook[navbar_search_menu]
</table>

I have also double checked that the "Plugin/Hook System" is enabled in AdminCP.

For now I have followed your earlier advice (http://www.vbulletin.org/forum/showthread.php?p=1453188#post1453188) and manually added the google search code to the template. So it now works, ish (see * below)

This will display once you add the variable $google_siteadsearch

That works a treat, ish (see * below)

I’ve not tested this with vbadvanced 3.0 or 3.7 (yet) but that is coming up shortly.

Well so far I have managed to get the search module added and it seems to work. There is only one problem though:

* When search results are displayed they show in a thin column on searchresults.php which sometimes seems to be cut off. After running some tests this seems to be how google is displaying the result in the iframe. I have set the "Google Frame Width" in "AdminCP - Options - Help vB Google Search (Adsense)" to 700px. This is getting through to the page output as if I view source I see:

var googleSearchFrameWidth = '700px';

However I still get the thin column and sometimes cut off results. Interestingly if I edit the following line in the google_searchresults template:

<div id="googleSearchUnitIframe"></div>

to

<div id="googleSearchUnitIframe" style="border: 1px solid #FF0000"></div>

The results are rendered with a red border around the iframe div and this border uses the "full screen". So it looks like it is the output from google that is causing the problem. However I am at a loss to explain this or find a solution

davidw
01 Mar 2008, 02:07
um my post was about the NAV bar
This works both places

MrEyes
03 Mar 2008, 09:54
stuff about the width of search results not being right

Fixed

This was my mistake, I entered the width as "700px" this should have been "700"

So all working (apart from the hook not being picked up which was resolved by manually adding the search code)

davidw
03 Mar 2008, 12:19
Don't forget to click install :)

Phaedrus
29 Mar 2008, 08:57
Quick question.

Ads do not seem to appear with my results. Does it take some time before those begin to appear or have I done something odd?

davidw
29 Mar 2008, 13:49
You should see them in your searchresults.php page, as long as you have your PUB-# in your admincp.

Phaedrus
29 Mar 2008, 16:37
You should see them in your searchresults.php page, as long as you have your PUB-# in your admincp.
I'm getting them now. Works great!

I'd love to be able to change the background for different skins, but heck. I don't see how it would be possible other than directly changing the backgrounds....

Thumbs up to this one.

davidw
29 Mar 2008, 19:51
You should be able to modify it, but be careful. The cof code (aka GALT) contains all the hex colors for the background/links/etc. Experiment with these hex numbers to change those settings, but make sure you retain the old settings just in case something goes awry.

Phaedrus
30 Mar 2008, 06:11
You should be able to modify it, but be careful. The cof code (aka GALT) contains all the hex colors for the background/links/etc. Experiment with these hex numbers to change those settings, but make sure you retain the old settings just in case something goes awry.
You can use the hex colors in your skin... But yeah, keeping the old info is important.

angeldevil
30 Apr 2008, 10:25
i got this problem any1 can help pls ?

Google
Error




Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

angeldevil
30 Apr 2008, 10:48
Vb google search set to http://img293.imageshack.us/my.php?image=sgooglero1.jpg
And chdir('/var/www/vhosts/giaitrituoitre.net/httpdocs/'); in searchresults.php

angeldevil
30 Apr 2008, 11:29
Now nothing happen :

http://www.giaitrituoitre.net/searchresults.php?domains=http%3A%2F%2Fwww.giaitrituoitre.net&q=gold&sa=Go&sitesearch=&client=pub-0253864467006134&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%239A2C06%3BGL%3A1%3BDIV%3A%2333FFFF%3BVLC%3AD03500%3BAH%3Acenter%3BB GC%3A99CCFF%3BLBGC%3ACCE5F9%3BALC%3A440066%3BLC%3A440066%3BT%3A336699%3BGFNT%3A2 23472%3BGIMP%3A223472%3BFORID%3A1%3B&hl=en

davidw
30 Apr 2008, 12:00
On your first error - that is something not typical of this modification. You might find that kind of error using google custom search - or - using a domain other than your own or a cof/galt code that won't work correctly (entered in the admincp options).

Try entering the generic code

GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:00 00FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11

and see if this works - if it does, you can tweak these 6 digit hex values to your liking.

Also, make sure your path is correct in the admincp as well.

rix
08 May 2008, 18:05
just need to inform that google adsense search has changed and there's no GALT code anymore..

davidw
08 May 2008, 19:37
Ok, let me look into this - I am in the middle of rewriting this anyway for 3.7.

davidw
27 May 2008, 11:53
Updated and now there is a new version for 3.7 based on this change.