|
Joined: Feb 2004
Posts: 64
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
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Here's what we have:
$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;
|
|
|
|
Joined: Feb 2004
Posts: 64
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;
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
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:
// PHP code here
$foo = "bar";
$math = 1 + 2;
$body = <<<EOF
Foo is set to $foo. I can add! 1 + 2 = $math
EOF;
|
|
|
|
Joined: Feb 2004
Posts: 64
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;
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
You'll want something like this:
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;
|
|
|
|
Joined: Feb 2004
Posts: 64
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.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
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.
|
|
|
|
Joined: Feb 2004
Posts: 64
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
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
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
|
|
|
|
Joined: Feb 2004
Posts: 64
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 . 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!
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
0 members (),
815
guests, and
186
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|