1
I am looking for the "smart" way to add a global variable. Something akin to $xoops_isadmin except that the value will be true if the user is in a specified group.
In my theme I include a php file with code like:
Quote:
global $xoopsUser, $xoopsModule;
if (is_object($xoopsUser)) {
$showifFull="";
$desired_group = 14;
$groups = $xoopsUser ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
if (in_array($desired_group, $groups)) {
$this->assign("showifFull", TRUE) ;}
}
Now I can for example <{if $showifFull}>. I need the same variable in several places and would prefer a global variable that I can call from anywhere. In some cases I am presenting content based on that value (in my theme) or replacing the $xoops_isadmin variable so that a group of users can have access to a feature (like the shoutbox clear button).
I am looking for a clean way to do this and then have access to it in my theme and modules.