xoops forums


Friend of XOOPS
Posted on: 2006/2/18 16:04
dreamgear (Show more)
Friend of XOOPS
Posts: 78
Since: 2002/7/18

request: pass list of groups to template

I made the following hack to header.php to allow me to show different things based on whether users are members of a specific group:
*** header.php.orig_060218      Sat Feb 18 15:40:09 2006
--- header.php  Sat Feb 18 15:57:11 2006
85,104 ****
85,105 ----
$xoopsTpl->assign('xoops_banner'' ');
// Weird, but need extra <script> tags for 2.0.x themes
$xoopsTpl->assign('xoops_js''//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--');
// get all blocks and assign to smarty
$xoopsblock = new XoopsBlock();
$block_arr = array();
      if (
$xoopsUser != '') {
$xoopsTpl->assign(array('xoops_isuser' => true'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
$groups $xoopsUser->getGroups();
      } else {
$xoopsTpl->assign(array('xoops_isuser' => false'xoops_isadmin' => false));
$toppage false;
      if (isset(
$xoopsModule) && is_object($xoopsModule)) {
// set page title
$moduleid $xoopsModule->getVar('mid');
The line that begins with the plus sign "+" is the only addition. It would be nice if this made it into the next version. BTW this site is running


Just popping in
Posted on: 2006/3/21 20:59
koertzen (Show more)
Just popping in
Posts: 79
Since: 2003/10/22

Re: request: pass list of groups to template

I agree. I made a similar hack to set a flag if a user is a member of a particular group that was central to that particular installation, which I shall refer to as "install": install_isvolunteer, install_isstaff.

It will make my job easier if the core references these groups and passes them to the template so that I can create end-user interfaces referencing these groups without such a hack.

Be the change you wish to see in the world.