[eluser]bassneck[/eluser]
I believe, you could count session records in the database (if $config['sess_use_database'] = TRUE) where (now() -last_activity) < $some_value * 60 minutes
However, if you have a lot of visits, it will cause high database load, so consider caching this value somehow and update it periodically (like every 5-15 minutes).