Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthormis-one
    • CommentTimeFeb 5th 2007
     # 1
    Is there any way I could call a user's nickname through a custom PageManager page? I feel like there is a simple PHP echo I could do but I'm missing it.
    •  
      CommentAuthorjimw
    • CommentTimeFeb 5th 2007
     # 2
    The user's name is User->Name. You should be able to reference it when the user is logged in. I've used the following to get user information:

    if ($Context->Session->UserID > 0)
    {
    if (!@$UserManager) $UserManager = $Context->ObjectFactory->NewContextObject($Context, "UserManager");
    $AccountUserID = ForceIncomingInt("u", $Context->Session->UserID);
    if (!@$AccountUser)
    {
    $AccountUser = $UserManager->GetUserById($AccountUserID);
    $DispFName = $AccountUser->FirstName;
    $DispLName = $AccountUser->LastName;
    $DispName = $AccountUser->Name." ".$DispFName . " " . $DispLName;
    }
    } else {
    $DispName = " ";
    }
    • CommentAuthormis-one
    • CommentTimeFeb 5th 2007 edited
     # 3
    Thanks jimw, I think I'm missing something though, shouldn't:

    Hi, <?php echo $DispName ?>


    Render: Hi, User

    Because I am not seeing such. Is there any includes that need to occur before your body of code?
    •  
      CommentAuthorjimw
    • CommentTimeFeb 5th 2007
     # 4
    I have that code in an extension I made for me. It adds a Hi in the sidepanel. Where are you trying to put the code?
    • CommentAuthorSirNot
    • CommentTimeFeb 5th 2007
     # 5
    it's a global variable in eval'd code:<?php echo $GLOBALS['Context']->Session->User->Name; ?>
    •  
      CommentAuthorjimw
    • CommentTimeFeb 5th 2007
     # 6
    Is there a global variable also for the User Picture?
    • CommentAuthorSirNot
    • CommentTimeFeb 5th 2007
     # 7
    there is, but I don't think it's set in a custom page.
    •  
      CommentAuthory2kbg
    • CommentTimeFeb 5th 2007
     # 8
    i think it is because the all member extension user icons
Add your comments
    Username Password
  • Format comments as