vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Integration with vBulletin - vB Google Adsense for Search plus Integration (https://vborg.vbsupport.ru/showthread.php?t=180277)

davidw 05-22-2008 10:00 PM

vB Google Adsense for Search plus Integration
 
I've done an overhaul on this and you will need to resetup your adsense for search account for this to work. If you aren't happy with that, please use the 3.6 version of this, which works fine for 3.7 from what I've been told. :)

Step 1:
You may have to resetup your adsense. If you do, you will get a new pub ID - this one includes your previous pub and tacks on your GALT (which is set up when you resetup your adsense account). I used www.christianboards.org and www.google.com (so it would search my site and the web - you can choose only your site, or any location that is web-accessible for results)

Example: partner-pub-0123456789012345:lnucfbm5dtp

If your partner-pub ID does not look like the example, you will see an error.

Also, keep in mind, all sites you put into the box for the adsense (one per line) will be integrated into the search and the search results.

Step 2:
Edit your searchresults.php file.
Find:
Code:

chdir('/path/to/your/forums/');
Put your correct value.

Example: chdir('/var/www/vhosts/yoursite.com/forums/');

Step 3:
Upload this file your forum's root. An example of your forum's root is below.

Example: http://www.yoursite.com/forums/searchresults.php

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

Step 5:
Configure your Admincp options
Go to Admincp => vBullitin Options => vBulletin Options => Find vB Google Search (Adsense) then click [Edit Settings]
Edit your new Partner-pub ID (the one you just had reset up - see example in red above), Google box width, iframe widthfor your results (I use 800 in the screenshot, but you can change this based on your needs), and the full URL to your searchresults.php.

NOTE! If you do not enter these in, you will see errors.

Step 6: Optional
Edit 1 template:
Admincp => Styles & Templates => Style Manager => Edit Templates (on your style) => Search Templates => search_forums => under $navbar, add $google_siteadsearch

Step 7: Optional (for vBAdvanced 3.x only)
vBa CMPS => Default Settings => Main Options => Portal Output Global Variables

Add these variables:
template_hook
google_navadsearch
homeurl

=> Save

vBa CMPS => Edit Modules => Search Forums => Select Action => Copy Module

Main Options
Module Title Google Search site / Forums
Template To Include search_google

Module Wrapper Template Options
Form Code Replace default code with
Code:

<form action="http://www.yoursite.com/forums/searchresults.php" type="hidden" name="search" target="_blank">
Click Save
Edit locations where you want to set this active to.

dvduval 05-23-2008 04:36 PM

Nice, thanks for this release. I will Download Now. :)

davidw 05-23-2008 08:57 PM

Added navbar screenshot. Let me know how it goes. :) If you like it click install.

nene94 05-23-2008 09:06 PM

Thanks, nice hack :)

mry 05-24-2008 01:57 PM

ı install this hack but

error :

Google
Error


Bad Request
Your client has issued a malformed or illegal request.

Edited...

Problem solved ...

davidw 05-24-2008 08:11 PM

Don't forget to click install :)

IR15H 05-24-2008 09:24 PM

Thanks for this.

Is there a way to get the width as a percentage, rather than pixels? Also, a way to enable different pallets for different forum styles?

davidw 05-24-2008 09:51 PM

I've tried to do percentages, but its fixed for width (I would prefer percentage personally). Unfortunately, colors are set to what's tacked to your pub (account). Unless you have multiple accounts, you couldn't have multiple colors set. This was possible previously before Google's change. However, this is something I will keep an eye on as I have multiple styles as well, and it would be nice to do this.

IR15H 05-24-2008 09:59 PM

Bah! Never mind, good job anyway :).

davidw 05-24-2008 10:18 PM

Thanks :)

digicom 05-24-2008 11:35 PM

Thanks installed:up:

Basit 05-25-2008 03:53 PM

Installed, but getting following error message.


Code:

Google    Error    Bad Request

 Your client has issued a malformed or illegal request.

For more detail see following page

http://www.hallagulla.com/urdu/searc...u+poetry&sa=Go

use to search term "urdu poetry"

Any idea what's wrong ?

davidw 05-25-2008 04:22 PM

If you don't do this:

Quote:

When you resetup your adsense, you will get a new pub ID - this one includes your previous pub and tacks on your GALT (which is set up when you resetup your adsense account).

Example: partner-pub-0123456789012345:lnucfbm5dtp
And put that in your admincp, you will get that error

Basit 05-25-2008 04:42 PM

Quote:

Originally Posted by davidw (Post 1531055)
If you don't do this:



And put that in your admincp, you will get that error


