@rooman
In hUsers.php, update osc_total_users into following:
function osc_total_users($type = '', $condition = '') {
switch($type) {
case 'active':
return User::newInstance()->countUsers('b_active = 1');
break;
case 'enabled':
return User::newInstance()->countUsers('b_enabled = 1');
break;
case 'online':
$limit_seconds = 300; // 5 minutes
$threshold = date('Y-m-d H:i:s', strtotime(' -' . $limit_seconds . ' seconds', time()));
return User::newInstance()->countUsers(sprintf('b_enabled = 1 AND b_active = 1 AND dt_access_date >= "%s"', $threshold));
break;
case 'custom':
return User::newInstance()->countUsers($condition);
break;
default:
return User::newInstance()->countUsers();
break;
}
}
You can then call osc_total_users('online') to get online users. Update will be included in Osclass 8.0.3