diff options
Diffstat (limited to '_site/includes')
-rw-r--r-- | _site/includes/dom/header.php | 4 | ||||
-rw-r--r-- | _site/includes/telemetry.php | 30 |
2 files changed, 33 insertions, 1 deletions
diff --git a/_site/includes/dom/header.php b/_site/includes/dom/header.php index 15beaa1..97b8fb7 100644 --- a/_site/includes/dom/header.php +++ b/_site/includes/dom/header.php @@ -1,6 +1,8 @@ <?php
-$GLOBALS["experimentalUIisStable"] = false;
+$GLOBALS["experimentalUIisStable"] = true;
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/telemetry.php";
if ((isset($_COOKIE['_UnchainedTech_ExperimentalUI']) && $_COOKIE['_UnchainedTech_ExperimentalUI'] === "true") || $GLOBALS["experimentalUIisStable"]) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/dom/v2/header.php";
diff --git a/_site/includes/telemetry.php b/_site/includes/telemetry.php new file mode 100644 index 0000000..cb82c40 --- /dev/null +++ b/_site/includes/telemetry.php @@ -0,0 +1,30 @@ +<?php + +$db = json_decode(file_get_contents("/mnt/minteckrolt-main/includes/telemetry.json"), true); + +$ip = md5($_SERVER['REMOTE_ADDR']); +$day = date('d'); +$month = date('m'); +$year = date('y'); +$url = "unchained:" .explode("?", $_SERVER['REQUEST_URI'])[0]; + +if (!isset($db[$year]) && $_SERVER['PHP_SELF'] !== "/404.php") { + $db[$year] = []; +} +if (!isset($db[$year][$month]) && $_SERVER['PHP_SELF'] !== "/404.php") { + $db[$year][$month] = []; +} +if (!isset($db[$year][$month][$day]) && $_SERVER['PHP_SELF'] !== "/404.php") { + $db[$year][$month][$day] = []; +} +if (!isset($db[$year][$month][$day][$url]) && $_SERVER['PHP_SELF'] !== "/404.php") { + $db[$year][$month][$day][$url] = []; +} + +if (!in_array($ip, $db[$year][$month][$day][$url]) && substr($_SERVER['PHP_SELF'], 0, 5) !== "/errs") { + array_push($db[$year][$month][$day][$url], $ip); +} + +if (trim(json_encode($db, JSON_PRETTY_PRINT)) !== "null") { + file_put_contents("/mnt/minteckrolt-main/includes/telemetry.json", json_encode($db, JSON_PRETTY_PRINT)); +}
\ No newline at end of file |