Does anybody know what pulls the member name into the User block, or where it displays "Hello Zetan"?
I've been searching for a while now, and nothing I've tried works.
Here is how I'm trying to use it:
.php block
elseif (in_array(4, $user_info['groups']))
echo '
Text Text Text, USERNAME HERE, TEXT.
';
I want to display the member name of the person logged in, in a php block.
Thanks
ZTN
Have you checked the block code and snippets board Zetan ?
I think there is a block made this way already, or if it was a request ???
I know i have read it in here some time ago though.
Also SMF have the docsection where they have a lot info on how to pull in things diffrent way to the theme or site.
I've looked at the snippets.. I seem to get errors with the way I try, I've been looking through the doc section at SMF.
http://support.simplemachines.org/function_db/index.php
I so wanted to be clever and do it myself../me is still a code n00ber :uglystupid2:
If it is any help
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged']){
echo '<span class="normaltext">', $txt['hello_member'], ' <b>', $context['user']['name'], '</b></span>';
$txt['hello_member'] = 'Hey,';
Thanks.. it doesn't work in the middle of my echo statement.
Theres few things in the script and it works as it is, I just want to add the member name.
Some random words here, MEMBER NAME, Some more words paragraphed here.
I'm sure it does work on it's own, but it gives me this error:
Parse error: syntax error, unexpected '<' in /home/zetan/public_html/somesite/Sources/Load.php(1737) : eval()'d code(35) : eval()'d code on line 15
I've been staring at it for a few days and I'm sure it's really simple. I have to go out, I'll stare at it some more later.
Quoteunexpected '<'
Quite often means that you need to add before an echo' and a '; at the end.
Thank you, I will have to fix it later .. It's Bank Hols here this weekend... Theres beer to drink with friends in the pub :buck2:
the variable for the member name is quite easy..and the whole "hello" string goes like:
echo $txt['hello_member_ndt'] , ' ' , $context['user']['name'];