PDA

View Full Version : Adding phpadsnew


rh2004
12-04-2004, 02:33 PM
Hi how do you get this to work, I have it installed etc, I created an
advertiser & zone, now where do I add the code on the forum so it will
display the banner(s)

Colin F
12-04-2004, 02:41 PM
You'll have to edit the templates in your admincp and put the code whereever you want to display the ads.

It'll require a basic knowledge of HTML.

rh2004
12-04-2004, 02:51 PM
But where do I find the code .... ..

Colin F
12-04-2004, 02:59 PM
you can generate the code in phpadsnew, it's the tab all the way on the right in the zone, if I recall correctly.

thephonemall
12-28-2004, 06:11 AM
I receive an error when I copy the code over to my header .. I am adding
<?php
if (@include(getenv('DOCUMENT_ROOT').'http://www.thephonemall.net/ad/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:1', 0, 'www.google.com', 'www.thephonemall.net/ads/bigad.swf', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>
and receiving:
==========================
The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/thephone/public_html/forums/includes/adminfunctions_template.php(3055) : eval()'d code on line 24

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish
=============================

I am also looking to integrate PHPADSNEW with forum specific banners.. how could I do this?

thephonemall
01-03-2005, 02:36 PM
Bump

Gez
01-21-2005, 08:17 AM
i got this same error, any ideas anyone?

SVTBlackLight01
01-21-2005, 05:04 PM
You can't use PHP in templates.

Do a search for phpadsnew here and at vbulletin.com. There are a few explanations of how to integrate phpadsnew ads with vbulletin.

Torqued
01-21-2005, 06:13 PM
Is there anything better than phpadsnew?

Andreas
01-21-2005, 06:35 PM
@thephonemall

if (@include(getenv('DOCUMENT_ROOT').'http://www.thephonemall.net/ad/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:1', 0, 'www.google.com', 'www.thephonemall.net/ads/bigad.swf', '0', $phpAds_context);
}


Put this in phpinclude_start (this is basically the code you posted, I just removed <?php ?> and the echo statement) and use $phpAds_raw[html] in template header where you want to have the banner.

Andreas
01-21-2005, 06:37 PM
Is there anything better than phpadsnew?
That's an interesting question, as phpAdsNew has one BIG problem that might make it unusable: cookies.

renee1
01-28-2005, 06:17 PM
@thephonemall

if (@include(getenv('DOCUMENT_ROOT').'http://www.thephonemall.net/ad/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:1', 0, 'www.google.com', 'www.thephonemall.net/ads/bigad.swf', '0', $phpAds_context);
}


Put this in phpinclude_start (this is basically the code you posted, I just removed <?php ?> and the echo statement) and use $phpAds_raw[html] in template header where you want to have the banner.

I am trying to do about the same thing but I want several advertisements on the page in different locations which are setup as zones. So I am trying to figure out how to use that invocation code style but in different spots.
So I have figured out $phpAds_raw calls the above link code but because we run several forums and run different advertisers in each I need to set conditions.

if ($foruminfo['forumid']=='9')
{
$advertiser2 = 'if (@include('path/to/script/adscript/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:9', 0, '_blank', '', '0', $phpAds_context);
}'
}
else
{
if ($foruminfo['forumid']=='8')
{
$advertiser2 = 'if (@include('path/to/script/adscript/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:8', 0, '_blank', '', '0', $phpAds_context);
}' }
else
{ $advertiser2 = >'didnt work'

well it sure didnt work....

I have a feeling it is due to my lack of skills in coding and I have something wrong here. At least it seems I have seen conditions set for varibles before? I had the above in the phpinclude_start

help help its beating me up :)