CMS MADE SIMPLE FORGE

Frontend Users

 

[#3442] $feu_smarty get_user_group

avatar
Created By: Jeremy Bass (jeremybass)
Date Submitted: 2009-05-13 22:22

Assigned To:
Resolution: Invalid
State: Closed
Summary:
$feu_smarty get_user_group
Detailed Description:
I needed a way to get the use's group so I wrote this and thought it may be
something to add to the core... or something like it...

  {$feu_smarty->get_user_group($entry.id,'userGroups')}



in class.feu_smarty.php

 function get_user_group($uid,$assign)
  {
    if( empty($uid) ) return;
    if( empty($assign) ) return;
    if( !is_object($this->_module) ) return;
	$groups = $this->_module->GetMemberGroupsArray($uid);
	$groupname = $this->_module->GetGroupName( $groups[0]['groupid'] );
    global $gCms;
    $smarty =& $gCms->GetSmarty();
    $smarty->assign($assign,$groupname);
    return;
  }


Cheers
Jeremy

History

Comments
avatar
Date: 2009-07-05 11:44
Posted By: Robert Campbell (calguy1000)

CustomContent has this functionality.
      
avatar
Date: 2009-07-28 23:19
Posted By: Jeremy Bass (jeremybass)

Hey there, I forgot this was not for a use logged in, it was to get the group of
a user that is not logged in... That was the reason I had to add it in... IIRC
you can't use CustomContent to do that??? I'd be happy to send the dif too, thou
I'm sure you could write it better... anyways IMHO this is a great addition to
the $feu_smarty smarty set you got there and I think would round it out
nicely... Thanks

Cheers
Jeremy

      
Updates

Updated: 2009-07-05 11:44
resolution_id: => 9
state: Open => Closed