12
you can also get the uname from the uid by using >
$uname_ = xoops_getLinkedUnameFromId($this->getVar('uid'));
eg.
$uid = $xoopsUser->getVar('uid');
$uname_ = xoops_getLinkedUnameFromId($uid);
as for
Quote:
$xoopsUser->isAdmin() works fine, but if a non-admin login is, the page wont be displayed - it halts any things after $xoopsUser->isAdmin() in php file.
you would have to add an else to the if for non logged in users >
include("../../mainfile.php");
include(XOOPS_ROOT_PATH."/header.php");
global $xoopsUser;
if (is_object($xoopsUser)) {
$uid = $xoopsUser->getVar('uid'); // I saw it another module
$uname_ = $xoopsUser->getVar('uname'); // I saw it another module
echo "check if user..
";
if ($xoopsUser->isAdmin()) echo "xoopsUser->isAdmin() result is: True
";
if ($xoops_isadmin) "xoops_admin is: True
";
}
if ($uname == "admin") {
echo "If statemen via uname is: True";
}
else {
echo "uname != admin, instead uname is: $uname";
}
?>
you have missed an opening brace '{' and then a closing '}' after the xoopsUser_isAdmin()
if ($xoopsUser->isAdmin()) [b][color=FF0000]{[/color][/b]echo "xoopsUser->isAdmin() result is: True
";
if ($xoops_isadmin) [b][color=FF0000]{[/color][/b] "xoops_admin is: True
";
} [b][color=FF0000]}[/color][/b]