PDA

View Full Version : Page viewing?



mr. nervous
08-17-2009, 06:27 PM
Is there any way to add a little counter saying how many people are viewing that page?

I am hosting some games on my site and I wanted to know if I could put a little "how many other people are playing this game right now?" kind of thing.

Thanks very much.

programmerq
08-17-2009, 06:35 PM
I'm not aware of any pre-made solution that can do what you're talking about though. The way to do it would be to have an ajax request fire off every 25 seconds or so to notify the server "I'm still on this page", and to receive the most recent number. If 45 seconds go by without hearing from one of the users, then the server decrements the number by one.

If you're willing to try your hand at coding it, I'm interested in how hard it really is to implement.

mr. nervous
08-17-2009, 06:50 PM
Well, I can't code for my life. I don't really know what ajax is. Lol. I'll look into that method though, and I'll post back if I find something. Thanks!

mr. nervous
08-17-2009, 07:23 PM
Well, I found a nifty little thing but it's not very advanced, just shows how many people are on the page in real time.

www.whos.amung.us

Have fun.