Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
864 views
in Q2A Core by
Is it possible to get an information about how many users are online (logged in) right now? I would like to show it in the sidebar...

1 Answer

+1 vote
by
 
Best answer

It's not easy, since the Q2A database currently only keeps track of when users last did a write action (like voting or posting), not when they last viewed a page.

So you would have to use an advanced theme to keep track of user page requests in a new database table, and then it could also output the results. The function qa_get_logged_in_userid() will be helpful - it returns the id of the currently logged in user, or null if nobody is logged in.

by
edited by
Thanks for your quick answer!
This works perfect :)    ...at least until retrieving the ID
...now I'll play around and try to retrieve the names...  
give me some days - or better nights...
by
the idea to add a sidebar, not the quantity but the nickname of users online somebody can help?
...