Add article count to user count in count_users.php
This commit is contained in:
parent
d00415d13f
commit
01154ca36e
|
@ -9,6 +9,15 @@
|
||||||
}
|
}
|
||||||
count_users();
|
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() {
|
function count_users() {
|
||||||
GLOBAL $CONFIG, $spooldir;
|
GLOBAL $CONFIG, $spooldir;
|
||||||
$session_age = 600;
|
$session_age = 600;
|
||||||
|
@ -34,7 +43,7 @@ function count_users() {
|
||||||
$are = 'are';
|
$are = 'are';
|
||||||
$users = 'users';
|
$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);
|
file_put_contents($session_save_file, $session_info);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue