Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Passing Vanilla variables through PageManager extension?

edited February 2007 in Vanilla 1.0 Help
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.

Comments

  • 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 = " "; }
  • edited February 2007
    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?
  • 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?
  • it's a global variable in eval'd code:<?php echo $GLOBALS['Context']->Session->User->Name; ?>
  • Is there a global variable also for the User Picture?
  • there is, but I don't think it's set in a custom page.
  • i think it is because the all member extension user icons
This discussion has been closed.