PDA

View Full Version : How to integrate phpadsnew ?


LoOnEyToOnZ
04-21-2004, 04:28 AM
<a href="http://www.phpadsnew.com" target="_blank">www.phpadsnew.com</a>

Anyone know how to integrate this ads script into VB for me to sell banners ?

Thanks !

vbmechanic
04-21-2004, 11:26 AM
1) Install phpAdsNew
2) Setup ad campaigns and publisher
3) Get remove javascript invocation code from phpAdsNew
4) Put this invocation code wherever you want the banner to appear

No integration needed...

Logician
04-21-2004, 11:29 AM
If your forum is busy, I'd suggest you forget about phpadsnew. With experience I can say that it is killing the server in busy forums with untolerable CPU processes. (Sorry I don't have any alternative suggestion either!)

vbmechanic
04-21-2004, 11:33 AM
If your forum is busy, I'd suggest you forget about phpadsnew. With experience I can say that it is killing the server in busy forums with untolerable CPU processes. (Sorry I don't have any alternative suggestion either!)
I disagree with that... I've used phpAdsNew on sites serving 1 mill+ banners a day. I would not suggest the javascript invocation but rather loading the PHP in that case.

LoOnEyToOnZ
04-21-2004, 12:28 PM
Thanks guys for the information

vbmechanic - how do i change it to load the PHP ? Like you mentioned....

vbmechanic
04-21-2004, 02:01 PM
Thanks guys for the information

vbmechanic - how do i change it to load the PHP ? Like you mentioned....
Use "Local Mode" invocation instead. Get the code like:


<?php
if (@include(getenv('DOCUMENT_ROOT').'/adserver/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>


See up there, it has an include? That includes the ad server software. You can take this PHP code and put it wherever you like-- at the end of global.php or in the php_include part of your header would work as well. Instead of "echoing" the raw variable like:

echo $phpAds_raw['html'];

instead set it to a variable like:

$bannerad = $phpAds_raw['html'];

Then wherever you want the banner ad to appear, you put $bannerad in your template. You can also load multiple ads this way, by calling this set of lines multiple times:

$phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$banneradtop = $phpAds_raw['html'];

$phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$banneradmiddle = $phpAds_raw['html'];

$phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$banneradbottom = $phpAds_raw['html'];

Which would set 3 separate banner ad variables.


As you might guess, the javascript invocation is easier.. hehe

juanchi
04-23-2004, 01:24 AM
I tried not to use the javascript method as you mention but when I put the code in index_header and header template, It didn't worked and I switch to the javascript method an it worked, by the way I'm running vbadvanced at my site, local mode worked when I put the variable $bannerad in the index template but I didn't know how to put the banner besides the vb logo so I switch to the header and index_header template but the banner didn't show, but as soon as I started using the javascript it worked.

What I'm doing wrong? I'm a lit bit worried about the javascript, will this bring me problems in the near future?