Add number of users online display

This commit is contained in:
Retro_Guy 2021-05-03 02:11:37 -07:00
parent d12f36e1dd
commit 1dda180752
4 changed files with 7 additions and 2 deletions

View File

@ -40,6 +40,8 @@
exit(0); exit(0);
} }
$_SESSION['rsactive'] = true;
$location = $_SERVER['REQUEST_URI'].$_SERVER['REQUEST_STRING']; $location = $_SERVER['REQUEST_URI'].$_SERVER['REQUEST_STRING'];
preg_match('/id=(.*)&/', $location, $hash); preg_match('/id=(.*)&/', $location, $hash);
$_SESSION['return_page'] = $location.'#'.$hash[1]; $_SESSION['return_page'] = $location.'#'.$hash[1];

View File

@ -55,6 +55,8 @@ if(isset($frames_on) && $frames_on === true) {
groups_show($newsgroups); groups_show($newsgroups);
} }
echo '</div>'; echo '</div>';
$sessions_data = file_get_contents($spooldir.'/sessions.dat');
echo '<h1 class="np_thread_headline">'.$sessions_data.'</h1>';
include "tail.inc"; include "tail.inc";
?> ?>

View File

@ -3,6 +3,7 @@
session_start(); session_start();
$_SESSION['group'] = $_SERVER['REQUEST_URI']; $_SESSION['group'] = $_SERVER['REQUEST_URI'];
$_SESSION['rsactive'] = true;
include "config.inc.php"; include "config.inc.php";
include("$file_newsportal"); include("$file_newsportal");

View File

@ -11,7 +11,7 @@ count_users();
function count_users() { function count_users() {
GLOBAL $CONFIG, $spooldir; GLOBAL $CONFIG, $spooldir;
$session_age = 300; $session_age = 600;
$session_save_file = $spooldir.'/sessions.dat'; $session_save_file = $spooldir.'/sessions.dat';
$session_dir = $CONFIG['tac']; $session_dir = $CONFIG['tac'];
$session_files = scandir($session_dir); $session_files = scandir($session_dir);
@ -22,7 +22,7 @@ function count_users() {
} }
if(strpos($session_file, 'sess_') === 0) { if(strpos($session_file, 'sess_') === 0) {
$contents = file_get_contents($session_dir.'/'.$session_file); $contents = file_get_contents($session_dir.'/'.$session_file);
if(strpos($contents, 'starttime') !== false) { if(strpos($contents, 'rsactive') !== false) {
$count++; $count++;
} }
} }