XF 2.0 how to count users online of a specific usergroup?

this is what i have right now
{{ count($online.users | isMemberOf(7)) }}
which doesnt work because isMemberOf isnt a default filter
how do i filter on group membership? or is there another way to accomplish this?
 
I think this function will not work.
Try use foreach function in php code (no in templates)

PHP:
$countGroup7 = 0;
foreach ($online['users'] AS $user)
{
    if ($userModel->isMemberOf($user, 7)) $countGroup7++;
}

I don't know how to called isMemberOf in xf2, but will be like it.
 
Back
Top Bottom