[php] if (empty($_SESSION[‘user’])) {
$template->assign_block_vars(‘ToggleNotLoggedIn’, array());
} else {
$template->assign_block_vars(‘ToggleLoggedIn’, array());
}
// if ($GLOBALS[‘ActiveUser’][‘packagedata’][‘admin’] || $GLOBALS[‘ActiveUser’][‘packagedata’][‘superadmin’]) {
// $template->assign_block_vars(‘ToggleAdmin’, array());
// }
if ($GLOBALS[‘ActiveUser’][‘packagedata’][‘admin’]) {
$template->assign_block_vars(‘ToggleAdmin’, array());
}
if ($GLOBALS[‘ActiveUser’][‘packagedata’][‘superadmin’]) {
$template->assign_block_vars(‘ToggleSuperAdmin’, array());
}[/php]
In the commented out section there is a combined functionality of assigning a template block vars to ToggleAdmin if your package type is admin or superadmin. However I commented this out and tried to make it so that when someone is logged in as admin (separate class than superadmin) then I can assign a block var to ToggleAdmin and when someone is logged in as superadmin I can assign a block var to ToggleSuperAdmin.
Here is some sample template code to show you how this is called from the template:
[code]
|
As you can see the or should trigger one or the other to show up depending on which is active instead of both being active all the time. As of now they are both active all the time. I cannot get one to switch off when the other is active. What am I doing wrong?