Previous Thread
Next Thread
Print Thread
Hop To
#168225 11/13/2006 4:01 PM
Joined: Feb 2004
Posts: 64
JPG
Offline
Journeyman
Journeyman
Joined: Feb 2004
Posts: 64
I keep getting errors when trying to create a simple links custom island. Would someone mind showing me what the code for the "Site Links" on the forum would look like.

Thanks,

JP

JPG #168227 11/13/2006 4:25 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Here's what we have:

Code
$body = <<<EOF
<a href="https://www.ubbcentral.com">Home</a><br />
<a href="https://www.ubbcentral.com/features.php">Features</a><br />
<a href="https://www.ubbcentral.com/docs.php">Documentation</a><br />
<a href="https://www.ubbcentral.com/purchase.php">Pricing & Order</a><br />
<a href="http://www.infopop.com/members/members.php">Members Area</a><br />
<a href="https://www.ubbcentral.com/newsletters.php">Newsletters</a>
EOF;

Rick #168228 11/13/2006 4:36 PM
Joined: Feb 2004
Posts: 64
JPG
Offline
Journeyman
Journeyman
Joined: Feb 2004
Posts: 64
How about inserting PHP code for an ad server?

Where would it go and do I remove $time = time();?

$time = time();

/* BODY HERE */
$body = <<<EOF

EOF;

JPG #168229 11/13/2006 4:45 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Yeah, that $time = time(); shouldn't even be there, was a test custom island that snuck in.

A custom island with php code would look something like:

Code
// PHP code here
$foo = "bar";
$math = 1 + 2;

$body = <<<EOF
Foo is set to $foo.  I can add!  1 + 2 = $math
EOF;

Rick #168230 11/13/2006 4:51 PM
Joined: Feb 2004
Posts: 64
JPG
Offline
Journeyman
Journeyman
Joined: Feb 2004
Posts: 64
I guess this isn't correct - still getting errors. Sorry, not a programer.

-------

// PHP code here

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

$body = <<<EOF
EOF;

JPG #168234 11/13/2006 5:00 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
You'll want something like this:

Code
if (@include(getenv('DOCUMENT_ROOT').'/asr/phpadsnew.inc.php')) {
  if (!isset($phpAds_context)) $phpAds_context = array();
  $phpAds_raw = view_raw('zone:1',0,'','','0',$phpAds_context);
}

$body = <<<EOF
{$phpAds_raw['html']}
EOF; 

Rick #168235 11/13/2006 5:05 PM
Joined: Feb 2004
Posts: 64
JPG
Offline
Journeyman
Journeyman
Joined: Feb 2004
Posts: 64
I tried:

-----------

if (@include(getenv('DOCUMENT_ROOT').'/asr/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw('zone:1',0,'','','0',$phpAds_context);
}

$body = <<<EOF
{$phpAds_raw['html']}
EOF;

------------

and

------------

<?php
if (@include(getenv('DOCUMENT_ROOT').'/asr/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw('zone:1',0,'','','0',$phpAds_context);
}

$body = <<<EOF
{$phpAds_raw['html']}
EOF;

---------------

Errors on both.

JPG #168236 11/13/2006 5:10 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Can you post the actual error you're getting? You definitely don't need the second with the opening php tag as the tag is added when the custom island is submitted.

Rick #168237 11/13/2006 5:13 PM
Joined: Feb 2004
Posts: 64
JPG
Offline
Journeyman
Journeyman
Joined: Feb 2004
Posts: 64
Parse error: parse error, unexpected $ in /data/sites/11704/mywebsite.com/www/forums/cache_builders/custom/portal_box_2.php on line 10

JPG #168239 11/13/2006 5:38 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Ok, my first guess is there is a space after the EOF; on the last line. PHP is very picky about that. Make sure that there are no spaces after that

$body = <<<EOF
{$phpAds_raw['html']}
EOF; <-- no spaces after the semi-colon



Rick #168242 11/13/2006 6:14 PM
Joined: Feb 2004
Posts: 64
JPG
Offline
Journeyman
Journeyman
Joined: Feb 2004
Posts: 64
That was it! One more question (although I'm sure I'll have more on my support ticket smile.

Is there any way to center the ad in the table (island)? Look at the site if you need to see what I am talking about.

Gracias!


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
0 members (), 396 guests, and 110 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)