Commit f37776d3 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add group counts by type/jointype to the group stats summary


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent a1363a0b
......@@ -166,6 +166,8 @@ $string['statsmaxfriends'] = 'Has %1.1f friends (most is <a href="%s">%s</a> wit
$string['statsmaxviews'] = 'Has made %1.1f views (most is <a href="%s">%s</a> with %d)';
$string['statsmaxgroups'] = 'Is in %1.1f groups (most is <a href="%s">%s</a> with %d)';
$string['statsmaxquotaused'] = 'Has used about %s of disk quota (most is <a href="%s">%s</a> with %s)';
$string['groupcountsbytype'] = 'Number of groups by Group Type';
$string['groupcountsbyjointype'] = 'Number of groups by Access Type';
// Site options
$string['adminsonly'] = 'Administrators only';
......
......@@ -442,6 +442,24 @@ function group_statistics($limit, $offset) {
get_string('Posts', 'interaction.forum'),
);
$data['table'] = group_stats_table($limit, $offset);
$smarty = smarty_core();
$smarty->assign('grouptypecounts', get_records_sql_array("
SELECT grouptype, COUNT(id) AS groups
FROM {group}
WHERE deleted = 0
GROUP BY grouptype
ORDER BY groups DESC", array()
));
$smarty->assign('jointypecounts', get_records_sql_array("
SELECT jointype, COUNT(id) AS groups
FROM {group}
WHERE deleted = 0
GROUP BY jointype
ORDER BY groups DESC", array()
));
$data['summary'] = $smarty->fetch('admin/groupstatssummary.tpl');
return $data;
}
......
<p>{str tag=groupcountsbytype section=admin}:
<ul>
{foreach from=$grouptypecounts item=item}
<li>{str tag=name section=grouptype.$item->grouptype}: {$item->groups|escape}</li>
{/foreach}
</ul>
</p>
<p>{str tag=groupcountsbyjointype section=admin}:
<ul>
{foreach from=$jointypecounts item=item}
<li>{str tag=membershiptype.$item->jointype section=group}: {$item->groups|escape}</li>
{/foreach}
</ul>
</p>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment