Topic: "online players....." (page 1 of 1)

1
Author Post
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
when someone logs in i want it;
to change something on a database (done)
but (fe) if they close their browser or logout then i want it to change the database (not done)

any way of doing it ?

login -> changes $status="Online";
logout/close/inactive for 5 mins -> changes $status="Offline";

private message Website
qwertydawom
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
I guess you should first define this :
define("INACTIVE_USER", 5);
(if you want 5 mins fe)

Hmm... I'll look further into it lol
private message Website
Nedren899
groupmastergroupmaster
Is it in php? I had the same problem once. I just got around it by having on each page a function to update the members "row" in the table with the current unix timestamp, time(). Then on the online page, I pull each row from the table where the "time" is greater then time() - 300, or 5 minutes. Works nicly for me.
private message EMail Website
qwertydawom
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Oh ok, thanks :)
Yeah, it is in php ;)
private message Website

Topic: "online players....." (page 1 of 1)

1