Topic: User Status
Rogue

Noob
Noob
Posts: 4

Posted:
Jun 15, 2005

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
avatar
Site Admin
Posts: 1320

Posted:
Jun 15, 2005

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:


Chestnut ! Cool
Site Admin
Rogue

Noob
Noob
Posts: 4

Posted:
Jun 15, 2005

[quote:c2d77fcb5d]mmm Wich welcome message ?[/quote]
In the header section of the theme.

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

Code
  1. echo "<td align=\"left\" width=\"25%\">&nbsp;&nbsp;<font color=\"$textcolor2\">Welcome, ".pnUserGetVar&#40;'uname')." ";
  2. if &#40;pnUserLoggedIn() and (!isset($op) or ($op == 'adminMain'))) {
  3. echo " &#40; Admin )";
  4.         &#125; else {
  5. echo " &#40; User )";
  6.         &#125;;
  7. echo "  </font>";


I think I am way off the mark :?
Chestnut
avatar
Site Admin
Posts: 1320

Posted:
Jun 15, 2005

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
  1. if &#40;pnUserLoggedIn()) {
  2.     if &#40;is_admin()) {
  3.         echo " &#40; Admin )";
  4.     &#125; else {
  5.         echo " &#40; User )";
  6.     &#125;
  7. &#125; else {
  8.     echo " &#40; Visitor )";
  9. &#125;
  10.  


Chestnut ! Cool
Site Admin