41
Quote:
niei0637 wrote:
$uid = is_object($xoopsUser) ?
echo $uid;
$xoopsUser->getVar('uid') : 0;
But this is not correct code.
Should be like this:
$uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
echo $uid;
This is also not correct
require(XOOPS_ROOT_PATH.'/mainfile.php');
Because XOOPS_ROOT_PATH is defined in mainfile.php
This way you will get nothing or you will have mainfile included twice.
When that file is included XOOPS_ROOT_PATH is already defined.
Just erase:
require(XOOPS_ROOT_PATH.'/mainfile.php');
require(XOOPS_ROOT_PATH.'/header.php');
or replace by:
if (!defined('XOOPS_ROOT_PATH')) {
die("XOOPS root path not defined");
}