I was following instructions from AdminCP>vBulletin Options.



Thank you very much very helpful.

davidw 05-25-2008 05:47 PM

I will update instructions to make it easier for others to understand :)

Arkidas 05-27-2008 01:55 PM

Is it not possible to make the width 750 or so? Google only allows 795 :(

davidw 05-27-2008 03:08 PM

Did you edit the width in the admincp options? If it is unchangeable in the admincp, then it may only be changeable when you resetup your adsense account information.

ahayat 05-31-2008 05:28 AM

thanks i installed and it works when we search but still gives an error

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/rootname/public_html/searchresults.php on line 8

i did follow everything any idea where i went wrong?

nirvana43 06-01-2008 03:09 AM

Quote:

Originally Posted by ahayat (Post 1536810)
thanks i installed and it works when we search but still gives an error

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/rootname/public_html/searchresults.php on line 8

i did follow everything any idea where i went wrong?

same problem i'm facing!! plz help man!! :confused:

davidw 06-01-2008 01:15 PM

Did you edit searchresults.php as in Step 1: Edit chdir('/path/to/your/forums/'); in searchresults.php That would give this error if it was not edited or if the path was incorrect.

nirvana43 06-01-2008 02:37 PM

Quote:

Originally Posted by davidw (Post 1537804)
Did you edit searchresults.php as in Step 1: Edit chdir('/path/to/your/forums/'); in searchresults.php That would give this error if it was not edited or if the path was incorrect.

yes i did edited searchresults.php
my searchresults.php reads as follows :

Code:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'searchresults');
chdir('/home/public_html/searchresults.php');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// pre-cache templates used by all actions
$globaltemplates = array(
        'google_navadsearch',
                'google_siteadsearch',
                'google_searchresults'
);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// ######################## START MAIN SCRIPT ############################
$navbits = array();
$navbits[$parent] = 'Search Results';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('google_searchresults') . '");');
?>

