September 21, 2018 in Developer Connection
Hi, I'm wondering how can I get secondary groups for exact user and show their names. Any ideas how?
$groups = array();
foreach( explode( ',', $member->mgroup_others ) as $group )
$groups = \IPS\Member\Group::load( $group )->formattedName;
catch ( \OutOfRangeException $e )
\IPS\Output::i()->error( 'node_error', 'YOUR_ERROR_CODE', 404, '' );
echo \IPS\Member::loggedIn()->language()->formatList( $groups );
Quick edit to add try/catch, as groups can be deleted.
This was very helpful. Thank you for sharing.
This topic is now archived and is closed to further replies.
Started 14 hours ago
Started 20 hours ago
Started Wednesday at 11:08 PM