Number of users online |
[eluser]mironcho[/eluser]
If you are saving session data into database (like described in http://ellislab.com/codeigniter/user-gui...sions.html), then you could use last_activity field to calculate online users. So if you want to find online users for last 10 minutes, you could try this: Code: $query = $this->db->query("SELECT COUNT(*) AS online_users FROM ci_sessions WHERE last_activity > (UNIX_TIMESTAMP() - 600)") Note: last_activity is updated on every five minutes! |
Messages In This Thread |
Number of users online - by El Forum - 01-24-2008, 09:12 AM
Number of users online - by El Forum - 01-24-2008, 09:22 AM
Number of users online - by El Forum - 01-24-2008, 09:26 AM
Number of users online - by El Forum - 01-24-2008, 03:19 PM
Number of users online - by El Forum - 01-24-2008, 03:21 PM
Number of users online - by El Forum - 01-24-2008, 03:29 PM
Number of users online - by El Forum - 01-24-2008, 03:52 PM
Number of users online - by El Forum - 01-24-2008, 07:02 PM
Number of users online - by El Forum - 01-24-2008, 11:23 PM
|