From 1dda180752801f73d86d19efe3a7d5239615c808 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Mon, 3 May 2021 02:11:37 -0700 Subject: [PATCH] Add number of users online display --- Rocksolid_Light/rocksolid/article-flat.php | 2 ++ Rocksolid_Light/rocksolid/index.php | 2 ++ Rocksolid_Light/rocksolid/thread.php | 1 + Rocksolid_Light/rslight/scripts/count_users.php | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Rocksolid_Light/rocksolid/article-flat.php b/Rocksolid_Light/rocksolid/article-flat.php index 3a1b14a..7232ce5 100644 --- a/Rocksolid_Light/rocksolid/article-flat.php +++ b/Rocksolid_Light/rocksolid/article-flat.php @@ -40,6 +40,8 @@ exit(0); } + $_SESSION['rsactive'] = true; + $location = $_SERVER['REQUEST_URI'].$_SERVER['REQUEST_STRING']; preg_match('/id=(.*)&/', $location, $hash); $_SESSION['return_page'] = $location.'#'.$hash[1]; diff --git a/Rocksolid_Light/rocksolid/index.php b/Rocksolid_Light/rocksolid/index.php index 9a585ae..f041343 100644 --- a/Rocksolid_Light/rocksolid/index.php +++ b/Rocksolid_Light/rocksolid/index.php @@ -55,6 +55,8 @@ if(isset($frames_on) && $frames_on === true) { groups_show($newsgroups); } echo ''; +$sessions_data = file_get_contents($spooldir.'/sessions.dat'); +echo '

'.$sessions_data.'

'; include "tail.inc"; ?> diff --git a/Rocksolid_Light/rocksolid/thread.php b/Rocksolid_Light/rocksolid/thread.php index ee56d7f..5d7fc33 100644 --- a/Rocksolid_Light/rocksolid/thread.php +++ b/Rocksolid_Light/rocksolid/thread.php @@ -3,6 +3,7 @@ session_start(); $_SESSION['group'] = $_SERVER['REQUEST_URI']; +$_SESSION['rsactive'] = true; include "config.inc.php"; include("$file_newsportal"); diff --git a/Rocksolid_Light/rslight/scripts/count_users.php b/Rocksolid_Light/rslight/scripts/count_users.php index eb82bf2..1e0ef8d 100755 --- a/Rocksolid_Light/rslight/scripts/count_users.php +++ b/Rocksolid_Light/rslight/scripts/count_users.php @@ -11,7 +11,7 @@ count_users(); function count_users() { GLOBAL $CONFIG, $spooldir; - $session_age = 300; + $session_age = 600; $session_save_file = $spooldir.'/sessions.dat'; $session_dir = $CONFIG['tac']; $session_files = scandir($session_dir); @@ -22,7 +22,7 @@ function count_users() { } if(strpos($session_file, 'sess_') === 0) { $contents = file_get_contents($session_dir.'/'.$session_file); - if(strpos($contents, 'starttime') !== false) { + if(strpos($contents, 'rsactive') !== false) { $count++; } }