[Zope] ZRTChat: Logged in users indicator
Jim Washington
jwashin@vt.edu
Mon, 17 Jan 2000 16:28:14 -0500
Good question.
It's tough to know who or whether someone is actually there because
logouts are not enforced. Any kind of non-time-based counting or
listing algorithm would end up with zombies really quick.
However, for what you seem to need, you could compare the latest chat
item's bobobase_modification_time with the current ZopeTime(). Then you
could say, for example, that someone has posted in the last five minutes
or so.
I think that's how I would do it. Let me know what you figure out. I
may add a notifier like that into the next version.
-- Jim Washington
"Brendon Grunewald (70South)" wrote:
>
> I would like to put an image or different text at several places in the
> site when ever there is at least one person logged into the ZRTChat
> chatroom. i.e. a light on the front page to indicate that there is a
> chat session presently underway in the chatroom.
> Question:
> How can I accomplish the following algorithm,
> <If logged in users exist>
> display image or text a
> <else>
> display image or text b
> <fi>
>
> Basically I need to know how I can access a variable or other data type
> that will tell me whether there is anyone logged on when the page in
> question is requested. If no such variable exists, is there some other
> way of accomplishing this!
>
> Thanks
> Brendon
>
> --
> Brendon Grunewald
> http://www.70south.com
> mailto:brendon@70south.com