From 5ed997756735b61bf0ad87d9c9341d9161b30921 Mon Sep 17 00:00:00 2001 From: Erreur32 Date: Sat, 6 Feb 2021 00:17:51 +0100 Subject: [PATCH] first commit --- SQL/dayz2json_parser_sql.php | 12 +++++++----- config.php | 16 +++++++++------- index.php | 12 ++++++------ 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/SQL/dayz2json_parser_sql.php b/SQL/dayz2json_parser_sql.php index 494938f..936b5de 100644 --- a/SQL/dayz2json_parser_sql.php +++ b/SQL/dayz2json_parser_sql.php @@ -5,8 +5,10 @@ include_once('./consql.php'); // set the default timezone to use. Available since PHP 5.1 // https://www.php.net/manual/en/timezones.others.php + 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'); // 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)) { // echo "New record created successfully"; } else { - echo "Error: " . $insql . "
" . mysqli_error($con); + echo "Error: . $insql .
" . mysqli_error($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 if (mysqli_query($con, $insql)) { -// DEBUG -// echo "New record created successfully"; echo $insql; - } else { echo "Error: " . $insql . "
" . mysqli_error($con); } +// echo "New record created successfully"; +// echo $insql; + } else { echo "SQL to inject: \n" . $insql . "
" . mysqli_error($con); } mysqli_close($con); } diff --git a/config.php b/config.php index 0e70d9c..1df37e2 100644 --- a/config.php +++ b/config.php @@ -31,20 +31,22 @@ // Don't touch below // - $urlserv = '$ipserv.":". $portserv' ; - $json = file_get_contents("http://".$ipserv.":".$modport."/"); // get info from server + $urlserv = $ipserv.":".$servport ; + $json = file_get_contents("http://".$ipserv.":".$modport."/"); // get info from server + $modnum = json_decode($json); + + +/* // if (!$json) { //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 = json_decode($json); //converts to an array of objects - + // $objlower = json_decode($json); //converts to an array of objects // } else { // $mods = ""; // } - +*/ // librarie SQ - info serv game require 'SQ_/bootstrap.php'; diff --git a/index.php b/index.php index 407d6c7..a766ec1 100644 --- a/index.php +++ b/index.php @@ -177,7 +177,7 @@ $sec = "300";
- x ".$timespeed." - x ".$timespeedn." "; @@ -281,7 +281,7 @@ $sec = "300";
MOD actif
- +
@@ -405,7 +405,7 @@ $sec = "300";
- Mods + Mods
@@ -504,7 +504,7 @@ $sec = "300";

- MODS + MODS IP:

@@ -521,8 +521,8 @@ $sec = "300";

- + name; ?>