SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: GreaterRealms on February 27, 2014, 03:08:03 PM

Title: Adding a bit of text to Treasury block?
Post by: GreaterRealms on February 27, 2014, 03:08:03 PM
Hello!

On my website, I am currently using the Treasury mod and displaying a paypal donation block by using this code in a custom Simple Portal block:

Code: [Select]
global $sourcedir, $settings;
include("$sourcedir/DonationBlock.php");

This is what it looks like now:
(http://i.imgur.com/TNheTxs.png)

It displays a very nice goal set and donation tracker. What I would like to do is add a little text blurb below that graphic in the same block,  to let members know what the donations go to and what it's for (in case they don't click the actual Donate link at the top navigation.)

I tried just adding a simple paragraph below the code, but of course, that created an error. Any suggestion s and help would be most appreciated! Thank you in advance :)
Title: Re: Adding a bit of text to Treasury block?
Post by: AngelinaBelle on February 28, 2014, 12:51:05 PM
In a php block, remember to use php code:
Code: [Select]
echo '<p>Here is a paragraph, complete with <b>some html</b> tags and all.
It goes on for line after line, and says exactly what I want it to say.</p>';
Title: Re: Adding a bit of text to Treasury block?
Post by: GreaterRealms on March 05, 2014, 08:41:42 AM
I tried adding that, but I am getting:

Code: [Select]
Parse error: syntax error, unexpected 's' (T_STRING), expecting ',' or ';' in /home/bariguy/gr.2phatgeeks.com/Sources/PortalBlocks.php(3561) : eval()'d code on line 3
If I leave the code just as :

Code: [Select]
global $sourcedir, $settings;
include("$sourcedir/DonationBlock.php");

I don't get any errors. Thank ya!
Title: Re: Adding a bit of text to Treasury block?
Post by: AngelinaBelle on March 05, 2014, 11:23:58 AM
I am going to guess that you tried your own string, and that this string contained a single-quote character.
php figures that if you start a string with a ', then the next time it finds one, you mean to end that string.
If that is not what you meant, it will probably become confused about what it finds afterwards, which is probably what you intend to be the rest of the string.

echo 'it's';  will create an error
echo 'it\'s'; will create the string you want.

Code: [Select]
global $sourcedir, $settings;
//(include("$sourcedir/DonationBlock.php");

echo 'It\'s time again to pay our yearly bills...';

SimplePortal 2.3.8 © 2008-2024, SimplePortal