• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Geisor account] Player online/uptime isn't working..

Peacy

Member
Joined
Mar 20, 2008
Messages
488
Reaction score
10
Location
The Netherlands
Hello everybody, well I am using geisor account

But there is one little problem. The player online on the server and the server uptime isn't changing..

here is my script
PHP:
<?PHP if($config['status']['serverStatus_online'] == 1) echo '<font color="limegreen"><b>Server Online</b></font>'; else echo '<font color="red"><b>Sever Offline</b></font>'; ?><br />
                                    Uptime: <?PHP if($config['status']['serverStatus_online'] == 1) echo $config['status']['serverStatus_uptime'].''; else echo '0h 0m'; ?><br />
                                    Players Online: <?PHP if($config['status']['serverStatus_online'] == 1) echo $config['status']['serverStatus_players'].''; else echo '0'; ?><br />
                                    
    <?PHP                                
         $plik = "online.txt";
             $czas = 60;
                 $t = time();
             $ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];    
         $u = explode("\n", str_replace("\r", "", @join("", @file($plik))));
         foreach($u as $i => $v) {
             $e = explode("|", $v);
             if($e[0] == $ip || $e[1] < $t) unset($u[$i]);
         }
         $u[] = $ip . "|" . ($t + $czas);
         $fp = fopen($plik, "w");
             flock($fp, 2);
                 fputs($fp, join("\n", $u));
             flock($fp, 3);
         fclose($fp);
         echo 'Users on page: '.count($u);
    ?>
Oh ye.. btw the Uptime is staying on 16h, 21m and the player online stay's at 2

I hope someone you could help me :) Thanks
 
Last edited:
Open terminal and write in the following commands.

Normal user:
Code:
password root
Code:
cd /var/www/config
Code:
chmod +x serverstatus


root user:
Code:
cd /var/www/config
Code:
chmod +x serverstatus

Sometimes do not set chmod 777 for the whole directory "/var/www" because it is shot in the knee!
 
Hmmm OK :D I did not know that you are using Windows. If you're using Windows it should work. Make a well in the code layout.php and show file "serverstatus".
 
Back
Top