5
i want to get the user's group, so if the user group is () do something else nothing. for example if the user's group is "TEST" i'll do "echo test" else if the group is "Registered Users" i'll do "echo registered user"
this code below is my "test.php":
include "mainfile.php";
$member_handler =& xoops_gethandler('member');
$group_ids =& is_object($xoopsUser) ? $member_handler->getGroupsByUser($xoopsUser->getVar('uid')) : array();
echo "$group_ids" . " ";
$in_group = in_array(1, $group_ids);
if ($in_group) {
echo "User is in the groupn";
} else {
echo "User is not in the groupn";
}
?>
Return is:
"1 User is not in the group."
it always return 1, User is not in the group. i'm quite sure i'm doing something wrong, but what exactly?