That might work, but again you're slamming your site. Say you have 1,000 users and you perform the check at an interval of 5 minutes. That's 12,000 page hits in 1 hour. So just a userbase of 1,000 is having the footprint of 12,000 which is not good. This would result in extremely slow browsing and probably crash the server after awhile as you'll probably hit CPU limitations unless on shared host.
I suggest just increasing the session lifetime in Joomla global configuration to something like 999 or 9999 minutes. This means they'll have to log out or reach 9999 minutes before their session expires and are shown as offline. Maybe that's a bit too high though and perhaps 2-3 hours should be sufficient.
Kyle (Krileon)
Community Builder Team Member
Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums
CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.