Jump to content

Secondary group list


CodePixel

Recommended Posts

$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.

Link to comment
Share on other sites

  • 2 months later...

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...