Ad Management and PHPAdsNew - not working

Started by sportsguy, October 01, 2007, 09:03:09 PM

Previous topic - Next topic

sportsguy

SMF = 1.1.4
AdsNew = 2.0.7 (old, I know)

Package is installed fine.

I'm inserting the ad code to call the ads in in the correct space provided for the ad code...

Here's a sample of the ad invocation code I have:

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


Now, each time I try this, I see an error such as the following, instead of seeing my ad...

QuoteParse error: syntax error, unexpected '<' in /home/hfx4sale/public_html/Sources/Load.php(1735) : eval()'d code(237) : eval()'d code on line 1

Each time I remove something from the invocation code like the <> as mentioned in the parsing error message above, I simply see yet another error...never seems to get fixed, just finds another error - eventually you get to the point where there's no code left to parse...LOL

For the record, the Ad Management functionality allows you to choose between HTML or PHP - in this case, I have it set to PHP, though I did try both... ;)

Any ideas what's causing this to break?

Duane

Bigguy

Have you tried removing this:

<?php

and this:

?>

And just using the rest of it in a php block. ???

sportsguy

BAH!  I can't believe I missed THAT obvious combo!

Thanks Bigguy - VERY much appreciated. :)

...but do you know how to get the ad unit to center on the page now?

(I know - I'm never happy... ;) )

I tried the old <center> trick and it brought back the parsing error - clearly doesn't like the <> in there...

Bigguy

Try this:

<div align=center>ad code</div>

Glad you got it. ;)

sportsguy

OK - I tried that code...and got this error...

Parse error: syntax error, unexpected '<' in /home/hfx4sale/public_html/Sources/Load.php(1735) : eval()'d code(237) : eval()'d code on line 1

:(

Back to skewed ads unless anyone has another idea...

Duane

Bigguy

My codes are all centered using this:

<center>ad_code</center>

sportsguy

#6
Sorry to bring htis up again, but I'm still having this error - used the <center>ad_code</center> code and it brings up the error every time.

Any new thoughts on this idea?

I even just tried to edit the index.template.php page code to force it to center the ad code - it just breaks the template and shows an error code on the screen. :(

Surely I'm not the only person who's having this issue?

Bigguy

Hmm, I am not sure. Maybe if I had a look at it I would be able to fix you up. PM me later if you want and i will see what I can do if you like.

rsw686

Are you putting the <center> inside the php block? If so you need to

echo '<center>', $phpAds_raw['html'], '</center>';

to display it.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

jerm

Quote from: rsw686 on October 16, 2007, 08:02:04 PM
Are you putting the <center> inside the php block? If so you need to

echo '<center>', $phpAds_raw['html'], '</center>';

to display it.

That should solve your problem.. did it?

Advertisement: