Count online user in joomla 3.0

I am creating a module in joomla 3.0 that will show a list of all online users. but I have no idea what database table state changes when any user goes online. if anyone can help.

Thank you in advance

+3


source to share


2 answers


In Joomla 3.2.0:

see file: wwwroot \ joomla3.1 \ administrator \ modules \ mod_status \ mod_status.php (at line: 56 you will see sql to get the number of registered users)



// Get the number of frontend logged in users.
   $query->clear()
         ->select('COUNT(session_id)')
         ->from('#__session')
         ->where('guest = 0 AND client_id = 0');

   $db->setQuery($query);
   $online_num = (int) $db->loadResult(); # Get the number of frontend logged in users.

      

+2


source


You can easily modify the Whos Online module and get the necessary data



Link to the tube

+1


source







All Articles