Previous Thread
Next Thread
Print Thread
Hop To
#168225 11/13/2006 4:01 PM
Joined: Feb 2004
Posts: 64
JPG Offline OP
Journeyman
OP Offline
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
R
Former Developer
Offline
Former Developer
R
Joined: Jun 2006
Posts: 9,242
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 OP
Journeyman
OP Offline
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
R
Former Developer
Offline
Former Developer
R
Joined: Jun 2006
Posts: 9,242
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 OP
Journeyman
OP Offline
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
R
Former Developer
Offline
Former Developer
R
Joined: Jun 2006
Posts: 9,242
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 OP
Journeyman
OP Offline
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
R
Former Developer
Offline
Former Developer
R
Joined: Jun 2006
Posts: 9,242
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 OP
Journeyman
OP Offline
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
R
Former Developer
Offline
Former Developer
R
Joined: Jun 2006
Posts: 9,242
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 OP
Journeyman
OP Offline
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
Scroll Up Button
by JAISP - 04/28/2021 7:39 AM
[Cannot Replicate] Unapprove Post Bug
by Larry Miller - 04/26/2021 10:07 AM
Just popping in
by Harold - 04/25/2021 9:05 PM
Moving Forum/Category location
by ECNet - 04/25/2021 12:11 PM
7.7.5 become member issue
by Ruben - 04/15/2021 10:06 AM
Who's Online Now
1 members (Ruben), 74 guests, and 54 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
gallery test
gallery test
by Mors, September 23
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 7.7.5