aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-04 17:44:08 +0200
committerMinteck <nekostarfan@gmail.com>2021-08-04 17:44:08 +0200
commit2dd699bee894bff8976737e51902c16823f9af61 (patch)
tree39b298671bb72da734396249840b295924b5323d
parent896fa7c96856142f844d958b049d5432f511641c (diff)
downloadunchainedtech-2dd699bee894bff8976737e51902c16823f9af61.tar.gz
unchainedtech-2dd699bee894bff8976737e51902c16823f9af61.tar.bz2
unchainedtech-2dd699bee894bff8976737e51902c16823f9af61.zip
Added telemetry that syncs with Minteck Space
-rw-r--r--_site/includes/dom/header.php4
-rw-r--r--_site/includes/telemetry.php30
-rw-r--r--version.txt2
3 files changed, 34 insertions, 2 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
diff --git a/version.txt b/version.txt
index f9ae3b7..99dd26d 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-2.0.1211 \ No newline at end of file
+2.1.1212 \ No newline at end of file