Jump to content

IPS Class: How to retrieve group name


Jibeji

Recommended Posts

Posted

Hello,

I am trying to retrieve members information with the IPS Class \IPS\Member::loggedIn()

After dumping the output, I can't see members group name.

Is there a way to retrieve it?

Posted
\IPS\Member::loggedIn()->groupName; // Gives you the formatted group name

\IPS\Member::loggedIn()->language()->addToStack( "core_group_" . \IPS\Member::loggedIn()->member_group_id );  // Gives you the raw group name

 

Posted

Unofortunately not.

echo \IPS\Member::loggedIn()->groupName;

displays : 9069d34ad217af2adb462b69812d9178

And you can trust me, this not the name of the group. :)

Posted

Are you doing this in a template, or outside the suite? 

$groupName = \IPS\Member::loggedIn()->groupName;
\IPS\Member::loggedIn()->language()->parseOutputForDisplay( $groupName );

echo $groupName;

 

Posted

Are you doing this in a template, or outside the suite? 

$groupName = \IPS\Member::loggedIn()->groupName;
\IPS\Member::loggedIn()->language()->parseOutputForDisplay( $groupName );

echo $groupName;

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...