SimplePortal

Customization => Custom Coding => Topic started by: Burke Knight on July 04, 2013, 01:30:21 PM

Title: Custom PHP Block
Post by: Burke Knight on July 04, 2013, 01:30:21 PM
I am making a news box block that uses css. It is using a custom php block.
I get the block to show, yet the news text does not. I know it is something simple I'm missing, but I just can't figure it out.

Code: [Select]
<?php
echo'
<div id="bkmnews" align="center">
<div id="bkmnew" align="center">
<div class="bkmnewtop"></div>
<div class="bkmnewmain">
<br />
<p align="center"><div id="random_news"><p>'
$context['random_news_line'], '</p></div></p>
<br />
</div>
<div class="bkmnewbottom"></div>
</div>

</div>'
;
?>

The random news line should be showing, but it does not. I really need this to work, so if someone has an idea, please let me know.

Thank you.
Title: Re: Custom PHP Block
Post by: phantomm on July 04, 2013, 02:24:48 PM
You forgot to add global variables :)

Code: [Select]
global $context;

echo'
<div id="bkmnews" align="center">
<div id="bkmnew" align="center">
<div class="bkmnewtop"></div>
<div class="bkmnewmain">
<br />
<p align="center"><div id="random_news"><p>', $context['random_news_line'], '</p></div></p>
<br />
</div>
<div class="bkmnewbottom"></div>
</div>
</div>';
Title: Re: Custom PHP Block
Post by: Burke Knight on July 04, 2013, 06:10:24 PM
Like I said, something simple I missed...lol

Thanks. :)
SimplePortal 2.3.8 © 2008-2024, SimplePortal