MyBB Community Forums

Full Version: How does "Who's online" work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have made my site to piggy-back on mybb's user database, and it's working great. I also want to integrate "who's online" feature into the site, so users using my main site, would also show up in the forum.. i can't seem to figure out which db table this uses.

Can anyone point me to the right direction?
did you saw the inc/functions_online.php file?
MyBB uses "{prefix}_sessions" to determine who's online. Or at least, it can be used to do it through the backend. Take a look at the table.

A uid of 0 means the user is a guest - all you have to do is to do a query that says something like

SELECT * FROM `mybb_sessions` WHERE `time` < '(time settings for your board)';

Or just look how myBB does it...