xyn Posted November 9, 2006 Share Posted November 9, 2006 Hey,I wanted to make a list of members who are ONLINE,so when they login it will imediatly add them to the listuntil they log-off...I can use AJAX for this, but the problem i am having isactually setting the users online activity...If I added a simple online 1/0 fild in the db, if they dontclick "logout" They wil lappear ONLINE until they do click it.Another Method is to do the last 5 minutes, bu again it's notpercist enough for me.. I know its a little picky, but its quiteimportant, i'm also hoping to use this script in my AJAX chat. Link to comment https://forums.phpfreaks.com/topic/26694-online-users-list/ Share on other sites More sharing options...
trq Posted November 9, 2006 Share Posted November 9, 2006 [quote]Another Method is to do the last 5 minutes, bu again it's notpercist enough for me..[/quote]Im afraid there is no real precise method of doing this. HTTP doesn't persist a connection so.... Link to comment https://forums.phpfreaks.com/topic/26694-online-users-list/#findComment-122124 Share on other sites More sharing options...
xyn Posted November 9, 2006 Author Share Posted November 9, 2006 oh, what would recommend I did to archeiv this then? Link to comment https://forums.phpfreaks.com/topic/26694-online-users-list/#findComment-122126 Share on other sites More sharing options...
trq Posted November 9, 2006 Share Posted November 9, 2006 You need to make a table which traks a users id and a timestamp. The timesatmp should be updated on each request.You then run a script as a cron job to check this table and delete users that have a timestamp older than the last five minutes.If you dont have cron, you can also run this script on each request but its probably a little less reliable. Link to comment https://forums.phpfreaks.com/topic/26694-online-users-list/#findComment-122127 Share on other sites More sharing options...
xyn Posted November 9, 2006 Author Share Posted November 9, 2006 Well if i use that method for ym chat too but If i use it with AJAX it wouldtechincly update it every 1 seconds anyway right?I mean everytime there is a "change" it updates thetimestamp, so then using AJAX i could again run aonline check for the online ppl? and if they dont havea valid timestamp for the last 1 minute or atleast 30 secondsclass them as logged out? Link to comment https://forums.phpfreaks.com/topic/26694-online-users-list/#findComment-122129 Share on other sites More sharing options...
trq Posted November 9, 2006 Share Posted November 9, 2006 Yeah, that would probably work quite well. Link to comment https://forums.phpfreaks.com/topic/26694-online-users-list/#findComment-122130 Share on other sites More sharing options...
xyn Posted November 9, 2006 Author Share Posted November 9, 2006 I know this is the wrong topic for this question but.Do you know where or how i could get information onsetting an IFRAME Scroll bars at the bottom all the time? Link to comment https://forums.phpfreaks.com/topic/26694-online-users-list/#findComment-122259 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.