I\'ve created a very simple multiuser game for learning purposes.
As users log on, each other user gets an update of all currently logged in users.
When a us
Don't know about the first question, but how about a suggestion on the second:
When the user is 'active', will they be causing page requests fairly regularly? If so, you could have a system whereby a logged-on user is periodically logged in your SQL database, with a timestamp. Then have another script look up all those users whose timestamps are older than a specified period (whatever you like, eg 10 seconds) and have them set to '0'.
I could suggest some code but maybe this isn't what you're looking for - let me know.
EDIT: OK, the link from your edit seems to have been answered with a similar system to what I just suggested. If you use AJAX you can call a php script periodically in the background to set and check timestamps from the SQL table.