Jump to content

Secondary group list


szalik.dev

Recommended Posts

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

  • 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.
×
×
  • Create New...