Quote:
Originally Posted by LifesGreatestGift
New plugin
Count primary / secondary users of group
hook location: forumhome_complete
PHP Code:
$groupid = 6; // Count admin users
$group_primary = $vbulletin->db->query_first("
SELECT COUNT(user.userid) AS count
FROM " . TABLE_PREFIX . "user AS user
WHERE user.usergroupid = " . $groupid . "
");
$group_secondary = $vbulletin->db->query_first("
SELECT COUNT(user.userid) AS count
FROM " . TABLE_PREFIX . "user AS user
WHERE user.membergroupids = " . $groupid . "
");
$primary = $group_primary['count'];
$secondary = $group_secondary['count'];
$total = vb_number_format($primary + $secondary);
vB_Template::preRegister('FORUMHOME',array('g_count' => $total));
then in FORUMHOME template you can do
Code:
Association members: {vb:raw g_count}
Be sure to change the '6' in $groupid to the group id you are trying to count.
|
thank you, I'm looking for it for days..