HI,
I'm looking for a way to display the number of front-end users on my website.
For example, there are 320 users in my member group.
How can I proceed to display in a frontend page : "there are 320 users"
Do I need a UDT ? Or do I need some module like CGDirectory ? Or is there a trick in FEU ?
Thanks for all ideas,
Square
Display the number of users by group in FEU
Re: Display the number of users by group in FEU
Get the id of the group -- I just cheat and look at the URL when you go to edit a group in the FEU admin.
Make a UDT called "set_number_of_users". Use this code (changing the 1 with the id of the group you want to show):
Then just put in the your page somewhere:
Make a UDT called "set_number_of_users". Use this code (changing the 1 with the id of the group you want to show):
Code: Select all
if (!function_exists('MyGetModuleInstance'))
{
function &MyGetModuleInstance($module)
{
global $gCms;
if (isset($gCms->modules[$module]) &&
$gCms->modules[$module]['installed'] == true &&
$gCms->modules[$module]['active'] == true)
{
return $gCms->modules[$module]['object'];
}
// Fix only variable references should be returned by reference
$tmp = FALSE;
return $tmp;
}
}
global $gCms;
$feu = MyGetModuleInstance('FrontEndUsers');
if ($feu == null)
return false;
//Get User
$the_count = $feu->CountUsersInGroup(1);
$smarty->assign('number_of_users', $the_count);
Code: Select all
{set_number_of_users}
<p>there are {$number_of_users} users</p>
Re: Display the number of users by group in FEU
Thank you so MUCH !! Works great !