Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

How to get # of users connected to mail?

Quote Reply
How to get # of users connected to mail?
Hi,

If i would want to display number of users online (for GM accounts -- both all GM domains and domain specific) how to do it?

Thnx

Anup
Quote Reply
Re: [anup123] How to get # of users connected to mail? In reply to
Sorry, don't quite get what you're asking for.

Adrian
Quote Reply
Re: [brewt] How to get # of users connected to mail? In reply to
Hi Adrian,

Say on the login page somewhere I want to display the information total number of Users logged in for the given domain and also for all GM domains.

Thnx

Anup
Quote Reply
Re: [anup123] How to get # of users connected to mail? In reply to
You should be able to grab this info from the session table. Something like this would give you the total number of people logged in:
Code:
$DB->table('session')->count();
You can use the session_user_id to get domain information.

Adrian
Quote Reply
Re: [brewt] How to get # of users connected to mail? In reply to
Hi Adrian,

How to get this info by using tags on templates? Thru global or something. Help appreciated.

Thnx

Anup

Last edited by:

anup123: Jul 27, 2003, 2:04 PM
Quote Reply
Re: [anup123] How to get # of users connected to mail? In reply to
Here's a global to get the total number of users logged in
Code:
sub {
$DB->table('session')->count();
}

And here's a global to get the number of users logged into the same domain as you
Code:
sub {
my $tags = shift;
require GT::SQL::Condition;
$DB->table('session')->count(
GT::SQL::Condition->new(
session_user_id => LIKE => '%@' . $tags->{domain}
)
);
}

Adrian

Last edited by:

Jagerman: Jul 30, 2003, 7:14 PM
Quote Reply
Re: [brewt] How to get # of users connected to mail? In reply to
Thnx. It worked.

Anup