Here's a quick global I made to display the names of members online:
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.)
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.)