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 9839 Feb 28, 2002, 12:41 PM
Thread Re: [Paul] Who's Online displayed on the main page!
webconferencia 9382 Jun 12, 2003, 10:29 AM
Thread Re: [webconferencia] Who's Online displayed on the main page!
SandraR 8866 Apr 19, 2005, 1:10 PM
Thread Re: [SandraR] Who's Online displayed on the main page!
SandraR 8817 Apr 19, 2005, 1:23 PM
Thread Re: [SandraR] Who's Online displayed on the main page!
coolgreen44 8674 Aug 7, 2005, 10:36 AM
Post Re: [coolgreen44] Who's Online displayed on the main page!
pugdog 8548 Sep 29, 2005, 10:06 PM
Post Re: [SandraR] Who's Online displayed on the main page!
MJB 8244 Jul 21, 2006, 2:54 PM
Thread Re: [Paul] Who's Online displayed on the main page!
MJB 8463 Feb 25, 2006, 9:02 AM
Thread Re: [MJB] Who's Online displayed on the main page!
SeanP 8410 Feb 28, 2006, 9:25 PM
Post Re: [SeanP] Who's Online displayed on the main page!
MJB 8377 Mar 1, 2006, 8:03 AM