online members / guest's
Moderator: General Moderators
- spamyboy
- Forum Contributor
- Posts: 266
- Joined: Sun Nov 06, 2005 11:29 am
- Location: Lithuania, vilnius
online members / guest's
I need to creat such think - how ? should I count all members online, then members sessions and minus them from all (to get only guest).
Myabe someone has some snippet's / tutorials about this - any help will be helpful.
Myabe someone has some snippet's / tutorials about this - any help will be helpful.
- Gente
- Forum Contributor
- Posts: 252
- Joined: Wed Jun 13, 2007 9:43 am
- Location: Ukraine, Kharkov
- Contact:
Script is very simple - if session_id is found in the table update time field with current time, if no add it. I don't think I should write PHP code here.
AJAX part is also very simple. Use can find a lot of examples is Google.
So you just need to use setTimeout() JS function
http://developer.mozilla.org/en/docs/DO ... setTimeout
Put the call of your AJAX request there and that is all.
AJAX part is also very simple. Use can find a lot of examples is Google.
So you just need to use setTimeout() JS function
http://developer.mozilla.org/en/docs/DO ... setTimeout
Put the call of your AJAX request there and that is all.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- Gente
- Forum Contributor
- Posts: 252
- Joined: Wed Jun 13, 2007 9:43 am
- Location: Ukraine, Kharkov
- Contact:
Yes it's possible but in this situation there will be another definition of "online user".superdezign wrote:Or, even simpler, don't use AJAX at all. The only time that it matters how many people are online is when someone wants to look at it, so only update it on page loads.
For example. I open some thread with 15 posts and read it for 30 minutes.
I won't be online for other users who just open a page.
Last edited by Gente on Fri Jun 22, 2007 8:35 am, edited 1 time in total.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm