Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Who's Online displayed on the main page!

Quote Reply
Who's Online displayed on the main page!
Here's a quick global I made to display the names of members online:

Code:
sub {

my @found = ();
my $table = $DB->table('Online','User');
my $sth = $table->select( { 'Online.online_invisible' => 0, 'Online.guest_id_fk' => 0 }, ['User.user_username'] );

while (my $userid = $sth->fetchrow_hashref) {
push @found, $userid->{user_username};
}

return 'Current members online: ' . (@found ? join(', ', @found) : 'None');

}

Thought some of you may find it useful.

(It can actually be displayed on any page as it is a global.)

Last edited by:

RedRum: Feb 28, 2002, 12:48 PM
Subject Author Views Date
Thread Who's Online displayed on the main page! Paul 9834 Feb 28, 2002, 12:41 PM
Thread Re: [Paul] Who's Online displayed on the main page!
webconferencia 9378 Jun 12, 2003, 10:29 AM
Thread Re: [webconferencia] Who's Online displayed on the main page!
SandraR 8862 Apr 19, 2005, 1:10 PM
Thread Re: [SandraR] Who's Online displayed on the main page!
SandraR 8813 Apr 19, 2005, 1:23 PM
Thread Re: [SandraR] Who's Online displayed on the main page!
coolgreen44 8669 Aug 7, 2005, 10:36 AM
Post Re: [coolgreen44] Who's Online displayed on the main page!
pugdog 8544 Sep 29, 2005, 10:06 PM
Post Re: [SandraR] Who's Online displayed on the main page!
MJB 8240 Jul 21, 2006, 2:54 PM
Thread Re: [Paul] Who's Online displayed on the main page!
MJB 8459 Feb 25, 2006, 9:02 AM
Thread Re: [MJB] Who's Online displayed on the main page!
SeanP 8406 Feb 28, 2006, 9:25 PM
Post Re: [SeanP] Who's Online displayed on the main page!
MJB 8373 Mar 1, 2006, 8:03 AM