summaryrefslogtreecommitdiff
path: root/includes/util
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
commit9337aae8b1c87fad34884dacd5cd79d9591c60db (patch)
tree5340f9fa67cd6236e4c879f0057d51d0b1e21361 /includes/util
parent953ddd82e48dd206cef5ac94456549aed13b3ad5 (diff)
downloadpluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.gz
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.bz2
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.zip
Updated 39 files, added 86 files, deleted 40 files and renamed 2 files (automated)
Diffstat (limited to 'includes/util')
-rw-r--r--includes/util/agewarning.inc4
-rw-r--r--includes/util/banner.inc7
-rw-r--r--includes/util/bitset.inc25
-rw-r--r--includes/util/evening.inc68
-rw-r--r--includes/util/functions.inc102
-rw-r--r--includes/util/language.inc3
-rw-r--r--includes/util/profiles.inc97
-rw-r--r--includes/util/pronouns.inc16
-rw-r--r--includes/util/rainbow.inc1
-rw-r--r--includes/util/short.inc1
-rw-r--r--includes/util/timezones.inc148
11 files changed, 68 insertions, 404 deletions
diff --git a/includes/util/agewarning.inc b/includes/util/agewarning.inc
index f8bc650..66a163c 100644
--- a/includes/util/agewarning.inc
+++ b/includes/util/agewarning.inc
@@ -12,7 +12,7 @@ function showWarning($name, $id, $system) {
"Title: " . formatPonypush("⚠️ $name does not have an age or birth year set") . "\r\n" .
"Priority: max\r\n" .
"Tags: switch\r\n" .
- "Actions: view, Edit on Cold Haze, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
+ "Actions: view, Edit on Ponycule, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
'content' => formatPonypush("To make sure they appear on the fronting schedule (and to make sure they can front again), they need to set an age or birth year now.")
]
@@ -26,7 +26,7 @@ function showWarning($name, $id, $system) {
"Title: " . formatPonypush("⚠️ $name does not have an age or birth year set") . "\r\n" .
"Priority: max\r\n" .
"Tags: switch\r\n" .
- "Actions: view, Edit on Cold Haze, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
+ "Actions: view, Edit on Ponycule, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
'content' => formatPonypush("To make sure they still appear on the fronting schedule after March 1st, they need to set an age or birth year now.")
]
diff --git a/includes/util/banner.inc b/includes/util/banner.inc
index 944a701..955b93d 100644
--- a/includes/util/banner.inc
+++ b/includes/util/banner.inc
@@ -22,7 +22,6 @@ function getAge($metadata) {
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $lang; global $pages; global $isLowerLoggedIn;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/pronouns.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/Parsedown.php"; $Parsedown = new Parsedown();
@@ -63,7 +62,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
$prefixes = [];
foreach ($member['proxy_tags'] as $proxy) {
- if ($travelling[$member['id']]["travelling"]) {
+ if (isset($travelling[$member['id']]) && $travelling[$member['id']]["travelling"]) {
if (isset($travelling[$member['id']]['equestria']) && $travelling[$member['id']]['equestria']) {
$prefixes[] = null;
} else {
@@ -194,7 +193,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
$systemData['full_name'] = $system === "gdapd" ? "Raindrops System" : ($system === $app["other"]["id"] ? $app["other"]["name"] : ($system === "hrbom" ? "Moonglow" : "Cloudburst System"));
$systemData['temporary'] = false;
- if ($travelling[$member['id']]["travelling"] && !$travelling[$member['id']]["equestria"]) {
+ if (isset($travelling[$member['id']]) && $travelling[$member['id']]["travelling"] && !$travelling[$member['id']]["equestria"]) {
$systemData['page'] = "/" . ($system === "gdapd" ? "cloudburst" : "raindrops");
$systemData['icon'] = getAsset($system === "gdapd" ? "ynmuc" : "gdapd");
$systemData['name'] = $system === "gdapd" ? "Cloudburst" : "Raindrops";
@@ -202,7 +201,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) {
$systemData['temporary'] = true;
}
- if ($travelling[$member['id']]["travelling"] && $travelling[$member['id']]["equestria"]) {
+ if (isset($travelling[$member['id']]) && $travelling[$member['id']]["travelling"] && $travelling[$member['id']]["equestria"]) {
$systemData['page'] = null;
$systemData['icon'] = "/assets/logo/equestria.png";
$systemData['name'] = "Equestria";
diff --git a/includes/util/bitset.inc b/includes/util/bitset.inc
deleted file mode 100644
index 14f178c..0000000
--- a/includes/util/bitset.inc
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-function parseMetadata ($metadata) {
- $metadata["little"] = 0;
-
- $age = -1;
-
- if (isset($metadata["birth"]["age"]) && $metadata["birth"]["age"] !== 0) {
- $age = $metadata["birth"]["age"];
- } else if (isset($metadata["birth"]["year"]) && $metadata["birth"]["year"] > 1990) {
- $age = (int)date('Y') - $metadata["birth"]["year"] + (strtotime(date('Y') . "-" . $metadata["birth"]["date"]) <= time() ? 0 : -1);
- }
-
- if (is_string($age) && isset(explode("-", $age)[1]) && is_numeric(explode("-", $age)[1])) {
- $age = (int)explode("-", $age)[1];
- }
-
- if ($age > 0 && $age <= 10) {
- $metadata["little"] = 2;
- } else if ($age > 0 && $age <= 15) {
- $metadata["little"] = 3;
- }
-
- return $metadata;
-} \ No newline at end of file
diff --git a/includes/util/evening.inc b/includes/util/evening.inc
deleted file mode 100644
index 58e511e..0000000
--- a/includes/util/evening.inc
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", "[]");
-if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", "{}");
-
-if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
-global $use2023UI;
-
-$pairs = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/pairs.json"), true);
-$ignored = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json"), true);
-$locked = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json"), true);
-
-if (isset($_GET["ignore"]) && isset($_GET["day"])) {
- if ($_GET["ignore"] === "1") {
- if (preg_match("/^\d{4}-\d{2}-\d{2}$/m", $_GET["day"]) === false) {
- header("Location: /$_GET[_]");
- die();
- }
-
- if (!in_array($_GET["day"], $ignored)) {
- $ignored[] = $_GET["day"];
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", json_encode($ignored));
- header("Location: /$_GET[_]");
- die();
- } elseif ($_GET["ignore"] === "0") {
- if (preg_match("/^\d{4}-\d{2}-\d{2}$/m", $_GET["day"]) === false) {
- header("Location: /$_GET[_]");
- die();
- }
-
- if (in_array($_GET["day"], $ignored)) {
- unset($ignored[array_search($_GET["day"], $ignored)]);
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/ignored.json", json_encode($ignored));
- header("Location: /$_GET[_]");
- die();
- }
-
- die();
-}
-
-if (isset($_GET["lock"]) && isset($_GET["day"]) && isset($_GET["data"])) {
- if (isset($locked[$_GET["day"]])) {
- unset($locked[$_GET["day"]]);
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", json_encode($locked));
- header("Location: /$_GET[_]");
- die();
- } else {
- $locked[$_GET["day"]] = $_GET["data"];
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json")) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/cache/evening.json");
-
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/evening/locked.json", json_encode($locked));
- header("Location: /$_GET[_]");
- die();
- }
-} \ No newline at end of file
diff --git a/includes/util/functions.inc b/includes/util/functions.inc
index 0cf15d2..67b1786 100644
--- a/includes/util/functions.inc
+++ b/includes/util/functions.inc
@@ -1,10 +1,54 @@
<?php
+use JetBrains\PhpStorm\NoReturn;
+
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/homepage.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/random.inc";
+if (!function_exists("getMemberPronouns")) {
+ function getMemberPronouns(?string $pronouns): ?array {
+ return [
+ "gender" => "invalid",
+ "gender:fr" => "invalide",
+ "object" => "this pony",
+ "person" => "pony",
+ "possessive_det" => "this pony's",
+ "possessive_pro" => "this pony's",
+ "reflexive" => "this pony",
+ "subjective" => "this pony",
+ "third" => true,
+ "color" => "success"
+ ];
+ }
+}
+
+if (!function_exists("parseMetadata")) {
+ function parseMetadata ($metadata) {
+ $metadata["little"] = 0;
+
+ $age = -1;
+
+ if (isset($metadata["birth"]["age"]) && $metadata["birth"]["age"] !== 0) {
+ $age = $metadata["birth"]["age"];
+ } else if (isset($metadata["birth"]["year"]) && $metadata["birth"]["year"] > 1990) {
+ $age = (int)date('Y') - $metadata["birth"]["year"] + (strtotime(date('Y') . "-" . $metadata["birth"]["date"]) <= time() ? 0 : -1);
+ }
+
+ if (is_string($age) && isset(explode("-", $age)[1]) && is_numeric(explode("-", $age)[1])) {
+ $age = (int)explode("-", $age)[1];
+ }
+
+ if ($age > 0 && $age <= 10) {
+ $metadata["little"] = 2;
+ } else if ($age > 0 && $age <= 15) {
+ $metadata["little"] = 3;
+ }
+
+ return $metadata;
+ }
+}
+
if (!function_exists("pf_utf8_decode")) {
function pf_utf8_decode(string $string): string {
return iconv("UTF-8", "ISO-8859-1", $string);
@@ -30,7 +74,7 @@ if (!function_exists("getLastFronted")) {
}
if (!function_exists("createJob")) {
- function createJob($title, $options) {
+ function createJob($title, $options): void {
$job = [
"name" => $title,
"options" => $options,
@@ -42,7 +86,7 @@ if (!function_exists("createJob")) {
}
if (!function_exists("formatPonypush")) {
- function formatPonypush($message) {
+ function formatPonypush($message): string {
return "Update to Ponypush 3.1.0 or later — (\$PA1$\$" . base64_encode($message) . "\$\$)";
}
}
@@ -54,14 +98,14 @@ if (!function_exists("generateToken")) {
}
if (!function_exists("peh_error")) {
- function peh_error($message, $code = 500): void {
+ #[NoReturn] function peh_error($message, $code = 500): void {
header("Location: /?em=" . urlencode(base64_encode($message)) . "&ec=" . $code);
die();
}
}
if (!function_exists("getAsset")) {
- function getAsset($systemID, $memberID = null, $type = "avatars") {
+ function getAsset($systemID, $memberID = null, $type = "avatars"): string {
$app = $GLOBALS["ColdHazeApp"] ?? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
$systemFile = (isset($app["other"]) && $systemID === $app["other"]["id"]) ? "other" : $systemID;
@@ -132,11 +176,7 @@ if (!function_exists("getAsset")) {
}
if (!function_exists("rgbToHsl")) {
- function rgbToHsl($r, $g, $b) {
- $oldR = $r;
- $oldG = $g;
- $oldB = $b;
-
+ function rgbToHsl($r, $g, $b): array {
$r /= 255;
$g /= 255;
$b /= 255;
@@ -176,13 +216,11 @@ if (!function_exists("rgbToHsl")) {
if (!function_exists("imageCreateCorners")) {
function imageCreateCorners($sourceImageFile, $radius) {
- # test source image
if (file_exists($sourceImageFile)) {
$res = is_array($info = getimagesize($sourceImageFile));
}
else $res = false;
- # open image
if ($res) {
$w = $info[0];
$h = $info[1];
@@ -198,13 +236,11 @@ if (!function_exists("imageCreateCorners")) {
}
}
- # create corners
if ($res) {
- $q = 10; # change this if you want
+ $q = 10;
$radius *= $q;
- # find unique color
do {
$r = rand(0, 255);
$g = rand(0, 255);
@@ -235,14 +271,12 @@ if (!function_exists("imageCreateCorners")) {
imagealphablending($img, true);
imagecolortransparent($img, $alphacolor);
- # resize image down
$dest = imagecreatetruecolor($w, $h);
imagealphablending($dest, false);
imagesavealpha($dest, true);
imagefilledrectangle($dest, 0, 0, $w, $h, $alphacolor);
imagecopyresampled($dest, $img, 0, 0, 0, 0, $w, $h, $nw, $nh);
- # output image
$res = $dest;
imagedestroy($src);
imagedestroy($img);
@@ -253,22 +287,8 @@ if (!function_exists("imageCreateCorners")) {
}
if (!function_exists("getMiniName")) {
- function getMiniName(string $name) {
- $parts = explode(" ", $name);
-
- if (strlen($parts[0]) > 3 && $parts[0] !== "Sweetie" && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn" && $parts[1] !== "Fizz")) {
- if ($parts[0] === "Princess") {
- array_shift($parts);
- }
-
- if (str_contains($parts[0], "/")) {
- return explode("/", $parts[0])[0];
- } else {
- return $parts[0];
- }
- } else {
- return $name;
- }
+ function getMiniName(string $name): string {
+ return $name;
}
}
@@ -339,7 +359,7 @@ if (!function_exists("getMemberWithoutSystem")) {
}
if (!function_exists("showMembersFromList")) {
- function showMembersFromList(array $list) {
+ function showMembersFromList(array $list): void {
foreach ($list as $member) { if ($member['name'] !== "unknown" && $member['name'] !== "fusion") {
echo('<a href="/' . $member['name'] . '" style="text-decoration:none !important;filter:none !important;"><div class="hpd-item-card" style="background-color:rgba(255, 255, 255, .1);border:1px solid ' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';outline-color:' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;' . (isset($member["equestria"]) && $member["equestria"] ? 'opacity:.5;' : '') . '"><div>
<img alt="" src="' . getAsset($member["system"], $member["id"]) . '" style="border-radius:999px;background-color:rgba(0, 0, 0, .25);height:48px;width:48px;display:block;margin-left:auto;margin-right:auto;">
@@ -351,7 +371,7 @@ if (!function_exists("showMembersFromList")) {
}
if (!function_exists("prettySize")) {
- function prettySize($bytes) {
+ function prettySize($bytes): string {
if ($bytes > 1024) {
if ($bytes > 1024**2) {
if ($bytes > 1024**3) {
@@ -369,7 +389,7 @@ if (!function_exists("prettySize")) {
}
if (!function_exists("showSystem")) {
- function showSystem(string $id, string $name, string $color, bool $hideTitle) {
+ function showSystem(string $id, string $name, string $color, bool $hideTitle): void {
$app = $GLOBALS["ColdHazeApp"] ?? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
global $travelling;
@@ -401,7 +421,7 @@ if (!function_exists("showSystem")) {
showMembersFromList(scoreOrder([...array_map(function ($i) use ($id, $travelling) {
$i["travelling"] = false;
$i["system"] = $id;
- $i["equestria"] = $travelling[$i['id']]['travelling'] && $travelling[$i['id']]['equestria'];
+ if (isset($travelling[$i['id']])) $i["equestria"] = $travelling[$i['id']]['travelling'] && $travelling[$i['id']]['equestria'];
return $i;
}, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/members.json"), true), function ($i) use ($travelling) {
return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']));
@@ -549,7 +569,7 @@ if (!function_exists("timeIn")) {
}
if (!function_exists("duration")) {
- function duration($seconds) {
+ function duration($seconds): string {
global $lang; global $pages;
if ($seconds >= 60) {
@@ -586,7 +606,7 @@ if (!function_exists("duration")) {
}
if (!function_exists("relativeDate")) {
- function relativeDate($date, $showTime = true) {
+ function relativeDate($date, $showTime = true): string {
if (!is_numeric($date)) $date = strtotime($date);
if (!$showTime) {
@@ -620,6 +640,8 @@ if (!function_exists("getMemberSystem")) {
foreach ($list as $item) {
if ($item["id"] === $id) return $item["_system"];
}
+
+ return null;
}
}
@@ -630,6 +652,8 @@ if (!function_exists("getMemberFromName")) {
foreach ($list as $item) {
if ($item["name"] === $name) return getMemberWithoutSystem($item["id"]);
}
+
+ return null;
}
}
diff --git a/includes/util/language.inc b/includes/util/language.inc
deleted file mode 100644
index e24255f..0000000
--- a/includes/util/language.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-$lang = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/i18n/en.json"), true); \ No newline at end of file
diff --git a/includes/util/profiles.inc b/includes/util/profiles.inc
deleted file mode 100644
index 66274c7..0000000
--- a/includes/util/profiles.inc
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-function calculateProfileScore($member) {
- $values = [
- ((isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] > 0) || isset($member["_metadata"]["birth"]["year"]) && $member["_metadata"]["birth"]["year"] > 1900) || ((isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] === -1) && in_array("alicorn", $member["_metadata"]["species"])),
- isset($member["_metadata"]["birth"]["date"]) && trim($member["_metadata"]["birth"]["date"]) !== "" && $member["_metadata"]["birth"]["date"] !== "01-01",
- file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) > 200,
- file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) > 200,
- isset($member["banner"]),
- file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png"),
- isset($member["color"])
- ];
-
- $result = [
- "values" => $values,
- "pages" => [],
- "characters" => [],
- "score" => (float)array_reduce($values, function ($a, $b) {
- return $a + $b;
- }),
- "score2" => (float)array_reduce($values, function ($a, $b) {
- return $a + $b;
- }),
- "actions" => []
- ];
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) <= 200) {
- $result["pages"][] = true;
- $result["score"] += strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html"))) / 201;
- } else {
- $result["pages"][] = false;
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html") && strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) <= 200) {
- $result["pages"][] = true;
- $result["score"] += strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html"))) / 201;
- } else {
- $result["pages"][] = false;
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html")) {
- $result["characters"][] = strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . ".html")));
- } else {
- $result["characters"][] = -1;
- }
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html")) {
- $result["characters"][] = strlen(preg_replace("/[^a-zA-Z0-9]/m", "", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member["id"] . "-private.html")));
- } else {
- $result["characters"][] = -1;
- }
-
- if (!((isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] > 0) || isset($member["_metadata"]["birth"]["year"]) && $member["_metadata"]["birth"]["year"] > 1900) && !(isset($member["_metadata"]["birth"]["age"]) && $member["_metadata"]["birth"]["age"] === -1) && in_array("alicorn", $member["_metadata"]["species"])) {
- $result["score"] += 0.5;
- }
-
- $result["progress"] = $result["score"] / 7;
- $result["sortable"] = (int)($result["progress"] * 100000000000000);
-
- if (!$result["values"][5]) {
- $result["actions"][] = "a Pony Town character";
- }
-
- if (!$result["values"][6]) {
- $result["actions"][] = "a color";
- }
-
- if (!$result["values"][2]) {
- if ($result["characters"][0] === -1) {
- $result["actions"][] = "a public page";
- } else {
- $result["actions"][] = (200 - $result["characters"][0]) . " characters to the public page";
- }
- }
-
- if (!$result["values"][3]) {
- if ($result["characters"][1] === -1) {
- $result["actions"][] = "a private page";
- } else {
- $result["actions"][] = (200 - $result["characters"][1]) . " characters to the private page";
- }
- }
-
- if (!$result["values"][4]) {
- $result["actions"][] = "a banner";
- }
-
- if (!$result["values"][0]) {
- $result["actions"][] = "an age";
- }
-
- if (!$result["values"][1]) {
- $result["actions"][] = "a birthdate";
- }
-
- return $result;
-} \ No newline at end of file
diff --git a/includes/util/pronouns.inc b/includes/util/pronouns.inc
deleted file mode 100644
index b7c8dd4..0000000
--- a/includes/util/pronouns.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-function getMemberPronouns(?string $pronouns): ?array {
- return [
- "gender" => "invalid",
- "gender:fr" => "invalide",
- "object" => "this pony",
- "person" => "pony",
- "possessive_det" => "this pony's",
- "possessive_pro" => "this pony's",
- "reflexive" => "this pony",
- "subjective" => "this pony",
- "third" => true,
- "color" => "success"
- ];
-} \ No newline at end of file
diff --git a/includes/util/rainbow.inc b/includes/util/rainbow.inc
index dc4d687..3dc9480 100644
--- a/includes/util/rainbow.inc
+++ b/includes/util/rainbow.inc
@@ -1,7 +1,6 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc";
function rainbow($hideCloudburst = false): array {
diff --git a/includes/util/short.inc b/includes/util/short.inc
index b586469..81c389d 100644
--- a/includes/util/short.inc
+++ b/includes/util/short.inc
@@ -1,7 +1,6 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/score.inc";
global $toplevel; global $lang; global $pages;
diff --git a/includes/util/timezones.inc b/includes/util/timezones.inc
deleted file mode 100644
index 040e2e6..0000000
--- a/includes/util/timezones.inc
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-
-global $timezones;
-$timezones = [
- '(UTC-11:00) Midway Island' => 'Pacific/Midway',
- '(UTC-11:00) Samoa' => 'Pacific/Samoa',
- '(UTC-10:00) Hawaii' => 'Pacific/Honolulu',
- '(UTC-09:00) Alaska' => 'US/Alaska',
- '(UTC-08:00) Pacific Time (US &amp; Canada)' => 'America/Los_Angeles',
- '(UTC-08:00) Tijuana' => 'America/Tijuana',
- '(UTC-07:00) Arizona' => 'US/Arizona',
- '(UTC-07:00) Chihuahua' => 'America/Chihuahua',
- '(UTC-07:00) La Paz' => 'America/Chihuahua',
- '(UTC-07:00) Mazatlan' => 'America/Mazatlan',
- '(UTC-07:00) Mountain Time (US &amp; Canada)' => 'US/Mountain',
- '(UTC-06:00) Central America' => 'America/Managua',
- '(UTC-06:00) Central Time (US &amp; Canada)' => 'US/Central',
- '(UTC-06:00) Guadalajara' => 'America/Mexico_City',
- '(UTC-06:00) Mexico City' => 'America/Mexico_City',
- '(UTC-06:00) Monterrey' => 'America/Monterrey',
- '(UTC-06:00) Saskatchewan' => 'Canada/Saskatchewan',
- '(UTC-05:00) Bogota' => 'America/Bogota',
- '(UTC-05:00) Eastern Time (US &amp; Canada)' => 'US/Eastern',
- '(UTC-05:00) Indiana (East)' => 'US/East-Indiana',
- '(UTC-05:00) Lima' => 'America/Lima',
- '(UTC-05:00) Quito' => 'America/Bogota',
- '(UTC-04:00) Atlantic Time (Canada)' => 'Canada/Atlantic',
- '(UTC-04:30) Caracas' => 'America/Caracas',
- '(UTC-04:00) La Paz' => 'America/La_Paz',
- '(UTC-04:00) Santiago' => 'America/Santiago',
- '(UTC-03:30) Newfoundland' => 'Canada/Newfoundland',
- '(UTC-03:00) Brasilia' => 'America/Sao_Paulo',
- '(UTC-03:00) Buenos Aires' => 'America/Argentina/Buenos_Aires',
- '(UTC-03:00) Georgetown' => 'America/Argentina/Buenos_Aires',
- '(UTC-03:00) Greenland' => 'America/Godthab',
- '(UTC-02:00) Mid-Atlantic' => 'America/Noronha',
- '(UTC-01:00) Azores' => 'Atlantic/Azores',
- '(UTC-01:00) Cape Verde Is.' => 'Atlantic/Cape_Verde',
- '(UTC+00:00) Casablanca' => 'Africa/Casablanca',
- '(UTC+00:00) Edinburgh' => 'Europe/London',
- '(UTC+00:00) Greenwich Mean Time : Dublin' => 'Etc/Greenwich',
- '(UTC+00:00) Lisbon' => 'Europe/Lisbon',
- '(UTC+00:00) London' => 'Europe/London',
- '(UTC+00:00) Monrovia' => 'Africa/Monrovia',
- '(UTC+00:00) UTC' => 'UTC',
- '(UTC+01:00) Amsterdam' => 'Europe/Amsterdam',
- '(UTC+01:00) Belgrade' => 'Europe/Belgrade',
- '(UTC+01:00) Berlin' => 'Europe/Berlin',
- '(UTC+01:00) Bern' => 'Europe/Berlin',
- '(UTC+01:00) Bratislava' => 'Europe/Bratislava',
- '(UTC+01:00) Brussels' => 'Europe/Brussels',
- '(UTC+01:00) Budapest' => 'Europe/Budapest',
- '(UTC+01:00) Copenhagen' => 'Europe/Copenhagen',
- '(UTC+01:00) Ljubljana' => 'Europe/Ljubljana',
- '(UTC+01:00) Madrid' => 'Europe/Madrid',
- '(UTC+01:00) Paris' => 'Europe/Paris',
- '(UTC+01:00) Prague' => 'Europe/Prague',
- '(UTC+01:00) Rome' => 'Europe/Rome',
- '(UTC+01:00) Sarajevo' => 'Europe/Sarajevo',
- '(UTC+01:00) Skopje' => 'Europe/Skopje',
- '(UTC+01:00) Stockholm' => 'Europe/Stockholm',
- '(UTC+01:00) Vienna' => 'Europe/Vienna',
- '(UTC+01:00) Warsaw' => 'Europe/Warsaw',
- '(UTC+01:00) West Central Africa' => 'Africa/Lagos',
- '(UTC+01:00) Zagreb' => 'Europe/Zagreb',
- '(UTC+02:00) Athens' => 'Europe/Athens',
- '(UTC+02:00) Bucharest' => 'Europe/Bucharest',
- '(UTC+02:00) Cairo' => 'Africa/Cairo',
- '(UTC+02:00) Harare' => 'Africa/Harare',
- '(UTC+02:00) Helsinki' => 'Europe/Helsinki',
- '(UTC+02:00) Istanbul' => 'Europe/Istanbul',
- '(UTC+02:00) Jerusalem' => 'Asia/Jerusalem',
- '(UTC+02:00) Kyiv' => 'Europe/Helsinki',
- '(UTC+02:00) Pretoria' => 'Africa/Johannesburg',
- '(UTC+02:00) Riga' => 'Europe/Riga',
- '(UTC+02:00) Sofia' => 'Europe/Sofia',
- '(UTC+02:00) Tallinn' => 'Europe/Tallinn',
- '(UTC+02:00) Vilnius' => 'Europe/Vilnius',
- '(UTC+03:00) Baghdad' => 'Asia/Baghdad',
- '(UTC+03:00) Kuwait' => 'Asia/Kuwait',
- '(UTC+03:00) Minsk' => 'Europe/Minsk',
- '(UTC+03:00) Nairobi' => 'Africa/Nairobi',
- '(UTC+03:00) Riyadh' => 'Asia/Riyadh',
- '(UTC+03:00) Volgograd' => 'Europe/Volgograd',
- '(UTC+03:30) Tehran' => 'Asia/Tehran',
- '(UTC+04:00) Abu Dhabi' => 'Asia/Muscat',
- '(UTC+04:00) Baku' => 'Asia/Baku',
- '(UTC+04:00) Moscow' => 'Europe/Moscow',
- '(UTC+04:00) Muscat' => 'Asia/Muscat',
- '(UTC+04:00) St. Petersburg' => 'Europe/Moscow',
- '(UTC+04:00) Tbilisi' => 'Asia/Tbilisi',
- '(UTC+04:00) Yerevan' => 'Asia/Yerevan',
- '(UTC+04:30) Kabul' => 'Asia/Kabul',
- '(UTC+05:00) Islamabad' => 'Asia/Karachi',
- '(UTC+05:00) Karachi' => 'Asia/Karachi',
- '(UTC+05:00) Tashkent' => 'Asia/Tashkent',
- '(UTC+05:30) Chennai' => 'Asia/Calcutta',
- '(UTC+05:30) Kolkata' => 'Asia/Kolkata',
- '(UTC+05:30) Mumbai' => 'Asia/Calcutta',
- '(UTC+05:30) New Delhi' => 'Asia/Calcutta',
- '(UTC+05:30) Sri Jayawardenepura' => 'Asia/Calcutta',
- '(UTC+05:45) Kathmandu' => 'Asia/Katmandu',
- '(UTC+06:00) Almaty' => 'Asia/Almaty',
- '(UTC+06:00) Astana' => 'Asia/Dhaka',
- '(UTC+06:00) Dhaka' => 'Asia/Dhaka',
- '(UTC+06:00) Ekaterinburg' => 'Asia/Yekaterinburg',
- '(UTC+06:30) Rangoon' => 'Asia/Rangoon',
- '(UTC+07:00) Bangkok' => 'Asia/Bangkok',
- '(UTC+07:00) Hanoi' => 'Asia/Bangkok',
- '(UTC+07:00) Jakarta' => 'Asia/Jakarta',
- '(UTC+07:00) Novosibirsk' => 'Asia/Novosibirsk',
- '(UTC+08:00) Beijing' => 'Asia/Hong_Kong',
- '(UTC+08:00) Chongqing' => 'Asia/Chongqing',
- '(UTC+08:00) Hong Kong' => 'Asia/Hong_Kong',
- '(UTC+08:00) Krasnoyarsk' => 'Asia/Krasnoyarsk',
- '(UTC+08:00) Kuala Lumpur' => 'Asia/Kuala_Lumpur',
- '(UTC+08:00) Perth' => 'Australia/Perth',
- '(UTC+08:00) Singapore' => 'Asia/Singapore',
- '(UTC+08:00) Taipei' => 'Asia/Taipei',
- '(UTC+08:00) Ulaan Bataar' => 'Asia/Ulan_Bator',
- '(UTC+08:00) Urumqi' => 'Asia/Urumqi',
- '(UTC+09:00) Irkutsk' => 'Asia/Irkutsk',
- '(UTC+09:00) Osaka' => 'Asia/Tokyo',
- '(UTC+09:00) Sapporo' => 'Asia/Tokyo',
- '(UTC+09:00) Seoul' => 'Asia/Seoul',
- '(UTC+09:00) Tokyo' => 'Asia/Tokyo',
- '(UTC+09:30) Adelaide' => 'Australia/Adelaide',
- '(UTC+09:30) Darwin' => 'Australia/Darwin',
- '(UTC+10:00) Brisbane' => 'Australia/Brisbane',
- '(UTC+10:00) Canberra' => 'Australia/Canberra',
- '(UTC+10:00) Guam' => 'Pacific/Guam',
- '(UTC+10:00) Hobart' => 'Australia/Hobart',
- '(UTC+10:00) Melbourne' => 'Australia/Melbourne',
- '(UTC+10:00) Port Moresby' => 'Pacific/Port_Moresby',
- '(UTC+10:00) Sydney' => 'Australia/Sydney',
- '(UTC+10:00) Yakutsk' => 'Asia/Yakutsk',
- '(UTC+11:00) Vladivostok' => 'Asia/Vladivostok',
- '(UTC+12:00) Auckland' => 'Pacific/Auckland',
- '(UTC+12:00) Fiji' => 'Pacific/Fiji',
- '(UTC+12:00) International Date Line West' => 'Pacific/Kwajalein',
- '(UTC+12:00) Kamchatka' => 'Asia/Kamchatka',
- '(UTC+12:00) Magadan' => 'Asia/Magadan',
- '(UTC+12:00) Marshall Is.' => 'Pacific/Fiji',
- '(UTC+12:00) New Caledonia' => 'Asia/Magadan',
- '(UTC+12:00) Solomon Is.' => 'Asia/Magadan',
- '(UTC+12:00) Wellington' => 'Pacific/Auckland',
- '(UTC+13:00) Nuku\'alofa' => 'Pacific/Tongatapu'
-]; \ No newline at end of file