Tutorials and programming - User Status

Rogue - Jun 15, 2005 - 05:52 AM
Post subject: User Status
Hi All,
I was wondering how you would add the members user status (eg: Admin, Mod, User) to the end of the welcome message.

Thanx in advance

Regards,
Rogue
Chestnut - Jun 15, 2005 - 10:45 AM
Post subject: Re: User Status
mmm Wich welcome message ?

And although it is not necessarily difficult, the difficulty rises with the fact that a user can be a member of multiple groups. So the question could be : If a user is a member of X and Y and Z ... wich one has the priority ?
Wink
Rogue - Jun 15, 2005 - 02:58 PM
Post subject: Re: User Status
Quote:
mmm Wich welcome message ?

In the header section of the theme.

This is what i have but it only shows the Admin.

Code:

echo "<td align=\"left\" width=\"25%\">&nbsp;&nbsp;<font color=\"$textcolor2\">Welcome, ".pnUserGetVar('uname')." ";
if (pnUserLoggedIn() and (!isset($op) or ($op == 'adminMain'))) {
echo " ( Admin )";
        } else {
echo " ( User )";
        };
echo "      </font>";


I think I am way off the mark Confused
Chestnut - Jun 15, 2005 - 03:04 PM
Post subject: Re: User Status
mmm not... off yes but not a lot Wink

If you are on 750 and have legacy functions enabled (see your Settings), you can use this :

Code:

if (pnUserLoggedIn()) {
    if (is_admin()) {
        echo " ( Admin )";
    } else {
        echo " ( User )";
    }
} else {
    echo " ( Visitor )";
}

All times are GMT + 1 Hour
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits