1
OK, I'm going to start with I have no clue how to write PHP. However, I've done a little here and there to understand a few things. I want to take the array that shows the usergroups of a user and at this point display an echo statement. I've got it ordered because as I understand it, once PHP finds an if statement that works it ignores the rest. I have also tried to string together a way to come up with the usergroups array, but have been unable to do so because of my lack of understanding PHP as well as XOOPS itself. This is very important to me, so please someone help me out with this one.
This is what I have created using the information I've found.
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
$xoopsOption['show_rblock'] = 1;
if ( @$xoopsUser && is_object($xoopsUser) ) {
$xoopsTpl->assign( 'xoops_usergroups', $xoopsUser->getGroups() );
}
if ( in_array("1", $xoops_usergroups) ) {
echo "User is Admin";
exit;
}
elseif ( in_array("4", $xoops_usergroups) ) {
echo "User is SUBSCRIBED";
exit;
}
elseif ( in_array("2", $xoops_usergroups) ) {
echo "User is Registered";
exit;
}
else {
echo "User is Not Registered";
exit;
}
?>
Any Help would be greatly appreciated.