Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Jibeji Posted December 16, 2016 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?
Martin A. Posted December 16, 2016 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
Jibeji Posted December 16, 2016 Author 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.
Martin A. Posted December 17, 2016 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;
Martin A. Posted December 17, 2016 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;
Jibeji Posted December 17, 2016 Author Posted December 17, 2016 Hi Martin, It is outside the suite, and the code you provided works perfectly well! Thank you very much.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.