Display group name?
PermalinkJust wondered if anyone could help me out, i'm trying to display the 'group name' of a logged in member. I've achieved displaying their member name and a few other attributes using the following code:
$u = new User(); $ui = UserInfo::getByID($u->getUserID()); print $ui->getUserName();
I've tried replacing the getUserName with 'getGroupMemberType()' and 'getGroupMemberName()' but having no luck, and they were just guesses. Am I calling the wrong attributes or can groups not be called in the same way?
Thanks for any help!

$g = Group::getByName('groupname');
In my scenario, I will be adding users manually, and assigning each one to either group a, b, c, or d (for example), so I only need it to return one value. Is it possible to return that single value? Not too sure what group object I will need to declare since they will all be in individual groups... (I'm sure i'll be making more of a meal of this than is needed)!
Still getting used to C5 so you'll have to bare with me at the mo :)
$u=new User(); $groups = $u->getUserGroups(); foreach($groups as $group){ echo $group; }
array( [Registered Users groupID]=>Registered Users [Group b groupID]=>Group b [GuestgroupID]=>Guest )
$u=new User(); $groups=$u->getUserGroups(); foreach($groups as $key=>$group){ if($key!==1&&$key!==2){ echo $group; } }