[ic] Displaying Users Online

Ed LaFrance interchange-users@interchange.redhat.com
Thu Jan 17 12:32:01 2002


At 09:15 AM 01/17/2002 -0800, you wrote:
>At 05:57 PM 01/16/2002 -0800, you wrote:
>>Hi All,
>>
>>I need to show the # of user's currently logged in.  Can someone help?
>>
>>Output example of what I need...
>>
>>User's Currently Online: [code here]
>
>I would suggest using the [counter] tag.  Set up a file called 
>etc/logged_users, increment it each time someone logs in, and decrement it 
>when someone logs out. The you can do:
>
>User's Currently Online: [counter file=etc/logged_users value=1]
>
>- Ed L.
>

You know what?  That was a stupid idea.  It puts the burden of determining 
the initial number of logged in sessions on you, and it doesn't work when 
someone abandons their session without logging out, or uses auto login via 
cookies.

Kevin Walsh's suggestion is probably the best way to go.  Cherry-pick the 
active session stuff from the [dump-session] tag, and use to write your own 
global Usertag that tallies that values of logged_in (or the number of 
non-blank username's) and returns the total.  I'll go have another cup of 
coffee now :-)

- Ed L.


===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================