Remove player count feature for performance

This commit is contained in:
Ruan 2015-07-03 21:37:48 +02:00
parent ed794ec9dd
commit 84473a0cad
3 changed files with 2 additions and 13 deletions

View File

@ -1,6 +1,3 @@
<?php
$data = json_decode(file_get_contents('https://mcapi.ca/v2/query/info/?ip=' . $serverip), true);
?>
<div class="navbar navbar-default navbar-fixed-bottom" role="navigation"> <div class="navbar navbar-default navbar-fixed-bottom" role="navigation">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
@ -13,15 +10,6 @@ $data = json_decode(file_get_contents('https://mcapi.ca/v2/query/info/?ip=' . $s
<p class="navbar-text" style="font-size:15px;color:white;">&copy; <a <p class="navbar-text" style="font-size:15px;color:white;">&copy; <a
href="https://www.spigotmc.org/resources/litebans.3715/" target="_blank">LiteBans</a> href="https://www.spigotmc.org/resources/litebans.3715/" target="_blank">LiteBans</a>
</div> </div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<p class="navbar-text"
style="color:white;"><?php
if (array_key_exists('players', $data)) {
echo('Players: ' . $data['players']['online'] . '/' . $data['players']['max']);
} ?> </p>
</ul>
</div>
</div> </div>
</div> </div>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script> <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>

View File

@ -13,11 +13,13 @@ function get_query($table) {
function run_query($table) { function run_query($table) {
global $conn; global $conn;
$time = microtime(true);
try { try {
$result = $conn->query(get_query($table)); $result = $conn->query(get_query($table));
} catch (PDOException $ex) { } catch (PDOException $ex) {
die($ex->getMessage()); die($ex->getMessage());
} }
echo('<!-- Query executed in ' . (microtime(true) - $time) . ' sec -->');
return $result; return $result;
} }

View File

@ -1,7 +1,6 @@
<?php <?php
/** Server settings **/ /** Server settings **/
$name = 'LiteBans'; $name = 'LiteBans';
$serverip = 'mc.example.com';
/** MySQL settings **/ /** MySQL settings **/
// Server host // Server host