Jibeji Posted December 16, 2016 Share Posted December 16, 2016 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? Link to comment Share on other sites More sharing options...
Martin A. Posted December 16, 2016 Share Posted December 16, 2016 \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 Link to comment Share on other sites More sharing options...
Jibeji Posted December 16, 2016 Author Share Posted December 16, 2016 Unofortunately not. echo \IPS\Member::loggedIn()->groupName; displays : 9069d34ad217af2adb462b69812d9178 And you can trust me, this not the name of the group. Link to comment Share on other sites More sharing options...
Martin A. Posted December 17, 2016 Share Posted December 17, 2016 Are you doing this in a template, or outside the suite? $groupName = \IPS\Member::loggedIn()->groupName; \IPS\Member::loggedIn()->language()->parseOutputForDisplay( $groupName ); echo $groupName; Link to comment Share on other sites More sharing options...
Martin A. Posted December 17, 2016 Share Posted December 17, 2016 Are you doing this in a template, or outside the suite? $groupName = \IPS\Member::loggedIn()->groupName; \IPS\Member::loggedIn()->language()->parseOutputForDisplay( $groupName ); echo $groupName; Link to comment Share on other sites More sharing options...
Jibeji Posted December 17, 2016 Author Share Posted December 17, 2016 Hi Martin, It is outside the suite, and the code you provided works perfectly well! Thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.