Jump to the post that solved this thread.
Solved: 4 Years, 9 Months, 3 Weeks ago Total Members of Group / Total Threads in FID
#2
Solved: 4 Years, 9 Months, 3 Weeks ago
The first one gets ugly if you are considering secondary usergroups. It gets to be very server intensive based on how many members you have. If you are only using primary groups you could do something like this:

$usergroupsquery = $db->simple_select("usergroups", "gid,title");
echo "<table><tr><th>Usergroup</th><th>Number of Users</th></tr>";
while($usergroup = $db->fetch_array($usergroupsquery))
{
$usercountquery = $db->simple_select("users", "COUNT(uid) as total", "usergroup=" . $uisergroup['gid']);
$count = $db->fetch_field($usercountquery, "total");
echo "<tr><td>" . $usergroup['title'] . "</td><td>" . $count . "</td></tr>";
}
echo "</table>";

I purposely avoided querying the user table only because otherwise you'd have to select the usergroup for each member and run it through a loop in php to get counts. That would lead to much more server intensive process.

The second problem can be handled similar to the first except you will first query the forums table and then the threads table.
Reply
Jump to the post that solved this thread.


Messages In This Thread
RE: Total Members of Group / Total Threads in FID - by dragonexpert - 2016-11-26, 02:07 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)