Hi.
I have set up a block to show just on the Welcome New Members board (a BBC block) and I want to use a system variable in it like {$member.name} - The current member's name. (for personalization.)
I have tried using BBC and HTML blocks to no avail, the text {$member.name} shows not the actual members name.
Is there a way to use a variable within a block?
Thanks.
PS tried searching for the answer but could not find any relating to variables.
it may be done with a php block, for example:
global $context;
$variable = 'your message here: hi {username} welcome to my forum';
// we parse $variable so we can use bbc on it.
parse_bbc($variable);
$variable = str_replace('{username}', $context['user']['username'], $variable);
this will replace {username} with the name of the user.
and then echo $variable:
echo $variable;
hope that helps
Many thanks 130860, that's just what I need.
Cheers
Hal
glad it worked, marked as solved then :)