Number Of Users Logged In

3 posts by 3 authors in: Forums > CMS Builder
Last Post: January 23, 2013   (RSS)

By nmsinc - January 12, 2013

Is there a way to codeĀ for the number of active users who are logged into the CMS?

Thanks

nmsinc

nmsinc

Hi nmsinc,

If your familiar with creating CMS Builder plugins, this would be something that would be fairly simple to implement. You could create a new date field in the accounts section called something like 'last_activity'. Then use the section_init hook to detect when a user has loaded a page in CMS Builder, and update their 'last activity' field with the current date and time.

Then you could use Jerry's suggestion of checking how many users 'last activity' fields have been updated in the last five minutes. You could do this using the mysql_select function.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com