Just for the sake of the argument I am going to assume that you want
to implement something like the "Other Users" nodelet. There
is really no good way to do this. You could make every user log in/out,
but users are irresponsible, and would fail to logout.
The usual method is to log what time the user last accessed a page, and
then when you need to generate a list of logged in users, you go through
the log diplay only users that have logged in in the last N minutes.
If you had the times stored in a database you could do:
SELECT username FROM users WHERE (last_access > $time)
$time would be the current time minus the "inactivity threshold".
--
IndyZ
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.