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 06-13-2008 06:16 PM

Quote:

Originally Posted by davidw (Post 1544587)
...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.

Alternatively for this you can manually edit this in the templates either in the product or through the style (the product would be easier - then reupload and overwrite as it would affect all styles). The area to edit is under adv_portal_search_google this line:
Code:

<input type="text" name="q" size="{$vboptions['google_box_width']}" />
The next update I will probably separate these values so it isn't global.

andrewc_11890 06-15-2008 11:48 PM

Quote:

Originally Posted by davidw (Post 1548325)
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.

What do you mean? The link in post 35 takes you to the adsense login page. I logged in, but how do you resetup after you login I can find the pub ID, but it doesn't have the GALT thingy after it.

davidw 06-16-2008 01:39 AM

When you go to the adsense choices, do you see this? AdSense for Search Improved!? If so, click on that and go from there - it will tie in to your existing account.

cmedic101 06-16-2008 03:58 AM

Great Mod!

Works perfect:up:


thanks

cmedic101

davidw 06-19-2008 06:12 PM

Version 1.6 has been released. Details have been given on the changes to those who have clicked install.

amaarvell 06-21-2008 08:18 AM

Hi this dont work on my forum, could it be the fact our "search" button is called "search for solution"?
if so what do i need to change on the script to get it working

cheers

davidw 06-21-2008 10:15 AM

For one thing you have errors on your searchresults.php, which most likely means the path on the chdir is incorrect. Do the search locations show up correctly elsewhere (navbar/search.php)? Also, do you have the full URL in the admincp?

RedGTiVR6 06-30-2008 02:54 PM

installed! instructions are good, though they do say that your ID should start with PUB....

I pasted the entire ID starting with partner- and it works fine.

davidw 06-30-2008 03:15 PM

Yeah, that's right - It does start with partner (I have partner-pub in the instructions above but will need to edit the other instructions).
Thanks!

RedGTiVR6 06-30-2008 03:46 PM

thanks for the support! now if only we could get that in the advertisement management plug-in thread....:(

davidw 06-30-2008 03:54 PM

No problem - I'm considering working on Adsense for Content in the future.

LAJAURIA 07-07-2008 06:13 AM

it doesn't work....

how do I "resetup" my account?? I don't understand.


the pub number + the code you say, online appears in the adsense for search code, but not in the account-settings...


It doesn't show the pages i set up in my adsense and, when i do a search, shows this error:


Quote:

Forbidden

You don't have permission to access /search/ on this server.

davidw 07-07-2008 10:44 AM

If you are seeing something like this: partner-pub-0123456789012345:lnucfbm5dtp

your account is already under the new setup. This whole code you need for the admincp options. If you are not seeing the whole code (including the parts in red) then your account is based on the old style.

Please ensure you have set up the chdir in the searchresults.php file and that the admincp options point directly to that file (you can usually open the searchresults.php page and then copy and paste the URL into the admincp options).

dilbert 07-07-2008 12:47 PM

Thanks David,
This looks great.

Is it possible to get it to highlight the searched text in the posts similar to the default search? "&highlight=seach phrase"

davidw 07-07-2008 01:32 PM

Honestly I'm not sure as you are using Google, rather than vBulletin for the search engine on this. I cannot say no as I am not 100% sure.

marcossalazar 07-07-2008 01:41 PM

Great Mod. Can the color of the search results (changing the white background) be altered?

Thanks!

Marcos

jlew24asu 07-07-2008 01:52 PM

am I doing something wrong? I just get a blank page when I do a search. and is it showing up in the correct spot?


https://vborg.vbsupport.ru/external/2008/07/81.jpg

davidw 07-07-2008 02:01 PM

Quote:

Originally Posted by marcossalazar (Post 1569116)
Great Mod. Can the color of the search results (changing the white background) be altered?

Thanks!

Marcos

All that is edited when you set up or reset your adsense for search. Go back to the adsense for search page and recustomize it and then put the new partner-pub in there (your id itself will not change, just what is after it).

Quote:

Originally Posted by jlew24asu (Post 1569122)
am I doing something wrong? I just get a blank page when I do a search. and is it showing up in the correct spot?

Yeah, something isn't right with that page. You may want to reimport the product and ensure you have the correct path on your searchresults.php page. Going to that page you should see a minimum of your header, footer, navbar, and an iframe.

jlew24asu 07-07-2008 02:22 PM

Quote:

Originally Posted by davidw (Post 1569128)

Yeah, something isn't right with that page. You may want to reimport the product and ensure you have the correct path on your searchresults.php page. Going to that page you should see a minimum of your header, footer, navbar, and an iframe.

when editing the search.php do I keep the ' www.chicagophotoshop.com/forums.....' that are inbetween the (...)

davidw 07-07-2008 02:38 PM

You never have to edit the search.php page - its the searchresults.php page. That page has a line that says chdir('/path/to/your/forums/'); - this should be edited to match yours - such as /home/www/site/forums/ (whatever yours is).

jlew24asu 07-07-2008 02:53 PM

Quote:

Originally Posted by davidw (Post 1569158)
You never have to edit the search.php page - its the searchresults.php page. That page has a line that says chdir('/path/to/your/forums/'); - this should be edited to match yours - such as /home/www/site/forums/ (whatever yours is).

right, thats what I meant, searchresults.php.

I'm getting confused by the example here..

Step 1:
Edit chdir('/path/to/your/forums/'); in searchresults.php - put the correct value then upload to your forum's root.

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


I entered the full UNIX path in chdir. do I add the site like your example? (http://www.chicagophotoshop.com/foru...rchresults.php) ?

LAJAURIA 07-08-2008 12:31 AM

Quote:

Originally Posted by davidw (Post 1568982)
If you are seeing something like this: partner-pub-0123456789012345:lnucfbm5dtp

that's ok.!!


Quote:

Originally Posted by davidw (Post 1568982)
Please ensure you have set up the chdir in the searchresults.php file and that the admincp options point directly to that file (you can usually open the searchresults.php page and then copy and paste the URL into the admincp options).

in the searchresults.php file, i seted up the chdir:

./search/

and in the admincp:

./search/



the file is in the folder: www.mysite.com/search



but i get the FORBIDDEN ERROR.

Quote:

Forbidden

You don't have permission to access /search/ on this server.

davidw 07-08-2008 12:46 AM

Quote:

Originally Posted by jlew24asu (Post 1569177)
right, thats what I meant, searchresults.php.

I'm getting confused by the example here..

Step 1:
Edit chdir('/path/to/your/forums/'); in searchresults.php - put the correct value then upload to your forum's root.

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


I entered the full UNIX path in chdir. do I add the site like your example? (http://www.chicagophotoshop.com/foru...rchresults.php) ?

That would explain a bit.
It needs to be more like /your/server/www/forums/

The forums root example is where to upload the file to.


Quote:

Originally Posted by LAJAURIA (Post 1569665)
that's ok.!!


in the searchresults.php file, i seted up the chdir:

./search/

and in the admincp:

./search/



the file is in the folder: www.mysite.com/search



but i get the FORBIDDEN ERROR.

The chdir in the searchresults.php file should be the path as in the above response to jlew24asu
The admincp path should be http://www.yoursite.com/forums/searchresults.php (something like that).

LAJAURIA 07-08-2008 01:19 AM

not working yet.

searchresults.php is in www.mysite.com/gsearch/searchresults.php


in the file chmod, i put www.buforo.com/gsearch/


in the admincp: http://www.buforo.com/gsearch/searchresults.php



not working!! please help.

davidw 07-08-2008 01:40 AM

The location of where you put the searchresults.php file is not a problem and the admincp location is good too. However, the chdir in the searchresults.php file should be something like

/usr/var/home/www/

not

www.buforo.com/gsearch/

You may need to ask your site host for this information. When you get that info, it should work fine.

LAJAURIA 07-08-2008 03:39 AM

I still couldn't solve the problem:

this is the error:


Quote:

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /www/buforo.com/htdocs/gsearch/searchresults.php on line 8

Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /www/buforo.com/htdocs/gsearch/searchresults.php on line 19

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='./:/usr/local/php5/lib/php') in /www/buforo.com/htdocs/gsearch/searchresults.php on line 19

this is the searchresult.php file:

Quote:

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'searchresults');
chdir('./htdocs/gsearch/');

// ################### 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') . '");');

this is the admincp config:

http://img79.imageshack.us/img79/7320/partnerfz3.jpg



where am I failing??

LAJAURIA 07-08-2008 04:10 AM

I think I fixed some problems. I found the path.

Now my searchresults.php file seems like this:

Quote:

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'searchresults');
chdir('/www/buforo.com/htdocs/gsearch/');

// ################### 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') . '");');

but, the error now is the following:

Quote:

Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /www/buforo.com/htdocs/gsearch/searchresults.php on line 19

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='./:/usr/local/php5/lib/php') in /www/buforo.com/htdocs/gsearch/searchresults.php on line 19

davidw 07-08-2008 10:41 AM

the chdir is to your forums, not to your search (that way you can use your vbulletin's functions).
Try using this: chdir('/www/buforo.com/htdocs/');

jlew24asu 07-08-2008 11:02 AM

Quote:

Originally Posted by davidw (Post 1569671)
That would explain a bit.
It needs to be more like /your/server/www/forums/

The forums root example is where to upload the file to.



The chdir in the searchresults.php file should be the path as in the above response to jlew24asu
The admincp path should be http://www.yoursite.com/forums/searchresults.php (something like that).

gotcha. but I did that. I entered in my full unix path and still no dice.

this is the entire line...

chdir(/editforprivacy/www/misc/chicagophotoshop/public_html/forums/)

am I missing something in between the (...) ??

LAJAURIA 07-08-2008 12:12 PM

Quote:

Originally Posted by davidw (Post 1569971)
the chdir is to your forums, not to your search (that way you can use your vbulletin's functions).
Try using this: chdir('/www/buforo.com/htdocs/');


yes!!!

now it works..!!


thanks a lot for your help....


now I'm proud of clicking on INSTALLED..





a $$$ question: what about AdSense?? does this hack work showing payed advertisments of Google???

I've made some searchings, and it never shows "Sponsored Links" ...

davidw 07-08-2008 12:28 PM

Quote:

Originally Posted by jlew24asu (Post 1569974)
gotcha. but I did that. I entered in my full unix path and still no dice.

this is the entire line...

chdir(/editforprivacy/www/misc/chicagophotoshop/public_html/forums/)

am I missing something in between the (...) ??

Yes, you are missing two ' in there
chdir('/editforprivacy/www/misc/chicagophotoshop/public_html/forums/');

Quote:

Originally Posted by LAJAURIA (Post 1570027)
yes!!!

now it works..!!


thanks a lot for your help....


now I'm proud of clicking on INSTALLED..





a $$$ question: what about AdSense?? does this hack work showing payed advertisments of Google???

I've made some searchings, and it never shows "Sponsored Links" ...

This shows sponsored links based on how you set it up in the adsense page. However, you still get paid based on your site's click-throughs. Check your adsense account for this.

jlew24asu 07-08-2008 12:53 PM

Quote:

Originally Posted by davidw (Post 1570034)
Yes, you are missing two ' in there
chdir('/editforprivacy/www/misc/chicagophotoshop/public_html/forums/');

getting closer!! :D now I get this...

davidw 07-08-2008 01:19 PM

Now all you have to do is put your full partner-pub number in the admincp options. This is what gives you the layout for the iframe results. :)

jlew24asu 07-08-2008 01:31 PM

It Works!!!!!

THANK YOU DAVID

jlew24asu 07-08-2008 01:43 PM

since I'm on a roll, is there a way I can add this outside of my navbar. maybe under it, in plain view?

davidw 07-09-2008 10:57 AM

$google_siteadsearch is already set up for something like that - you can put that most places. You can also take the contents of that template and plug them wherever you need to and modify them where appropriate if need be.

jlew24asu 07-09-2008 11:44 AM

Quote:

Originally Posted by davidw (Post 1570910)
$google_siteadsearch is already set up for something like that - you can put that most places. You can also take the contents of that template and plug them wherever you need to and modify them where appropriate if need be.

easier said then done ;)


:erm:

davidw 07-09-2008 11:58 AM

How big, what size, location, etc. did you have in mind?

TsirhCitna 07-13-2008 12:33 AM

I get this error from Google on my searchresults in the iframe:

Quote:

Error Bad Request

Your client has issued a malformed or illegal request.

davidw 07-13-2008 02:30 AM

Example: partner-pub-0123456789012345:lnucfbm5dtp
Something like this is what you need in your admincp options.


All times are GMT. The time now is 11:52 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.01399 seconds
  • Memory Usage 1,850KB
  • 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
  • (1)bbcode_code_printable
  • (23)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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