Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
szalik.dev Posted September 21, 2018 Posted September 21, 2018 Hi, I'm wondering how can I get secondary groups for exact user and show their names. Any ideas how?
Adriano Faria Posted September 21, 2018 Posted September 21, 2018 $groups = array(); foreach( explode( ',', $member->mgroup_others ) as $group ) { try { $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 ); @~Jakso.` Quick edit to add try/catch, as groups can be deleted.
JimBurnett Posted December 4, 2018 Posted December 4, 2018 This was very helpful. Thank you for sharing.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.