Add article count to user count in count_users.php

This commit is contained in:
Retro_Guy 2021-05-24 03:04:39 -07:00
parent d00415d13f
commit 01154ca36e
1 changed files with 10 additions and 1 deletions

View File

@ -9,6 +9,15 @@
}
count_users();
function count_articles() {
GLOBAL $CONFIG, $spooldir;
$database = $spooldir.'/articles-overview.db3';
$dbh = rslight_db_open($database);
$count = $dbh->query('SELECT COUNT(DISTINCT msgid) FROM overview')->fetchColumn();
$dbh = null;
return $count;
}
function count_users() {
GLOBAL $CONFIG, $spooldir;
$session_age = 600;
@ -34,7 +43,7 @@ function count_users() {
$are = 'are';
$users = 'users';
}
$session_info = '<h1 class="np_thread_headline">There '.$are.' currently '.$count.' '. $users.' online</h1>'."\r\n";
$session_info = '<h1 class="np_thread_headline">There '.$are.' currently '.$count.' '. $users.' online <br />Total messages: '.number_format(count_articles()).'</h1>'."\r\n";
file_put_contents($session_save_file, $session_info);
}
?>