first commit
This commit is contained in:
parent
a2bbe893db
commit
5ed9977567
3 changed files with 22 additions and 18 deletions
|
@ -5,8 +5,10 @@ include_once('./consql.php');
|
||||||
|
|
||||||
// set the default timezone to use. Available since PHP 5.1
|
// set the default timezone to use. Available since PHP 5.1
|
||||||
// https://www.php.net/manual/en/timezones.others.php
|
// https://www.php.net/manual/en/timezones.others.php
|
||||||
|
|
||||||
date_default_timezone_set('Etc/GMT-1');
|
date_default_timezone_set('Etc/GMT-1');
|
||||||
//date_default_timezone_set('Europe/Paris');
|
//date_default_timezone_set('Europe/Paris');
|
||||||
|
|
||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
// if server down update sql
|
// if server down update sql
|
||||||
|
@ -29,7 +31,7 @@ $insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,time
|
||||||
if (mysqli_query($con, $insql)) {
|
if (mysqli_query($con, $insql)) {
|
||||||
// echo "New record created successfully";
|
// echo "New record created successfully";
|
||||||
} else {
|
} else {
|
||||||
echo "Error: " . $insql . "<br>" . mysqli_error($con);
|
echo "Error: . $insql . <br>" . mysqli_error($con);
|
||||||
}
|
}
|
||||||
|
|
||||||
mysqli_close($con);
|
mysqli_close($con);
|
||||||
|
@ -75,9 +77,9 @@ $insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,time
|
||||||
|
|
||||||
// Check if errors with SQL query
|
// Check if errors with SQL query
|
||||||
if (mysqli_query($con, $insql)) {
|
if (mysqli_query($con, $insql)) {
|
||||||
// DEBUG
|
// echo "New record created successfully";
|
||||||
// echo "New record created successfully"; echo $insql;
|
// echo $insql;
|
||||||
} else { echo "Error: " . $insql . "<br>" . mysqli_error($con); }
|
} else { echo "SQL to inject: \n" . $insql . "<br>" . mysqli_error($con); }
|
||||||
|
|
||||||
mysqli_close($con);
|
mysqli_close($con);
|
||||||
}
|
}
|
||||||
|
|
14
config.php
14
config.php
|
@ -31,20 +31,22 @@
|
||||||
// Don't touch below
|
// Don't touch below
|
||||||
//
|
//
|
||||||
|
|
||||||
$urlserv = '$ipserv.":". $portserv' ;
|
$urlserv = $ipserv.":".$servport ;
|
||||||
$json = file_get_contents("http://".$ipserv.":".$modport."/"); // get info from server
|
$json = file_get_contents("http://".$ipserv.":".$modport."/"); // get info from server
|
||||||
|
|
||||||
|
$modnum = json_decode($json);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
// if (!$json) {
|
// if (!$json) {
|
||||||
//echo "The variable is not empty";
|
//echo "The variable is not empty";
|
||||||
|
// $objhigher = json_decode($json); //converts to an object
|
||||||
$objhigher = json_decode($json); //converts to an object
|
|
||||||
// $objlower = $objhigher[0]; // if the json response its multidimensional this lowers it
|
// $objlower = $objhigher[0]; // if the json response its multidimensional this lowers it
|
||||||
$objlower = json_decode($json); //converts to an array of objects
|
// $objlower = json_decode($json); //converts to an array of objects
|
||||||
|
|
||||||
// } else {
|
// } else {
|
||||||
// $mods = "";
|
// $mods = "";
|
||||||
// }
|
// }
|
||||||
|
*/
|
||||||
|
|
||||||
// librarie SQ - info serv game
|
// librarie SQ - info serv game
|
||||||
require 'SQ_/bootstrap.php';
|
require 'SQ_/bootstrap.php';
|
||||||
|
|
12
index.php
12
index.php
|
@ -177,7 +177,7 @@ $sec = "300";
|
||||||
<div class="col-md-2 col-xs-12 border-right">
|
<div class="col-md-2 col-xs-12 border-right">
|
||||||
<div class="">
|
<div class="">
|
||||||
<h5 class="description-header">
|
<h5 class="description-header">
|
||||||
<?php //echo count($objlower)
|
<?php //echo count($modnum)
|
||||||
echo $timeserver ;
|
echo $timeserver ;
|
||||||
echo " <small style='color: grey;'> <i class='fas fa-sun'></i> <span style='color: white;'> x ".$timespeed."</span> - <i class='fas fa-moon'></i><span style='color: white;'> x ".$timespeedn." </span>";
|
echo " <small style='color: grey;'> <i class='fas fa-sun'></i> <span style='color: white;'> x ".$timespeed."</span> - <i class='fas fa-moon'></i><span style='color: white;'> x ".$timespeedn." </span>";
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ $sec = "300";
|
||||||
<div class="callout callout-warning">
|
<div class="callout callout-warning">
|
||||||
<small class="text-muted">MOD actif</small>
|
<small class="text-muted">MOD actif</small>
|
||||||
<br>
|
<br>
|
||||||
<strong class="h4"><span style="color: #FFC107;"><?php echo count($objlower); ?></span></strong>
|
<strong class="h4"><span style="color: #FFC107;"><?php echo count($modnum); ?></span></strong>
|
||||||
<div class="chart-wrapper">
|
<div class="chart-wrapper">
|
||||||
<canvas id="sparkline-chart-1" width="100" height="30"></canvas>
|
<canvas id="sparkline-chart-1" width="100" height="30"></canvas>
|
||||||
</div>
|
</div>
|
||||||
|
@ -405,7 +405,7 @@ $sec = "300";
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-7">
|
<div class="col-sm-7">
|
||||||
<!--a href="mod_server.php"--><span class="badge badge-light">
|
<!--a href="mod_server.php"--><span class="badge badge-light">
|
||||||
<b><?php echo count($objlower); ?></b> <span class="text-muted"> Mods </span></span><!--/a-->
|
<b><?php echo count($modnum); ?></b> <span class="text-muted"> Mods </span></span><!--/a-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -504,7 +504,7 @@ $sec = "300";
|
||||||
|
|
||||||
<p class="before-list">
|
<p class="before-list">
|
||||||
<center>
|
<center>
|
||||||
<span style="padding: 5px 0px 2px 20px;"><?php echo count($objlower); ?> MODS </span>
|
<span style="padding: 5px 0px 2px 20px;"><?php echo count($modnum); ?> MODS </span>
|
||||||
<span style="padding: 5px 0px 2px 20px;">IP: <span style="color: orange;"><?php echo $urlserv; ?> </span></span>
|
<span style="padding: 5px 0px 2px 20px;">IP: <span style="color: orange;"><?php echo $urlserv; ?> </span></span>
|
||||||
</center>
|
</center>
|
||||||
</p>
|
</p>
|
||||||
|
@ -521,8 +521,8 @@ $sec = "300";
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td><br></td><td></td><br></tr>
|
<tr><td><br></td><td></td><br></tr>
|
||||||
<?php $objlower=json_decode($json); //converts to an array of objects
|
<?php $modnum=json_decode($json); //converts to an array of objects
|
||||||
foreach( $objlower as $item ) { ?>
|
foreach( $modnum as $item ) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="http://steamcommunity.com/sharedfiles/filedetails/?id=<?php echo $item->steamWorkshopId?>" data-type="Link"><?php echo $item->name; ?></a></td>
|
<td><a href="http://steamcommunity.com/sharedfiles/filedetails/?id=<?php echo $item->steamWorkshopId?>" data-type="Link"><?php echo $item->name; ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in a new issue