1
I’m probably just trying to make things harder than necessary, but here’s what I want to achieve: I want to assign a smarty variable that holds the groupid of an user. I need it to be global because it will be used in a dropdown menu which is always displayed. Currently I add extra menus or menuoptions by using these smarty variables: <{if $xoops_isadmin}> and <{if $xoops_isuser}>.
Now I want a variable that will hold groupid so I can use it like this: <{if $groupid == 4}> display newsposters/approvers menu <{/if}>.
I actually thought I could achieve this without hacking, using the smarty php tags. I wanted to create something like this:
Quote:
<{php}>
GLOBAL $xoopsDB;
$userid = $xoopsUser->getVar('uid');
$thegroupid = "SELECT groupid FROM ".$xoopsDB->prefix("groups_users_link")." WHERE uid = userid";
$GLOBALS['xoopsTpl']->assign('group', $sql);
<{/php}>
This is just an impression because I know it can’t work like this. Someone who knows how I can achieve this?