2
First off always put on php debug, when changing code
Secondly, instead of this:
// Find out it current user is a member of the group active users or if it's a guest user
if($xoopsUser->isGuest())
{
$isguest = True;
}
else
{
$isguest = False;
$ugroups = $xoopsUser->getGroups();
if(in_array(4,$ugroups)) $uactive = True;
else $uactive = False;
}
use this:
// Find out it current user is a member of the group active users or if it's a guest user
if(!$xoopsUser) //$xoopsUser object is empty if visitor is not a user
{
$isguest = True;
}
else
{
$isguest = False;
$ugroups = $xoopsUser->getGroups();
if(in_array(4,$ugroups)) $uactive = True;
else $uactive = False;
}
You most likely have a "Call to a member function on a non-object" by calling a method on the $xoopsUser object, which is null for anonymous users.