query('SELECT COUNT(DISTINCT msgid) FROM overview')->fetchColumn();
$dbh = null;
return $count;
}
function count_users()
{
GLOBAL $CONFIG, $spooldir, $count_bots;
$session_age = 600;
$session_save_file = $spooldir . '/sessions.dat';
$session_dir = $CONFIG['tac'];
$session_files = scandir($session_dir);
$count = 0;
$bot_count = 0;
$throttled_count = 0;
foreach ($session_files as $session_file) {
if (filemtime($session_dir . '/' . $session_file) < time() - $session_age) {
continue;
}
if (strpos($session_file, 'sess_') === 0) {
$contents = file_get_contents($session_dir . '/' . $session_file);
if (strpos($contents, 'rsactive') !== false) {
$count ++;
if (strpos($contents, 'bot') !== false) {
$bot_count ++;
}
if (strpos($contents, 'throttled') !== false) {
$throttled_count ++;
}
}
}
}
if ($count == 1) {
$are = 'is';
$users = 'user';
} else {
$are = 'are';
$users = 'users';
}
if ($bot_count == 1) {
$bot_users = 'bot';
} else {
$bot_users = 'bots';
}
if($count_bots) {
$throttled_users = 'throttled';
$session_info = 'There ' . $are . ' currently ' . $count . ' ' . $users . ' online (including ' . $bot_count . ' ' . $bot_users . ' and ' . $throttled_count . ' ' . $throttled_users . ')
Total messages: ' . number_format(count_articles()) . "\r\n";
} else {
$session_info = 'There ' . $are . ' currently ' . $count . ' ' . $users . ' online
Total messages: ' . number_format(count_articles()) . "\r\n";
}
file_put_contents($session_save_file, $session_info);
}
?>