By nmss on
I've created a new block that will be used to display the user's username once they've logged in, "My account" and "Log out".
I'm doing this as I want to keep the "Navigation" block and this new block separate.
But username and "My account" are user specific so how can I echo these with php? I have no php knowledge.
Thanks :)
Comments
I've worked out how to move
I've worked out how to move Log out and My account with 'Menus', but how can I echo the username in my newly created "Control Panel" block? And can I do it in the title?
_
Try:
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
some things to start with
enter
print $GLOBALS['user']->name;to display the username of the currently logged in user.to find out other user data besides the name, enter this, but not on a live public site:
print_r($GLOBALS['user']);There are a bunch of PHP block snippets over here -> http://drupal.org/node/21867
Where do you edit?
I would like for the "My Account" & "Logout" links to be preceded by the username of the current user, but haven't a clue where to accomplish this. I know HOW to do it, I just don't know WHERE to do it. Any help?
Also, I would like to align the "Create new account" & "Request new password" links with the username & password fields respectively. Again, I know HOW to do it, just don't know WHERE. I'm using the Bartik theme, if that matters. Thanks, in advance, for any help.
Regards,
Sean Reeves