Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

Info about how many users are online?

+2 votes
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...
asked Dec 9, 2010 in Q2A Core by snoopy0815

1 Answer

+1 vote
 
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.

answered Dec 13, 2010 by gidgreen
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...
the idea to add a sidebar, not the quantity but the nickname of users online somebody can help?