• OzzModz is no longer taking registrations. All registrations are being redirected to Snog's Site
    All addons and support is available there now.

online moderators count !

Create a plugin as follows:

Product: vBulletin

Hook Location: forumhome_complete

Title: Show Onlne Moderators In WGO

Execution Order: 5

Plugin PHP Code:

PHP:
$mods_online = 0;
$mods_list = '';
foreach ($activeusers AS $user)
{
	if (is_member_of($user['userid'], array(5,6,7)))
	{
		$mods_online++;
		$mods_list .= $user['musername'] . ', ';
	}
}

$mods_list = rtrim($mods_list, ', ');

if (!$mods_list)
{
	$mods_list = 'None';
}

$template_hook['forumhome_wgo_pos2'] .= '<div class="wgo_subblock section">
	<h3 class="blocksubhead"><img src="' . $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/users_online.png" alt="Moderators Online"/>Moderators Online: ' . $mods_online . '</h3>
	<div>' . $mods_list . '</div>
</div>';

Note: In the line "if (is_member_of($user['userid'], array(5,6,7)))" edit this (the "array(5,6,7)") to contain the list of usergroupids you wish to be considered as moderators.

Plugin is Active: Yes

Click "Save". :)
 
Last edited:
Doesn't seem to work for me. I have this for the user array:

Code:
if (is_member_of($user['userid'], array(2,5,6,7)))
{
$mods_online++;
$mods_list .= $user['musername'] . ', ';
}

If I remove "2" from the above array, my moderators are not shown in the list. If I remove "5" then my members are not shown. Seems like this plugin thinks the 2 groups have the opposite ID's...
 
Back
Top