• Resolved vortrack

    (@vortrack)


    I would like to know how. Where when ppl login, it will show his/her name. And if not, it will show as Guest.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thread Starter vortrack

    (@vortrack)

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display username on front page?’ is closed to new replies.