I would like to know how. Where when ppl login, it will show his/her name. And if not, it will show as Guest.
I would like to know how. Where when ppl login, it will show his/her name. And if not, it will show as Guest.
Placing the following code into your template in the place you want to display your users name:
<?php global $user_identity;
get_currentuserinfo();
if ($user_identity == '') {
echo('Welcome Guest');
} else {
echo('Welcome ' . $user_identity);
}
?>
I can make this into a sidebar widget if that's how you'd like to use it.
Yes, it's good, but how do you make the word BOLD for identity?
<?php global $user_identity;
get_currentuserinfo();
if ($user_identity == '') {
echo('Welcome Guest');
} else {
echo('Welcome <b>' . $user_identity . '</b>');
}
?>
anyway to make it so the welcome user and logout link are side by side ?
ie
welcome user | logout
This topic has been closed to new replies.