Jump to content

IPS Class: How to retrieve group name

Featured Replies

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?

\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

 

  • Author

Unofortunately not.

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

displays : 9069d34ad217af2adb462b69812d9178

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

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

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

echo $groupName;

 

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

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

echo $groupName;

 

  • Author

Hi Martin,

It is outside the suite, and the code you provided works perfectly well!

Thank you very much.

Archived

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

Recently Browsing 0

  • No registered users viewing this page.