mattsmith Posted May 24, 2014 Report Share Posted May 24, 2014 When my site connects to flight logging (xacars, Kacars) the number of guests visiting starts to go up. I.e it shows 25 guests visiting, once it went to 114? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted May 24, 2014 Moderators Report Share Posted May 24, 2014 Have you tried lorthon's solution: You would have to change the following in the StatsData public static function UsersOnline($minutes = '') { $key = 'users_online'; $users_online = CodonCache::read($key); if($users_online === false) { if($minutes == '') $minutes = Config::Get('USERS_ONLINE_TIME'); $sql = "SELECT p.* FROM ".TABLE_PREFIX."pilots p, ".TABLE_PREFIX."sessions s WHERE s.pilotid = p.pilotid AND DATE_SUB(UTC_TIMESTAMP(), INTERVAL {$minutes} MINUTE) <= s.`logintime`"; $users_online = DB::get_results($sql); # Check if it's blank, then return an empty array if(!$users_online) $users_online = array(); CodonCache::write($key, $users_online, 'short'); } return $users_online; } The problem is you would also have to remove the cache of this query. Since the query may keep the list old even if you change the time comparison in the query. So change the USER_ONLINE_TIME to say 1 min ( a least it will be closer) and then remove the cache scripting. Also, have you tried to edit the USERS_ONLINE_TIME setting on your local.config.php? # The StatsData::UserOnline() function - how many minutes to check Config::Set('USERS_ONLINE_TIME', 20); Where 20, replace this with the number of minutes you would like to "keep the sessions". Quote Link to comment Share on other sites More sharing options...
mattsmith Posted May 24, 2014 Author Report Share Posted May 24, 2014 Thanks I'll give it a try. Quote Link to comment Share on other sites More sharing options...
RocketRod Posted May 25, 2014 Report Share Posted May 25, 2014 I have removed Guests Online as it does not provide any useable information other than a number. Quote Link to comment Share on other sites More sharing options...
mattsmith Posted May 25, 2014 Author Report Share Posted May 25, 2014 I have removed Guests Online as it does not provide any useable information other than a number. yeah you have a point Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.