Using PHPadsnew 2 with Vbulletin 3.
The following are some tips on using these two programs together, based on my own experience. It's expected that you know how to use phpadsnew 2 to set up ads and generate invocation code.
PHP Invocation The first tip is how to use php invocation code. Using javascript is possible, but not all browsers support javascript and, in my experience, using php is faster. The php invocation code phpadsnew generates will look something like this... PHP Code:
PHP Code:
If you have multiple zones, you can string these together. On EN World we have a zone that only appears on our vbadvanced news page. On those pages we call the view_raw function an additional time for the extra zone (view_raw is the function that actually calls up the ad - the rest of the code initializes phpadsnew). Here's our code, as an example of a 2 zone system. PHP Code:
Ads new's maintenance.php file needs to run on a regular basis for it to perform correctly. You can invoke it from your scheduled task manager if you wish. If you do, I'd advise applying the following mod to the code of the maintenance.php file. Open it and go to the ending ?> mark. Right about it add this. PHP Code:
Any other tips/comments/questions welcomed. PHP Ads New 2 is at http://www.phpadsnew |
Here's a way to prevent certain usergroups from being logged as having seen an ad (they'll still see them but the ad view won't be logged). In the file phpadsnew.inc.php find the following code:
PHP Code:
PHP Code:
|
What should i put as the file name?
|
phpads-vbulletin.inc.php would work
|
I tried running the maintenance.php on my VBulletin 3.0.7 and wanted to make sure it was working so I tried to run it and got this error.
PhpAdsNew Maintenance Warning: main(/www/adserver/maintenance/maintenance.php): failed to open stream: No such file or directory in /admincp/cronadmin.php on line 56 Fatal error: main(): Failed opening required '/www/adserver/maintenance/maintenance.php' (include_path='.:/usr/local/nf/lib/php') in /mnt/web_h/d48/s32/b0239134/www/forums/admincp/cronadmin.php on line 56 |
Right there - the error message told me what I need to help you.. The absolute path to the file you want to include should be..
/mnt/web_h/d48/s32/b0239134/www/adserver/maintenance/maintenance.php |
Hi mike I tired what you said to put: (/mnt/web_h/d48/s32/b0239134/www/adserver/maintenan
I still get an error! How much will it cost to fix the problem for me? PhpAdsNew Maintenance Warning: main(/mnt/web_h/d48/s32/b0239134/www/adserver/maintenan): failed to open stream: No such file or directory in /admincp/cronadmin.php on line 56 Fatal error: main(): Failed opening required '/mnt/web_h/d48/s32/b0239134/www/adserver/maintenan' (include_path='.:/usr/local/nf/lib/php') in /mnt/web_h/d48/s32/b0239134/www/forums/admincp/cronadmin.php on line 56 |
FrankieFive, you need to adjust the number of caracters of the field filename of the table cron of your database because the default value of 50 caracters is not enought.
Try to run this query in the PHPMyAdmin: Code:
ALTER TABLE `cron` CHANGE `filename` `filename` VARCHAR( 70 ) NOT NULL |
Quote:
|
Quote:
If you get a "You don't have permission to run queries" error you'll need to edit your config.php file to give yourself permission to run queries. |
I tried submitting it and got an error enclosed is a picture of my phpadmin. Is there anything missing or needs to be corrected?
http://www.thespeedlounge.com/phpmyadmin.jpg http://www.thespeedlounge.com/phpmyadmin002.jpg |
I want to display several zones in a page. Is this possible in VB3?
Edit: Silly Question! Should have read all the thread! I am getting a Permission denied error when I try and run the cron job for maintenance.php I have tried changing the file permissions to 777 (not the best idea!) but now I get /pub/home/****/htdocs/adserver/maintenance/maintenance.php: cannot open ?php: no such file /pub/home/****/htdocs/adserver/maintenance/maintenance.php: /bin/: permission denied /pub/home/****/htdocs/adserver/maintenance/maintenance.php: /backup: symbolic link loop /pub/home/****/htdocs/adserver/maintenance/maintenance.php: /backup: symbolic link loop /pub/home/****/htdocs/adserver/maintenance/maintenance.php: /backup: symbolic link loop /pub/home/****/htdocs/adserver/maintenance/maintenance.php: 7: Syntax error: "(" unexpected What permissions should be set to allow this cron job to be run? |
I have tried running the vbcron and get the same error as Frankie.
|
Quote:
Mike I installed the invocation code into the php_start and the little piece of coding in the header and my banners aren't showing up. Also the maintenance error is still happening. |
The most likely reason is a size mismatch. Make sure the banners attached to the zone are exactly the right size.
|
Quote:
|
My banners are displayed. They were appearing when I went to zones but I realised it was because I hadn't specified the banner size. The only error I get is when I run the Maintenance script.
|
Quote:
../adserver/maintenance/maintenance.php |
I still get the same error.
Warning: main(../adserver/maintenance/maintenance.php): failed to open stream: Permission denied in /admincp/cronadmin.php on line 56 |
How would the code look if I wanted to call 468x60 banners, and smaller ones at the same time on 2 different areas on a page? I have the large banners showing up but not sure what I need to add to call the small ones.
|
Quote:
PHP Code:
|
Thanks, but then how would I then call each zone onto the page where I want it? For example I decided I am going to have text ads on the main forum page, plus 2 468X60 banners, plus a small banner on the side. If I only use $phpAds_raw[html] in each of these 4 areas, how does it know to call the correct ad for that spot?
Thanks again! I guess the bigger question is this...... I will always have text ads in the same place (forum home page), I will always have 468x60 ads in the same place (header and footer), and I will always have the small ad in the same place (side column). How would I setup both VB and PHPADSNEW to randomly call an ad of each type and stick it in these spots? I figured it out! I wasnt as familar with phpadsnew as I thought. I had no zones setup, and was a little mixed up because of the "Advertiser" and "Publisher" terminology. This program is a lot bigger than I expected it to be. I then figured out how to use multiple calls.... thanks again! |
Using the instructions in the original post, I have been unable to get my site off the ground. The local invocation just wont work. However, when I use java invocation, it works just right. However since its a high traffic site, I would prefer local invocation. I have tried every variation and possibility, but no go. Any leads as to what I can do to get the local php invocation working with my VB3
|
Uhm, well for starters, you are putting the local mode invocation code into the template phpinclude_start yes?
And are you then placing the variable $phpAds_raw[html] in the appropriate spot? @Distributor Talk: The first call puts the information in $phpAds_raw[html], the second in $phpAds_raw2[html] and so on... |
Ahoy! Thanks for replying.
Quote:
Quote:
|
I ended up getting it to work flawlessly on my site. Even setup a template condition to not display it on the homepage of vbadvanced (the banners are in my header and footer)
I'll help you if you want. Drop me an email: chris@distributortalk.com it looks like you figured it out :) I see the ad on your homepage This automerge doublepost "feature" is the most annoying, confusing thing to hit vbulletin. :( |
AHoy Chris,
Those ads are based on the javascript invocation, which I don't prefer due to the slightly increased loads. I hope I can still email you to figure this out since we seem to use the same templates! :D |
I can't get it to work.
I followed the tutorial verbatim, but they wont show up on my forums. :( ideas? |
Well, first off - the <?php and ?> tags need to be dropped before inserting the material into phpinclude_start. Their presence will trigger a parse error.
Second, make sure the zone # in the function call is correct - this is the part of the code most likely to change. Don't copy the code from my tutorial. Go to your phpads setup and have it give you the local mode invocation code. Then paste THAT CODE into phpinclude_start and delete the <?php and ?> markups along with the echo statement. Finally place the variable $phpAds_raw[html] where you need it to appear on your page. |
Michael, I had dropped the <?php and ?> tags and tried. But even with their presence I did not receive any error. All code I pasted were from within phpadsnew. If the javainvocation code goes in the same are as $phpAds_raw[html] then all goes well.
|
Hey pguy..... if that tossed no error before, you must be pasting the php code within the commented out area that already exists within the phpstart template.
Let me know. If you could set me up an admin that only has template access I can have this working for you in no time |
Michael, where exactly do I get my own invocation code? I can't seem to find a button inside the script.
As for the zones, i dont have any. |
To get phpadsnew to generate invocation code you need to go to publisher's & zones - it's in there somewhere.
@pguy> Post the entire contents of your phpinclude_start template into this thread in php bbcode tags, and I'll take a look. |
Ah i figured it out now. But it doesn't quite work on my froums... it shows up, but it gives me a "?>" at the end of the ad, and the banner is not clickable, but the text below it is :-\
Anyway I can talk to you on AIM? |
I've done this and it makes life easier rotating google ads with regular ads. The problem arises that it's possible to display a google ad on a non-allowed page. Any idea how to best handle this? It's certainly possible to assign the google ads to a separate zone. Dealing with login and register is pretty easy as they are labeled as such by 'THIS_SCRIPT'. However I believe the error pages are labeled as whatever script was running when the error condition was encountered.
|
I did some experimenting and here's what I'm now using in my phpinclude_start template. I'm running phpAdsNew as my banner ad server and have my google ads served from there as well. I originally had things set up so no ads were placed on the google excluded pages but decided to place ads on all pages - just exclude google ads from the specific pages.
PHP Code:
The last line in the while looks a bit strange but the current version of vBa gallery comes through with things defined that way for upload at the moment, so this serves as a catchall of sorts. An alternative approach, if you want to only serve ads on "allowed" pages is to do something like PHP Code:
|
hi
plz forgive me if this has been asked before.... im using phpadsnew and vb3. i have one campaign with 5 ads, the code for this is in the header for vb3 forum. it works fine randomly displayin the ads on all the sub forums. but i have one section in the forum (a sub forum) i want it to display a certain ad. can i modify the phpadsnew code that is inserted with say an "if" statment to only allow a certain add for a section forum in my forum or is there another way around this i hope the above makes sense |
I think I am looking for a similiar thing.. Basically I want to be able to have a unique zone for each forum... so banners at the top of each forum would be relevent to the forum title. ie. in the boat forum I only want boat related ads showing up, in the snowmobile forum I only want snowmobile ads showing up etc..
Can this be done?? |
I've been using phpadsnew for 3 years now with the remote invocation code because I have it in a subdomain. Will this little workaround work on a subdomain? I'm actually planning to move phpadsnew on a remote server.
|
I don't know - I'm sure there's a way, but it might involve some tinkering with the code.
|
All times are GMT. The time now is 09:29 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|