mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-24 08:52:45 +00:00
Remove player count feature for performance
This commit is contained in:
parent
ed794ec9dd
commit
84473a0cad
@ -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="container">
|
||||
<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;">© <a
|
||||
href="https://www.spigotmc.org/resources/litebans.3715/" target="_blank">LiteBans</a>
|
||||
</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>
|
||||
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
|
@ -13,11 +13,13 @@ function get_query($table) {
|
||||
|
||||
function run_query($table) {
|
||||
global $conn;
|
||||
$time = microtime(true);
|
||||
try {
|
||||
$result = $conn->query(get_query($table));
|
||||
} catch (PDOException $ex) {
|
||||
die($ex->getMessage());
|
||||
}
|
||||
echo('<!-- Query executed in ' . (microtime(true) - $time) . ' sec -->');
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/** Server settings **/
|
||||
$name = 'LiteBans';
|
||||
$serverip = 'mc.example.com';
|
||||
|
||||
/** MySQL settings **/
|
||||
// Server host
|
||||
|
Loading…
x
Reference in New Issue
Block a user