My forum is located at http://www.projectsplanet.com
please tell me what should i write in searchresults.php ????
kindly help :(

Regards

davidw 06-01-2008 03:21 PM

For example, somewhat edited, here is mine:
chdir('/home/xxxxxxx/christianboards/forums/');
This is my /path/to/my/forums/ since searchresults.php is located at forums/searchresults.php
You will never use a file in a path (a path is a directory). In your case, try taking out searchresults.php from your path.

chdir('/home/public_html/');

It has to be the full path to your searchresults.php, but don't include the file itself. Hope that helps :)

nirvana43 06-02-2008 03:00 AM

Quote:

Originally Posted by davidw (Post 1537897)
For example, somewhat edited, here is mine:
chdir('/home/xxxxxxx/christianboards/forums/');
This is my /path/to/my/forums/ since searchresults.php is located at forums/searchresults.php
You will never use a file in a path (a path is a directory). In your case, try taking out searchresults.php from your path.

chdir('/home/public_html/');

It has to be the full path to your searchresults.php, but don't include the file itself. Hope that helps :)

Still same problem persist bro... :(
i tried these :

chdir('/home/projects/public_html/');

chdir('/home/public_html/');

btw in your case u've written chdir('/home/xxxxxxx/christianboards/forums/');

what to write at xxxxxxx please can tell me in my case what do i write??
my forum is located in main public_html directory
please have a look here www.projectsplanet.com
please tell me what do i write after /home/
:confused:


also when i try to search it gives me server not found error...

davidw 06-02-2008 11:13 AM

Each website is going to be different. If you have vbadvanced, there is a tool in the Extras (do not upload) folder called forumpath.php that you can upload to your forums directory that will tell you your exact forum path. If you use that tool, remove it after you use it. The path in the chdir must begin and end with a slash "/".

Also, for my site I edited it in at least two places, but just wanted to show that as an example.

ahayat 06-02-2008 12:41 PM

Quote:

Originally Posted by nirvana43 (Post 1538332)
Still same problem persist bro... :(
i tried these :

chdir('/home/projects/public_html/');

chdir('/home/public_html/');

btw in your case u've written chdir('/home/xxxxxxx/christianboards/forums/');

what to write at xxxxxxx please can tell me in my case what do i write??
my forum is located in main public_html directory
please have a look here www.projectsplanet.com
please tell me what do i write after /home/
:confused:


also when i try to search it gives me server not found error...

Bro when u get an error u must see the link above ?? PM me that link then i will reply you how to fix it.

in other words u must have seen the error like that chdir("/home/ur_root_name_/public_html")

ur_root_name = here u should see root name when u get error just put it there.

@david
Thanks alot mate , My Problem has been fixed.

nirvana43 06-03-2008 04:06 AM

Quote:

Originally Posted by ahayat (Post 1538703)
Bro when u get an error u must see the link above ?? PM me that link then i will reply you how to fix it.

in other words u must have seen the error like that chdir("/home/ur_root_name_/public_html")

ur_root_name = here u should see root name when u get error just put it there.

@david
Thanks alot mate , My Problem has been fixed.

yeah!! mine 2!!! its working lika charm now!!!
u rox david!!:D
thanks again!!
here is test : http://www.projectsplanet.com/search...sa=Search#1270

davidw 06-03-2008 10:48 AM

It shows to be working for me :)

ahayat 06-03-2008 02:14 PM

One question please.

Can i place it on Forumhome somewhere ? it would be good if users can see it on the page instead going to search list?
I thought i should ask you before trying anywhere :D

Cheers

davidw 06-03-2008 02:36 PM

Feel free to modify it to your forums needs. I won't be able to support it being modified for displaying results on the forumhome, but you are welcome to put it there. As for the search box itself, you can add that easily by using $google_siteadsearch and modifying that slightly.

MadK 06-08-2008 02:48 AM

Thank you davidw! It works great!
http://www.mafia-mp.com

davidw 06-08-2008 04:19 PM

Glad you like it :)

DawnsWebDesigns 06-08-2008 06:08 PM

I'm not sure if it's this mod & this mod alone but my site's been acting a bit strange. I can't create custom bbcode modules in my vbadvanced...not in FF...I can in IE.

But I noticed while I had this mod going it pushed that side column over to the left thereby pushing the other 2 over as well & made my page look strange. It was even worse in IE then it was in FF. I also noticed my drop down menus quit working. The search drop down still don't work for guests...but it does for members? The other 2 drop downs work?

Perhaps the search drop down don't work for guests because on my site guests have to do the human verification thingy. The link does work bringing up an entire search page for various things where they can also do the human verification thingy. Maybe that's it?

But when I turned your mod off my table/page straightened out & the other 2 drop down menus kicked back on. And yes sir I even put those variables in the vbadvanced global output blah blah. I just thought you should know.

davidw 06-09-2008 01:16 AM

My first thought - if it works in one browser but not another, it might be a cookie, or a cache issue (I've had both affect me on multiple occasions in both IE and FF).

- Column size issue
However, if you've tried deleting both cookies and cache and your module is moving over, one thing it could be is the way the browser renders the width of the search box. In your admincp, one of the options is the width of your Google search box, this is a global setting for your drop-down, the CMPS portal search, and for the search page. Try tweaking this variable smaller than what you have as IE and FF might render these different sizes.

- Drop down not working
One thing this will not do on a default board is disable javascript. That isn't to say that this modification will or will not have issues with another modification. If the drop down does not work for guests but does for members, this makes me think back to a cookie/cache issue.

So, ultimately, I would have to either say A) its either a cookie/cache issue with one or more browsers or B) an issue with a mod conflicting with this one - or a very slim chance that it is both, but unlikely

Hope that helps. :)

djilou 06-10-2008 09:42 AM

Quote:

Originally Posted by davidw (Post 1529384)
When you resetup your adsense, you will get a new pub ID - this one includes your previous pub and tacks on your GALT (which is set up when you resetup your adsense account).

Example: partner-pub-0123456789012345:lnucfbm5dtp

I don't see where can I get this code : :lnucfbm5dtp?

my code is look like
Code:

<input type="hidden" name="client" value="pub-0123456789012345"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input>
<input type="hidden" name="hl" value="fr"></input>


davidw 06-10-2008 10:47 AM

That's weird as I've gone through the setup 2-3 times and they both ended up with a full new code (which looks very different than this).

When you reset your adsense account, did you go to https://www.google.com/adsense/login/en_US/ and it did it ask you to set up a new username/password combination by chance?

djilou 06-10-2008 10:59 AM

Yes I did set up a new username/password and it's work now
Thanks!

davidw 06-10-2008 12:02 PM

Great news :)

andrewc_11890 06-13-2008 04:02 AM

How do you exactly resetup your adsense account?

davidw 06-13-2008 11:00 AM

Use the link in post #35 - if you haven't set it up in a while, when you log in and want to set up your adsense it will prompt you to set up a change, if not, you can go on through and redo your adsense.

ahayat 06-13-2008 05:54 PM

one question pls.

after adding this on my vbadvanced the size of search box has become big a bit. what should i do?


All times are GMT. The time now is 07:03 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01640 seconds
  • Memory Usage 1,841KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete