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)

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" ...


All times are GMT. The time now is 02:25 AM.

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.01329 seconds
  • Memory Usage 1,761KB
  • 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
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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