Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
908 views
in Q2A Core by
I'm thinking about tracking online user but I don't how to check user is online or not? Help me some clue so I can try, pls.

1 Answer

+2 votes
by

You can track whenever the person requests a Q2A page, and assume they're online for X minutes after that time. This is fairly standard practice. You can do this in a plugin by putting something in qa-plugin.php (i.e. not a module) which checks qa_get_logged_in_userid(...) and then updates a database table as appropriate.

by
A bit more detail?
I look through qa_get_logged_in_userid(...) and see that it has no parameter.
Another problem that if user close browser without signing-out? How can i check?
by
You can add a side panel is not the number of users, users online nickname ...
by
just record the output of qa_get_logged_in_userid() to the database, along with time(), and then run a database query to show all userids where the time recorded is say within one or two minutes of the current time.  Ajax refresh would also be possible.  Note, if you have the badges plugin installed, this info is already stored in the ^achievements table, so you can just get it from there.
by
There is not a plug in that do this operation? I can not have access to db and i think that i'm not abel to do it  but i can manage the frontend and with a plug would be all solved. :-)
...