MyBB Hacks

Full Version: No unactivated users in Online24.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

A client is using Labroccas "Online24" plugin however he wants to make it so unactivated users are not shown in the Online24 section on the index.

Here is the coding (only some since of the plugin license):

PHP Code:
$query = $db->query("
        SELECT u.*
        FROM ".TABLE_PREFIX."users u
        LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
        WHERE u.lastactive > $stime
        ORDER BY u.lastactive DESC
        ");
	while($online = $db->fetch_array($query))
	{
		if(!$online['invisible'] || $mybb->usergroup['canviewwolinvis'] || $online['uid'] === $mybb->user['uid'])
		{
			if($online['invisible'])
			{
				$invisiblemark = "*";
			}
			else
			{
				$invisiblemark = "";

			}
		
			if($online['uid']) {
			$username = $online['username'];
			$username = format_name($username, $online['usergroup'], $online['displaygroup']);
			$onlinemembers .= build_profile_link($username, $online['uid']).$invisiblemark. ", ";
			$membercount++;
			}

			if(!$online['uid']) { $guestcount++;	}
			if(strstr($online['sid'], "bot=")) { $botcount++; }

		}
			if($online['invisible']) { $anoncount++; }

	}


It is meant to work off the sessions tables but I changed it (because client wanted to) have it work of the users table.

Can anyone tell me how to exclude unactivated members/users from the Online24 results please? Smile

Check the user's usergroup before displaying it, or exclude the usergroup from the query?
(04-29-2011 08:02 AM)ZiNgA BuRgA Wrote: [ -> ]Check the user's usergroup before displaying it, or exclude the usergroup from the query?

Exclude the unactivated usergroup.
I think you misunderstood.
Yes, you just exclude the unactivated usergroup in your query or PHP code.
Reference URL's