No unactivated users in Online24.
English Muffin Offline
Junior Member
**
Posts: 15
Joined: Apr 2010
Post: #1
No unactivated users in Online24.
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$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

04-29-2011 06:58 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: No unactivated users in Online24.
Check the user's usergroup before displaying it, or exclude the usergroup from the query?

My Blog
(This post was last modified: 04-29-2011 08:02 AM by ZiNgA BuRgA.)
04-29-2011 08:02 AM
Find all posts by this user Quote this message in a reply
English Muffin Offline
Junior Member
**
Posts: 15
Joined: Apr 2010
Post: #3
RE: No unactivated users in Online24.
(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.
04-29-2011 08:59 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: No unactivated users in Online24.
I think you misunderstood.
Yes, you just exclude the unactivated usergroup in your query or PHP code.

My Blog
04-29-2011 10:50 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: