From 108525534c28013cfe1897c30e4565f9893f3766 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 10 Oct 2022 20:51:39 +0200 Subject: Update --- includes/ai.inc | 311 +++++++++++++ includes/ai.php | 311 ------------- includes/assets.inc | 55 +++ includes/backup.inc | 102 ++++ includes/backup.php | 102 ---- includes/banner.inc | 456 ++++++++++++++++++ includes/banner.php | 456 ------------------ includes/bitset.inc | 110 +++++ includes/bitset.php | 110 ----- includes/edit-private.inc | 147 ++++++ includes/edit-private.php | 147 ------ includes/edit.inc | 147 ++++++ includes/edit.php | 147 ------ includes/emergency.inc | 194 ++++++++ includes/emergency.php | 194 -------- includes/footer.inc | 36 ++ includes/footer.php | 35 -- includes/functions.inc | 477 +++++++++++++++++++ includes/functions.php | 319 ------------- includes/header.inc | 1001 ++++++++++++++++++++++++++++++++++++++++ includes/header.php | 963 -------------------------------------- includes/icons.inc | 5 + includes/init.inc | 28 ++ includes/init.php | 18 - includes/keywords.inc | 110 +++++ includes/keywords.php | 110 ----- includes/logo.inc | 97 ++++ includes/member.inc | 268 +++++++++++ includes/member.php | 268 ----------- includes/member/hierarchy.inc | 177 +++++++ includes/member/hierarchy.php | 177 ------- includes/member/tree.inc | 8 + includes/member/tree.php | 8 - includes/pages.json | 116 +++-- includes/planner.inc | 1025 +++++++++++++++++++++++++++++++++++++++++ includes/planner.php | 926 ------------------------------------- includes/pleasure.inc | 114 +++++ includes/pleasure.php | 114 ----- includes/pronouns.inc | 149 ++++++ includes/pronouns.php | 149 ------ includes/rail.inc | 176 +++++++ includes/rainbow.inc | 57 +++ includes/rainbow.php | 97 ---- includes/random.inc | 15 + includes/random.php | 15 - includes/refresh.php | 144 +++++- includes/restore.inc | 130 ++++++ includes/restore.php | 130 ------ includes/score.inc | 86 ++++ includes/score.php | 81 ---- includes/search.inc | 529 +++++++++++++++++++++ includes/search.php | 529 --------------------- includes/session.inc | 41 ++ includes/session.php | 41 -- includes/short.inc | 52 +++ includes/short.php | 52 --- includes/subsysbanner.inc | 70 +++ includes/subsysbanner.php | 69 --- includes/subsysedit.inc | 143 ++++++ includes/subsysedit.php | 143 ------ includes/sysbanner.inc | 132 ++++++ includes/sysbanner.php | 132 ------ includes/sysedit.inc | 143 ++++++ includes/sysedit.php | 143 ------ includes/system.inc | 19 + includes/system.php | 19 - includes/system/compare.inc | 189 ++++++++ includes/system/compare.php | 189 -------- includes/system/history.inc | 528 +++++++++++++++++++++ includes/system/history.php | 460 ------------------ includes/system/species.inc | 70 +++ includes/system/species.php | 70 --- includes/system/subsystem.inc | 100 ++++ includes/system/subsystem.php | 100 ---- includes/system/tree.inc | 114 +++++ includes/system/tree.php | 114 ----- includes/travelling.inc | 47 ++ includes/travelling.php | 47 -- includes/wakeup.inc | 114 +++++ includes/wakeup.php | 114 ----- 80 files changed, 7983 insertions(+), 7148 deletions(-) create mode 100644 includes/ai.inc delete mode 100644 includes/ai.php create mode 100644 includes/assets.inc create mode 100644 includes/backup.inc delete mode 100644 includes/backup.php create mode 100644 includes/banner.inc delete mode 100644 includes/banner.php create mode 100644 includes/bitset.inc delete mode 100644 includes/bitset.php create mode 100644 includes/edit-private.inc delete mode 100644 includes/edit-private.php create mode 100644 includes/edit.inc delete mode 100644 includes/edit.php create mode 100644 includes/emergency.inc delete mode 100644 includes/emergency.php create mode 100644 includes/footer.inc delete mode 100644 includes/footer.php create mode 100644 includes/functions.inc delete mode 100644 includes/functions.php create mode 100644 includes/header.inc delete mode 100644 includes/header.php create mode 100644 includes/icons.inc create mode 100644 includes/init.inc delete mode 100644 includes/init.php create mode 100644 includes/keywords.inc delete mode 100644 includes/keywords.php create mode 100644 includes/logo.inc create mode 100644 includes/member.inc delete mode 100644 includes/member.php create mode 100644 includes/member/hierarchy.inc delete mode 100644 includes/member/hierarchy.php create mode 100644 includes/member/tree.inc delete mode 100644 includes/member/tree.php create mode 100644 includes/planner.inc delete mode 100644 includes/planner.php create mode 100644 includes/pleasure.inc delete mode 100644 includes/pleasure.php create mode 100644 includes/pronouns.inc delete mode 100644 includes/pronouns.php create mode 100644 includes/rail.inc create mode 100644 includes/rainbow.inc delete mode 100644 includes/rainbow.php create mode 100644 includes/random.inc delete mode 100644 includes/random.php create mode 100644 includes/restore.inc delete mode 100644 includes/restore.php create mode 100644 includes/score.inc delete mode 100644 includes/score.php create mode 100644 includes/search.inc delete mode 100644 includes/search.php create mode 100644 includes/session.inc delete mode 100644 includes/session.php create mode 100644 includes/short.inc delete mode 100644 includes/short.php create mode 100644 includes/subsysbanner.inc delete mode 100644 includes/subsysbanner.php create mode 100644 includes/subsysedit.inc delete mode 100644 includes/subsysedit.php create mode 100644 includes/sysbanner.inc delete mode 100644 includes/sysbanner.php create mode 100644 includes/sysedit.inc delete mode 100644 includes/sysedit.php create mode 100644 includes/system.inc delete mode 100644 includes/system.php create mode 100644 includes/system/compare.inc delete mode 100644 includes/system/compare.php create mode 100644 includes/system/history.inc delete mode 100644 includes/system/history.php create mode 100644 includes/system/species.inc delete mode 100644 includes/system/species.php create mode 100644 includes/system/subsystem.inc delete mode 100644 includes/system/subsystem.php create mode 100644 includes/system/tree.inc delete mode 100644 includes/system/tree.php create mode 100644 includes/travelling.inc delete mode 100644 includes/travelling.php create mode 100644 includes/wakeup.inc delete mode 100644 includes/wakeup.php (limited to 'includes') diff --git a/includes/ai.inc b/includes/ai.inc new file mode 100644 index 0000000..8f5f7ba --- /dev/null +++ b/includes/ai.inc @@ -0,0 +1,311 @@ + $metadata["robot"] ? + "robot earth pony" : + (!$metadata["plush"] ? "earth pony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : + "earth pony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), + "alicorn" => $metadata["robot"] ? + "robot alicorn" : + (!$metadata["plush"] ? "alicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : + "alicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), + "crystal" => $metadata["robot"] ? + "robot crystal pony" : + (!$metadata["plush"] ? "crystal pony" : + "crystal pony plush"), + "pegasus" => $metadata["robot"] ? + "robot pegasus" : + (!$metadata["plush"] ? "pegasus" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : + "pegasus" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), + "batpony" => $metadata["robot"] ? + "robot batpony" : + (!$metadata["plush"] ? "batpony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : + "batpony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), + "unicorn" => $metadata["robot"] ? + "robot unicorn" : + (!$metadata["plush"] ? "unicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : + "unicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), + default => $species . "_" . $metadata["robot"] + }; + } +} + +if (!function_exists("listing")) { + function listing(array $list): string { + $out = ""; + + foreach (array_values($list) as $index => $value) { + $mem = getSystemMember(explode("/", $value)[0], explode("/", $value)[1]); + $value = "" . getMiniName($mem["display_name"] ?? $mem["name"]) . ""; + + if ($index === 0) { + $out = $value; + } else if ($index < count(array_values($list)) - 1) { + $out .= ", " . $value; + } else { + $out .= " and " . $value; + } + } + + return $out; + } +} + +$iam = 0; +$multipleNames = count(explode("/", $memberData["display_name"])) > 1; + +$otherNames = explode("/", $memberData["display_name"]); +array_shift($otherNames); + +if ($memberData["name"] === "scootaloo" && ((int)date('N') - 1) % 2 === 0) { + $metadata["marefriends"] = array_reverse($metadata["marefriends"]); +} + +?> + + +

+ + Hello, + + Hi, + + Hey, + + Hey there!

+ + + + , + + + +the most common fronter +a protector + +of the , + 0): $source = getMember($metadata["median"]); ?> ">, + = 3) ? "and" : (component(2, 2, 1) ? "I'm" : "I am") ?> + + += 3 && component(2, 1, 4)): ?>also + +a and a + +a , a and a + +a = 3 && component(2, 2, 4)): ?> too +, +. + +

+ +

+ + + + Depending on the circumstances, I may not share memories with my headmates + + I may not share memories with my headmates depending on the circumstances + + I sometimes share memories with my headmates + + + + I share memories with my headmates + + I have access to my headmates' memories + + I have access to my headmates' memories + + + + + + + a fictive + + from Equestria + + I come from Equestria + + + + + + + fronting less often + + less often at front + + I like to front less often + + + + + + + nonverbal in real life + + not talking in real life + + I don't talk in real life + + + + + + + 0): ?> + an age regressor + + 0): ?> + capable of age regression + + I can age regress + + + + + + + 0): ?> + younger than the body is + + 0): ?> + younger but not enough to be considered a little + + I feel younger than my headmates + + + + + 0)): ?> + + 0): ?> + affected by spells to make me feel younger + + 0): ?> + affected by age spells + + age regression spells can affect me + + + + + + + 0): ?> + a lot younger than the body is + + 0): ?> + a little + + I feel a lot younger than my headmates + + + +

+ +

+ + + 0): ?> + + 0): ?> + 1): ?>in relationships within a relationship with + + 0): ?> + 1): ?>My marefriends areMy marefriend is + + 0): ?> + 1): ?>are my marefriendsis my marefriend + + I love + + + + + 0): ?> + + 0): ?> + 1): ?>in relationships within a relationship with + + 0): ?> + 1): ?> sisters are sister is + + 0): ?> + 1): ?>are my sistersis my sister + + + I also love as sister 1): ?>s + + 1): ?>are my familyis my family + + + + + + 0): ?> + + 0): ?> + being taken care of by + + 0): ?> + 1): ?> mares who take care of me are mare who takes care of me is + + 0): ?> + 1): ?>are my caretakersis my caretaker + + + I like having take care of me + + take care of me + + + + +

\ No newline at end of file diff --git a/includes/ai.php b/includes/ai.php deleted file mode 100644 index 8f5f7ba..0000000 --- a/includes/ai.php +++ /dev/null @@ -1,311 +0,0 @@ - $metadata["robot"] ? - "robot earth pony" : - (!$metadata["plush"] ? "earth pony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "earth pony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - "alicorn" => $metadata["robot"] ? - "robot alicorn" : - (!$metadata["plush"] ? "alicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "alicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - "crystal" => $metadata["robot"] ? - "robot crystal pony" : - (!$metadata["plush"] ? "crystal pony" : - "crystal pony plush"), - "pegasus" => $metadata["robot"] ? - "robot pegasus" : - (!$metadata["plush"] ? "pegasus" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "pegasus" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - "batpony" => $metadata["robot"] ? - "robot batpony" : - (!$metadata["plush"] ? "batpony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "batpony" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - "unicorn" => $metadata["robot"] ? - "robot unicorn" : - (!$metadata["plush"] ? "unicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") : - "unicorn" . (component(2, 2) && $canHaveMareSuffix ? " mare" : "") . " plush"), - default => $species . "_" . $metadata["robot"] - }; - } -} - -if (!function_exists("listing")) { - function listing(array $list): string { - $out = ""; - - foreach (array_values($list) as $index => $value) { - $mem = getSystemMember(explode("/", $value)[0], explode("/", $value)[1]); - $value = "" . getMiniName($mem["display_name"] ?? $mem["name"]) . ""; - - if ($index === 0) { - $out = $value; - } else if ($index < count(array_values($list)) - 1) { - $out .= ", " . $value; - } else { - $out .= " and " . $value; - } - } - - return $out; - } -} - -$iam = 0; -$multipleNames = count(explode("/", $memberData["display_name"])) > 1; - -$otherNames = explode("/", $memberData["display_name"]); -array_shift($otherNames); - -if ($memberData["name"] === "scootaloo" && ((int)date('N') - 1) % 2 === 0) { - $metadata["marefriends"] = array_reverse($metadata["marefriends"]); -} - -?> - - -

- - Hello, - - Hi, - - Hey, - - Hey there!

- - - - , - - - -the most common fronter -a protector - -of the , - 0): $source = getMember($metadata["median"]); ?> ">, - = 3) ? "and" : (component(2, 2, 1) ? "I'm" : "I am") ?> - - -= 3 && component(2, 1, 4)): ?>also - -a and a - -a , a and a - -a = 3 && component(2, 2, 4)): ?> too -, -. - -

- -

- - - - Depending on the circumstances, I may not share memories with my headmates - - I may not share memories with my headmates depending on the circumstances - - I sometimes share memories with my headmates - - - - I share memories with my headmates - - I have access to my headmates' memories - - I have access to my headmates' memories - - - - - - - a fictive - - from Equestria - - I come from Equestria - - - - - - - fronting less often - - less often at front - - I like to front less often - - - - - - - nonverbal in real life - - not talking in real life - - I don't talk in real life - - - - - - - 0): ?> - an age regressor - - 0): ?> - capable of age regression - - I can age regress - - - - - - - 0): ?> - younger than the body is - - 0): ?> - younger but not enough to be considered a little - - I feel younger than my headmates - - - - - 0)): ?> - - 0): ?> - affected by spells to make me feel younger - - 0): ?> - affected by age spells - - age regression spells can affect me - - - - - - - 0): ?> - a lot younger than the body is - - 0): ?> - a little - - I feel a lot younger than my headmates - - - -

- -

- - - 0): ?> - - 0): ?> - 1): ?>in relationships within a relationship with - - 0): ?> - 1): ?>My marefriends areMy marefriend is - - 0): ?> - 1): ?>are my marefriendsis my marefriend - - I love - - - - - 0): ?> - - 0): ?> - 1): ?>in relationships within a relationship with - - 0): ?> - 1): ?> sisters are sister is - - 0): ?> - 1): ?>are my sistersis my sister - - - I also love as sister 1): ?>s - - 1): ?>are my familyis my family - - - - - - 0): ?> - - 0): ?> - being taken care of by - - 0): ?> - 1): ?> mares who take care of me are mare who takes care of me is - - 0): ?> - 1): ?>are my caretakersis my caretaker - - - I like having take care of me - - take care of me - - - - -

\ No newline at end of file diff --git a/includes/assets.inc b/includes/assets.inc new file mode 100644 index 0000000..9a0a9ac --- /dev/null +++ b/includes/assets.inc @@ -0,0 +1,55 @@ + date('c'), + "files" => [] +]; + +foreach ($root as $file) { + if ($file === "backup.poniesbackup" || $file === "backup.ponieskey" || $file === "encrypted" || str_ends_with($file, ".poniesbackup")) continue; + echo(" /$file\n"); + + if (is_dir("data/$file")) { + foreach (array_filter(scandir("data/$file"), function ($i) { + return !str_starts_with($i, "."); + }) as $dirfile) { + if ($dirfile === "backup.poniesbackup" || $dirfile === "backup.ponieskey" || $dirfile === "encrypted" || str_ends_with($dirfile, ".poniesbackup")) continue; + + echo(" /$dirfile/$file\n"); + $files[] = [ + "dir" => $file, + "file" => $dirfile + ]; + } + } else { + echo(" /$file\n"); + $files[] = [ + "dir" => "", + "file" => $file + ]; + } +} + +echo(" Reading files...\n"); +foreach ($files as $file) { + echo(" /$file[dir]/$file[file]\n"); + $file["mime"] = mime_content_type("data/$file[dir]/$file[file]"); + $file["checksum"] = [ + sha1_file("data/$file[dir]/$file[file]"), + md5_file("data/$file[dir]/$file[file]") + ]; + $file["content"] = base64_encode(file_get_contents("data/$file[dir]/$file[file]")); + + $data["files"][] = $file; +} + +function pkcs7_pad($data, $size) { + $length = $size - strlen($data) % $size; + return $data . str_repeat(chr($length), $length); +} + +if (!file_exists("./data/backup.ponieskey")) { + echo(" Reading encryption key...\n"); + $key = openssl_random_pseudo_bytes(512); + $iv = openssl_random_pseudo_bytes(16); + file_put_contents("./data/backup.ponieskey", base64_encode(json_encode([ + "iv" => bin2hex($iv), + "key" => bin2hex($key) + ]))); +} else { + echo(" Creating encryption key...\n"); + $key_raw = json_decode(base64_decode(file_get_contents("./data/backup.ponieskey")), true); + $key = hex2bin($key_raw["key"]); + $iv = hex2bin($key_raw["iv"]); +} + +echo(" Encrypting...\n"); +$payload = json_encode($data); +$encrypted = openssl_encrypt(pkcs7_pad($payload, 16), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv); + +echo(" Writing backup...\n"); +file_put_contents("./data/backup.poniesbackup", $encrypted); +@mkdir("./data/encrypted"); + +$id = str_replace(":", "-", date('c')); +copy("./data/backup.poniesbackup", "./data/encrypted/" . $id . ".poniesbackup"); + +echo(" Uploading to servers...\n"); + +echo(" bridlewood... upload\n"); +exec("scp ./data/encrypted/" . $id . ".poniesbackup fedora@bridlewood.equestria.dev:/opt/ponies"); +echo(" bridlewood... cleaning up\n"); +exec('ssh fedora@bridlewood.equestria.dev bash /opt/clean.sh'); + +echo(" canterlot... upload\n"); +exec("scp ./data/encrypted/" . $id . ".poniesbackup root@canterlot.equestria.dev:/opt/ponies"); +echo(" canterlot... cleaning up\n"); +exec('ssh root@canterlot.equestria.dev bash /opt/clean.sh'); + +if (file_exists("/opt/ponies")) { + echo(" zephyrheights... copy\n"); + copy("./data/encrypted/" . $id . ".poniesbackup", "/opt/ponies/" . $id . ".poniesbackup"); + echo(" zephyrheights... cleaning up\n"); + exec('bash -c "cd /opt/ponies; ls -tp | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"'); +} + +echo(" Cleaning up...\n"); +unlink("./data/encrypted/" . $id . ".poniesbackup"); \ No newline at end of file diff --git a/includes/backup.php b/includes/backup.php deleted file mode 100644 index ad09617..0000000 --- a/includes/backup.php +++ /dev/null @@ -1,102 +0,0 @@ - date('c'), - "files" => [] -]; - -foreach ($root as $file) { - if ($file === "backup.poniesbackup" || $file === "backup.ponieskey" || $file === "encrypted" || str_ends_with($file, ".poniesbackup")) continue; - echo(" /$file\n"); - - if (is_dir("data/$file")) { - foreach (array_filter(scandir("data/$file"), function ($i) { - return !str_starts_with($i, "."); - }) as $dirfile) { - if ($dirfile === "backup.poniesbackup" || $dirfile === "backup.ponieskey" || $dirfile === "encrypted" || $dirfile === "oldactions" || str_ends_with($dirfile, ".poniesbackup")) continue; - - echo(" /$dirfile/$file\n"); - $files[] = [ - "dir" => $file, - "file" => $dirfile - ]; - } - } else { - echo(" /$file\n"); - $files[] = [ - "dir" => "", - "file" => $file - ]; - } -} - -echo(" Reading files...\n"); -foreach ($files as $file) { - echo(" /$file[dir]/$file[file]\n"); - $file["mime"] = mime_content_type("data/$file[dir]/$file[file]"); - $file["checksum"] = [ - sha1_file("data/$file[dir]/$file[file]"), - md5_file("data/$file[dir]/$file[file]") - ]; - $file["content"] = base64_encode(file_get_contents("data/$file[dir]/$file[file]")); - - $data["files"][] = $file; -} - -function pkcs7_pad($data, $size) { - $length = $size - strlen($data) % $size; - return $data . str_repeat(chr($length), $length); -} - -if (!file_exists("./data/backup.ponieskey")) { - echo(" Reading encryption key...\n"); - $key = openssl_random_pseudo_bytes(512); - $iv = openssl_random_pseudo_bytes(16); - file_put_contents("./data/backup.ponieskey", base64_encode(json_encode([ - "iv" => bin2hex($iv), - "key" => bin2hex($key) - ]))); -} else { - echo(" Creating encryption key...\n"); - $key_raw = json_decode(base64_decode(file_get_contents("./data/backup.ponieskey")), true); - $key = hex2bin($key_raw["key"]); - $iv = hex2bin($key_raw["iv"]); -} - -echo(" Encrypting...\n"); -$payload = json_encode($data); -$encrypted = openssl_encrypt(pkcs7_pad($payload, 16), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv); - -echo(" Writing backup...\n"); -file_put_contents("./data/backup.poniesbackup", $encrypted); -@mkdir("./data/encrypted"); - -$id = str_replace(":", "-", date('c')); -copy("./data/backup.poniesbackup", "./data/encrypted/" . $id . ".poniesbackup"); - -echo(" Uploading to servers...\n"); - -echo(" bridlewood... upload\n"); -exec("scp ./data/encrypted/" . $id . ".poniesbackup fedora@bridlewood.equestria.dev:/opt/ponies"); -echo(" bridlewood... cleaning up\n"); -exec('ssh fedora@bridlewood.equestria.dev bash /opt/clean.sh'); - -echo(" canterlot... upload\n"); -exec("scp ./data/encrypted/" . $id . ".poniesbackup root@canterlot.equestria.dev:/opt/ponies"); -echo(" canterlot... cleaning up\n"); -exec('ssh root@canterlot.equestria.dev bash /opt/clean.sh'); - -if (file_exists("/opt/ponies")) { - echo(" zephyrheights... copy\n"); - copy("./data/encrypted/" . $id . ".poniesbackup", "/opt/ponies/" . $id . ".poniesbackup"); - echo(" zephyrheights... cleaning up\n"); - exec('bash -c "cd /opt/ponies; ls -tp | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"'); -} - -echo(" Cleaning up...\n"); -unlink("./data/encrypted/" . $id . ".poniesbackup"); \ No newline at end of file diff --git a/includes/banner.inc b/includes/banner.inc new file mode 100644 index 0000000..a3c6f10 --- /dev/null +++ b/includes/banner.inc @@ -0,0 +1,456 @@ + 4196352, + "regression" => null, + "median" => null, + "marefriends" => [], + "sisters" => [], + "caretakers" => [] + ]); + + $prefixes = []; + foreach ($member['proxy_tags'] as $proxy) { + if ($travelling[$member['id']]["travelling"]) { + $prefixes[] = "+" . $proxy["prefix"] . ($proxy["suffix"] !== "" && $proxy["suffix"] !== null ? "..." . $proxy["suffix"] : ""); + } else { + $prefixes[] = $proxy["prefix"] . ($proxy["suffix"] !== "" && $proxy["suffix"] !== null ? "..." . $proxy["suffix"] : ""); + } + } + + $lastFronted = null; + if (!$metadata["median"]) { + $fronters = array_map(function ($item) { + return $item["id"]; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]); + + if (in_array($id, $fronters)) { + $lastFronted = [ + 'now' => true, + 'relative' => timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["timestamp"]), + 'absolute' => date("D j M Y, G:i:s (e)", strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["timestamp"])), + 'timestamp' => strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["timestamp"]), + 'duration' => [ + 'seconds' => null, + 'pretty' => null + ] + ]; + } else { + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true); + + $thisMember = array_filter($switches, function ($item) { + global $memberData; + return in_array($memberData["id"], $item["members"]); + }); + + $thisMember = array_values($thisMember); + $frontingEnd = null; + + if (count($thisMember) > 0) { + $thisIndex = array_search($thisMember[0], $switches); + + $frontingStart = $thisMember[0]; + $frontingEnd = $switches[$thisIndex - 1]; + } + + if ($frontingEnd !== null && isset($frontingStart)) { + $seconds = (strtotime($frontingEnd["timestamp"]) - strtotime($frontingStart["timestamp"])); + + $lastFronted = [ + 'now' => false, + 'relative' => timeAgo($frontingEnd["timestamp"]), + 'absolute' => date("D j M Y, G:i:s (e)", strtotime($frontingEnd["timestamp"])), + 'timestamp' => strtotime($frontingEnd["timestamp"]), + 'duration' => [ + 'seconds' => $seconds, + 'pretty' => $seconds . ($french ? " secondes" : " seconds") + ] + ]; + if ($french) { + if ($seconds > 60) { + if ($seconds > 3600) { + $lastFronted['duration']['pretty'] = round($seconds / 3600) . " heures"; + } else { + $lastFronted['duration']['pretty'] = round($seconds / 60) . " minutes"; + } + } + } else { + if ($seconds > 60) { + if ($seconds > 3600) { + $lastFronted['duration']['pretty'] = round($seconds / 3600) . " hours"; + } else { + $lastFronted['duration']['pretty'] = round($seconds / 60) . " minutes"; + } + } + } + } + } + } + + $speciesList = []; + foreach ($metadata["species"] ?? [] as $species) { + if ($french) { + $name = match ($species) { + "earth" => $metadata["robot"] ? "Robot poney terrestre" : (!$metadata["plush"] ? "Poney terrestre" : "Poney terrestre en peluche"), + "alicorn" => $metadata["robot"] ? "Robot alicorne" : (!$metadata["plush"] ? "Alicorne" : "Alicorne en peluche"), + "crystal" => $metadata["robot"] ? "Robot poney de crystal" : (!$metadata["plush"] ? "Poney de crystal" : "Poney de crystal en peluche"), + "pegasus" => $metadata["robot"] ? "Robot pégase" : (!$metadata["plush"] ? "Pégase" : "Pégase en peluche"), + "batpony" => $metadata["robot"] ? "Robot Poney chauve souris" : (!$metadata["plush"] ? "Poney chauve souris" : "Poney chauve souris en peluche"), + "unicorn" => $metadata["robot"] ? "Robot licorne" : (!$metadata["plush"] ? "Licorne" : "Licorne en peluche"), + default => $species . "_" . $metadata["robot"] + }; + } else { + $name = match ($species) { + "earth" => $metadata["robot"] ? "Robot earth pony" : (!$metadata["plush"] ? "Earth pony" : "Earth pony plush"), + "alicorn" => $metadata["robot"] ? "Robot alicorn" : (!$metadata["plush"] ? "Alicorn" : "Alicorn plush"), + "crystal" => $metadata["robot"] ? "Robot crystal pony" : (!$metadata["plush"] ? "Crystal pony" : "Crystal pony plush"), + "pegasus" => $metadata["robot"] ? "Robot pegasus" : (!$metadata["plush"] ? "Pegasus" : "Pegasus plush"), + "batpony" => $metadata["robot"] ? "Robot bat pony" : (!$metadata["plush"] ? "Bat pony" : "Bat pony plush"), + "unicorn" => $metadata["robot"] ? "Robot unicorn" : (!$metadata["plush"] ? "Unicorn" : "Unicorn plush"), + default => $species . "_" . $metadata["robot"] + }; + } + + $speciesList[] = [ + "id" => $species, + "name" => $name, + "robot" => $metadata["robot"], + "plush" => $metadata["plush"], + "icon" => $species . ($metadata["robot"] ? "-robot" : ($metadata["plush"] ? "-plush" : "")) . ".png" + ]; + } + + $systemData = []; + $systemData['page'] = "/" . ($system === "gdapd" ? "raindrops" : "cloudburst"); + $systemData['icon'] = ($system === "gdapd" ? "raindrops" : "cloudburst") . ".png"; + $systemData['name'] = $system === "gdapd" ? "Raindrops" : "Cloudburst"; + $systemData['full_name'] = $system === "gdapd" ? "Raindrops System" : "Cloudburst System"; + $systemData['subsystem'] = null; + $systemData['temporary'] = false; + + if (_header_memberPartOfSubsystem($member) && _header_getSubsystemFromMember($member)["source_type"] !== "member") { + $subsystem = _header_getSubsystemFromMember($member); + $systemData['subsystem'] = [ + "page" => $systemData['page'] . "/-/subsystem/" . $subsystem["source"], + "icon" => "ss-$subsystem[source].png", + "name" => file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$system-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$system-$subsystem[source].json"), true)["name"] : $subsystem["source"] + ]; + } + + if ($travelling[$member['id']]["travelling"]) { + $systemData['page'] = "/" . ($system === "gdapd" ? "cloudburst" : "raindrops"); + $systemData['icon'] = getAsset($system); + $systemData['name'] = $system === "gdapd" ? "Cloudburst" : "Raindrops"; + $systemData['full_name'] = $system === "gdapd" ? "Cloudburst System" : "Raindrops System"; + $systemData['subsystem'] = null; + $systemData['temporary'] = true; + } + + $marefriends = []; + foreach ($metadata["marefriends"] as $marefriend) { + $mfSystem = explode("/", $marefriend)[0]; + $mfMemberID = explode("/", $marefriend)[1]; + $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfMemberID) { + return $item["id"] === $mfMemberID; + }); + sort($mfMember); + $mfMember = $mfMember[0]; + + $marefriends[] = [ + "id" => $marefriend, + "link" => "/" . ($mfMember["name"]), + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), + "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), + "full_name" => $mfMember["display_name"] ?? $mfMember["name"] + ]; + } + + $sisters = []; + foreach ($metadata["sisters"] as $marefriend) { + $mfSystem = explode("/", $marefriend)[0]; + $mfMemberID = explode("/", $marefriend)[1]; + $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfMemberID) { + return $item["id"] === $mfMemberID; + }); + sort($mfMember); + $mfMember = $mfMember[0]; + + $sisters[] = [ + "id" => $marefriend, + "link" => "/" . ($mfMember["name"]), + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), + "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), + "full_name" => $mfMember["display_name"] ?? $mfMember["name"] + ]; + } + + $caretakers = null; + + if ($metadata["little"] === 2) { + $caretakers = []; + foreach ($metadata["caretakers"] as $marefriend) { + $mfSystem = explode("/", $marefriend)[0]; + $mfMemberID = explode("/", $marefriend)[1]; + $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfMemberID) { + return $item["id"] === $mfMemberID; + }); + sort($mfMember); + $mfMember = $mfMember[0]; + + $caretakers[] = [ + "id" => $marefriend, + "link" => "/" . ($mfMember["name"]), + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), + "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), + "full_name" => $mfMember["display_name"] ?? $mfMember["name"] + ]; + } + } + + $badges = []; + + if ($metadata["host"] ?? false) { + if (!$travelling[$member['id']]["travelling"]) { + $badges[] = [ + "id" => "mcf", + "color" => "primary", + "html" => ( + $french + ? + 'Fronteuse la plus présente' + : + 'Most common fronter' + ) + ]; + } + } + + if (($metadata["age_spells"] ?? false) && !$french) { + $badges[] = [ + "id" => "age_spells", + "color" => "#6f42c1", + "html" => 'Affected by age spells' + ]; + } + + if ($metadata["fictive"] ?? false) { + $badges[] = [ + "id" => "fictive", + "color" => "info", + "html" => ( + $french + ? + 'Fictive' + : + 'Fictive' + ) + ]; + } + + if ($metadata["less_frequent"] ?? false) { + $badges[] = [ + "id" => "nonverbal", + "color" => "#fd7e14", + "html" => 'Fronts less often' + ]; + } + + if ($metadata["nonverbal"] ?? false) { + $badges[] = [ + "id" => "nonverbal", + "color" => "#20c997", + "html" => 'Non verbal IRL' + ]; + } + + if ($member["name"] === "fusion") { + $badges[] = [ + "id" => "fusion", + "color" => "d63384", + "html" => 'Fusion' + ]; + } + + if (($metadata["sexually_active"] ?? false) && !$french && $isLoggedIn) { + $badges[] = [ + "id" => "sexually_active", + "color" => "d6a833", + "html" => 'Sexually active' + ]; + } + + if ($metadata["protector"] ?? false) { + $badges[] = [ + "id" => "protector", + "color" => "black", + "html" => ( + $french + ? + '
' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protecteur·ice")) . '
' + : + 'Protector' + ) + ]; + } + + if (($metadata["little"] ?? 0) === 2) { + $badges[] = [ + "id" => "little", + "color" => "success", + "html" => ( + $french + ? + '
' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' mentally younger, and therefore behaves and feels younger than the body is." class="badge rounded-pill bg-success">Petit' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "e" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "" : "·e")) . '
' + : + 'Little' + ) + ]; + } + + if (($metadata["little"] ?? 0) === 3) { + $badges[] = [ + "id" => "younger", + "color" => "dark", + "html" => ( + $french + ? + 'Plus jeune' + : + 'Younger' + ) + ]; + } + + if (($metadata["age_regressor"] ?? false)) { + if ($metadata["regression"] !== null && $metadata["regression"] !== false) { + $regression = _header_getMember($metadata["regression"], $system); + $badges[] = [ + "id" => "regressor_median", + "color" => "secondary", + "html" => ( + $french + ? + 'Régresse en âge en '. (getMiniName($regression["display_name"] ?? $regression["name"])) . '' + : + 'Age regresses into '. (getMiniName($regression["display_name"] ?? $regression["name"])) . '' + ) + ]; + } else { + $badges[] = [ + "id" => "regressor", + "color" => "secondary", + "html" => ( + $french + ? + 'Régresseur d\'âge' + : + 'Age regressor' + ) + ]; + } + } + + if ($metadata["median"] !== null && $metadata["median"] !== false) { + $source = _header_getMember($metadata["median"], $system); + if ($metadata["little"] > 0) { + $badges[] = [ + "id" => "regressed", + "color" => "warning", + "html" => ( + $french + ? + 'Régressé en âge de ' . (getMiniName($source["display_name"] ?? $source["name"])) . '' + : + 'Age regressed from ' . (getMiniName($source["display_name"] ?? $source["name"])) . '' + ) + ]; + } else { + $badges[] = [ + "id" => "facet", + "color" => "light", + "html" => ( + $french + ? + 'Facette de ' . getMiniName($source["display_name"] ?? $source["name"]) . '' + : + 'Facet of ' . getMiniName($source["display_name"] ?? $source["name"]) . '' + ) + ]; + } + } + + return [ + 'id' => $member['name'], + 'color' => $member["color"] ?? "000000", + 'icon' => [ + "online" => getAsset($system, $member["id"]), + "offline" => "pf-$system-$id.webp" + ], + 'median' => $metadata["median"], + 'little' => $metadata["little"] === 2, + 'name' => $member["display_name"] ?? $member["name"], + 'badges' => $badges, + 'prefixes' => $prefixes, + 'pronouns' => getTooltipsFromMark($member["pronouns"], $french) ?? "she/her", + 'pronouns_usage' => getMemberPronouns($member['pronouns']), + 'last_fronted' => $lastFronted, + 'species' => $speciesList, + 'system' => $systemData, + 'relations' => [ + 'marefriends' => $marefriends, + 'sisters' => $sisters, + 'caretakers' => $caretakers + ] + ]; +} \ No newline at end of file diff --git a/includes/banner.php b/includes/banner.php deleted file mode 100644 index 213863a..0000000 --- a/includes/banner.php +++ /dev/null @@ -1,456 +0,0 @@ - 4196352, - "regression" => null, - "median" => null, - "marefriends" => [], - "sisters" => [], - "caretakers" => [] - ]); - - $prefixes = []; - foreach ($member['proxy_tags'] as $proxy) { - if ($travelling[$member['id']]["travelling"]) { - $prefixes[] = "+" . $proxy["prefix"] . ($proxy["suffix"] !== "" && $proxy["suffix"] !== null ? "..." . $proxy["suffix"] : ""); - } else { - $prefixes[] = $proxy["prefix"] . ($proxy["suffix"] !== "" && $proxy["suffix"] !== null ? "..." . $proxy["suffix"] : ""); - } - } - - $lastFronted = null; - if (!$metadata["median"]) { - $fronters = array_map(function ($item) { - return $item["id"]; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["members"]); - - if (in_array($id, $fronters)) { - $lastFronted = [ - 'now' => true, - 'relative' => timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["timestamp"]), - 'absolute' => date("D j M Y, G:i:s (e)", strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["timestamp"])), - 'timestamp' => strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["timestamp"]), - 'duration' => [ - 'seconds' => null, - 'pretty' => null - ] - ]; - } else { - $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-switches.json"), true); - - $thisMember = array_filter($switches, function ($item) { - global $memberData; - return in_array($memberData["id"], $item["members"]); - }); - - $thisMember = array_values($thisMember); - $frontingEnd = null; - - if (count($thisMember) > 0) { - $thisIndex = array_search($thisMember[0], $switches); - - $frontingStart = $thisMember[0]; - $frontingEnd = $switches[$thisIndex - 1]; - } - - if ($frontingEnd !== null && isset($frontingStart)) { - $seconds = (strtotime($frontingEnd["timestamp"]) - strtotime($frontingStart["timestamp"])); - - $lastFronted = [ - 'now' => false, - 'relative' => timeAgo($frontingEnd["timestamp"]), - 'absolute' => date("D j M Y, G:i:s (e)", strtotime($frontingEnd["timestamp"])), - 'timestamp' => strtotime($frontingEnd["timestamp"]), - 'duration' => [ - 'seconds' => $seconds, - 'pretty' => $seconds . ($french ? " secondes" : " seconds") - ] - ]; - if ($french) { - if ($seconds > 60) { - if ($seconds > 3600) { - $lastFronted['duration']['pretty'] = round($seconds / 3600) . " heures"; - } else { - $lastFronted['duration']['pretty'] = round($seconds / 60) . " minutes"; - } - } - } else { - if ($seconds > 60) { - if ($seconds > 3600) { - $lastFronted['duration']['pretty'] = round($seconds / 3600) . " hours"; - } else { - $lastFronted['duration']['pretty'] = round($seconds / 60) . " minutes"; - } - } - } - } - } - } - - $speciesList = []; - foreach ($metadata["species"] ?? [] as $species) { - if ($french) { - $name = match ($species) { - "earth" => $metadata["robot"] ? "Robot poney terrestre" : (!$metadata["plush"] ? "Poney terrestre" : "Poney terrestre en peluche"), - "alicorn" => $metadata["robot"] ? "Robot alicorne" : (!$metadata["plush"] ? "Alicorne" : "Alicorne en peluche"), - "crystal" => $metadata["robot"] ? "Robot poney de crystal" : (!$metadata["plush"] ? "Poney de crystal" : "Poney de crystal en peluche"), - "pegasus" => $metadata["robot"] ? "Robot pégase" : (!$metadata["plush"] ? "Pégase" : "Pégase en peluche"), - "batpony" => $metadata["robot"] ? "Robot Poney chauve souris" : (!$metadata["plush"] ? "Poney chauve souris" : "Poney chauve souris en peluche"), - "unicorn" => $metadata["robot"] ? "Robot licorne" : (!$metadata["plush"] ? "Licorne" : "Licorne en peluche"), - default => $species . "_" . $metadata["robot"] - }; - } else { - $name = match ($species) { - "earth" => $metadata["robot"] ? "Robot earth pony" : (!$metadata["plush"] ? "Earth pony" : "Earth pony plush"), - "alicorn" => $metadata["robot"] ? "Robot alicorn" : (!$metadata["plush"] ? "Alicorn" : "Alicorn plush"), - "crystal" => $metadata["robot"] ? "Robot crystal pony" : (!$metadata["plush"] ? "Crystal pony" : "Crystal pony plush"), - "pegasus" => $metadata["robot"] ? "Robot pegasus" : (!$metadata["plush"] ? "Pegasus" : "Pegasus plush"), - "batpony" => $metadata["robot"] ? "Robot bat pony" : (!$metadata["plush"] ? "Bat pony" : "Bat pony plush"), - "unicorn" => $metadata["robot"] ? "Robot unicorn" : (!$metadata["plush"] ? "Unicorn" : "Unicorn plush"), - default => $species . "_" . $metadata["robot"] - }; - } - - $speciesList[] = [ - "id" => $species, - "name" => $name, - "robot" => $metadata["robot"], - "plush" => $metadata["plush"], - "icon" => $species . ($metadata["robot"] ? "-robot" : ($metadata["plush"] ? "-plush" : "")) . ".png" - ]; - } - - $systemData = []; - $systemData['page'] = "/" . ($system === "gdapd" ? "raindrops" : "cloudburst"); - $systemData['icon'] = ($system === "gdapd" ? "raindrops" : "cloudburst") . ".png"; - $systemData['name'] = $system === "gdapd" ? "Raindrops" : "Cloudburst"; - $systemData['full_name'] = $system === "gdapd" ? "Raindrops System" : "Cloudburst System"; - $systemData['subsystem'] = null; - $systemData['temporary'] = false; - - if (_header_memberPartOfSubsystem($member) && _header_getSubsystemFromMember($member)["source_type"] !== "member") { - $subsystem = _header_getSubsystemFromMember($member); - $systemData['subsystem'] = [ - "page" => $systemData['page'] . "/-/subsystem/" . $subsystem["source"], - "icon" => "ss-$subsystem[source].png", - "name" => file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-subsystem-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-subsystem-$subsystem[source].json"), true)["name"] : $subsystem["source"] - ]; - } - - if ($travelling[$member['id']]["travelling"]) { - $systemData['page'] = "/" . ($system === "gdapd" ? "cloudburst" : "raindrops"); - $systemData['icon'] = ($system === "gdapd" ? "cloudburst" : "raindrops") . ".png"; - $systemData['name'] = $system === "gdapd" ? "Cloudburst" : "Raindrops"; - $systemData['full_name'] = $system === "gdapd" ? "Cloudburst System" : "Raindrops System"; - $systemData['subsystem'] = null; - $systemData['temporary'] = true; - } - - $marefriends = []; - foreach ($metadata["marefriends"] as $marefriend) { - $mfSystem = explode("/", $marefriend)[0]; - $mfMemberID = explode("/", $marefriend)[1]; - $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) use ($mfMemberID) { - return $item["id"] === $mfMemberID; - }); - sort($mfMember); - $mfMember = $mfMember[0]; - - $marefriends[] = [ - "id" => $marefriend, - "link" => "/" . ($mfMember["name"]), - "icon" => "pt" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "") . ".png", - "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), - "full_name" => $mfMember["display_name"] ?? $mfMember["name"] - ]; - } - - $sisters = []; - foreach ($metadata["sisters"] as $marefriend) { - $mfSystem = explode("/", $marefriend)[0]; - $mfMemberID = explode("/", $marefriend)[1]; - $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) use ($mfMemberID) { - return $item["id"] === $mfMemberID; - }); - sort($mfMember); - $mfMember = $mfMember[0]; - - $sisters[] = [ - "id" => $marefriend, - "link" => "/" . ($mfMember["name"]), - "icon" => "pt" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "") . ".png", - "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), - "full_name" => $mfMember["display_name"] ?? $mfMember["name"] - ]; - } - - $caretakers = null; - - if ($metadata["little"] === 2) { - $caretakers = []; - foreach ($metadata["caretakers"] as $marefriend) { - $mfSystem = explode("/", $marefriend)[0]; - $mfMemberID = explode("/", $marefriend)[1]; - $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) use ($mfMemberID) { - return $item["id"] === $mfMemberID; - }); - sort($mfMember); - $mfMember = $mfMember[0]; - - $caretakers[] = [ - "id" => $marefriend, - "link" => "/" . ($mfMember["name"]), - "icon" => "pt" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "") . ".png", - "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), - "full_name" => $mfMember["display_name"] ?? $mfMember["name"] - ]; - } - } - - $badges = []; - - if ($metadata["host"] ?? false) { - if (!$travelling[$member['id']]["travelling"]) { - $badges[] = [ - "id" => "mcf", - "color" => "primary", - "html" => ( - $french - ? - 'Fronteuse la plus présente' - : - 'Most common fronter' - ) - ]; - } - } - - if (($metadata["age_spells"] ?? false) && !$french) { - $badges[] = [ - "id" => "age_spells", - "color" => "#6f42c1", - "html" => 'Affected by age spells' - ]; - } - - if ($metadata["fictive"] ?? false) { - $badges[] = [ - "id" => "fictive", - "color" => "info", - "html" => ( - $french - ? - 'Fictive' - : - 'Fictive' - ) - ]; - } - - if ($metadata["less_frequent"] ?? false) { - $badges[] = [ - "id" => "nonverbal", - "color" => "#fd7e14", - "html" => 'Fronts less often' - ]; - } - - if ($metadata["nonverbal"] ?? false) { - $badges[] = [ - "id" => "nonverbal", - "color" => "#20c997", - "html" => 'Non verbal IRL' - ]; - } - - if ($member["name"] === "fusion") { - $badges[] = [ - "id" => "fusion", - "color" => "d63384", - "html" => 'Fusion' - ]; - } - - if (($metadata["sexually_active"] ?? false) && !$french && $isLoggedIn) { - $badges[] = [ - "id" => "sexually_active", - "color" => "d6a833", - "html" => 'Sexually active' - ]; - } - - if ($metadata["protector"] ?? false) { - $badges[] = [ - "id" => "protector", - "color" => "black", - "html" => ( - $french - ? - '
' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' a protector in the system and will front when somepony cannot handle it anymore." class="badge rounded-pill bg-black">' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "Protectrice" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "Protecteur" : "Protecteur·ice")) . '
' - : - 'Protector' - ) - ]; - } - - if (($metadata["little"] ?? 0) === 2) { - $badges[] = [ - "id" => "little", - "color" => "success", - "html" => ( - $french - ? - '
' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' mentally younger, and therefore behaves and feels younger than the body is." class="badge rounded-pill bg-success">Petit' . (getMemberPronouns($member['pronouns'])["gender"] === "female" ? "e" : (getMemberPronouns($member['pronouns'])["gender"] === "male" ? "" : "·e")) . '
' - : - 'Little' - ) - ]; - } - - if (($metadata["little"] ?? 0) === 3) { - $badges[] = [ - "id" => "younger", - "color" => "dark", - "html" => ( - $french - ? - 'Plus jeune' - : - 'Younger' - ) - ]; - } - - if (($metadata["age_regressor"] ?? false)) { - if ($metadata["regression"] !== null && $metadata["regression"] !== false) { - $regression = _header_getMember($metadata["regression"], $system); - $badges[] = [ - "id" => "regressor_median", - "color" => "secondary", - "html" => ( - $french - ? - 'Régresse en âge en '. (getMiniName($regression["display_name"] ?? $regression["name"])) . '' - : - 'Age regresses into '. (getMiniName($regression["display_name"] ?? $regression["name"])) . '' - ) - ]; - } else { - $badges[] = [ - "id" => "regressor", - "color" => "secondary", - "html" => ( - $french - ? - 'Régresseur d\'âge' - : - 'Age regressor' - ) - ]; - } - } - - if ($metadata["median"] !== null && $metadata["median"] !== false) { - $source = _header_getMember($metadata["median"], $system); - if ($metadata["little"] > 0) { - $badges[] = [ - "id" => "regressed", - "color" => "warning", - "html" => ( - $french - ? - 'Régressé en âge de ' . (getMiniName($source["display_name"] ?? $source["name"])) . '' - : - 'Age regressed from ' . (getMiniName($source["display_name"] ?? $source["name"])) . '' - ) - ]; - } else { - $badges[] = [ - "id" => "facet", - "color" => "light", - "html" => ( - $french - ? - 'Facette de ' . getMiniName($source["display_name"] ?? $source["name"]) . '' - : - 'Facet of ' . getMiniName($source["display_name"] ?? $source["name"]) . '' - ) - ]; - } - } - - return [ - 'id' => $member['name'], - 'color' => $member["color"] ?? "000000", - 'icon' => [ - "online" => $member['avatar_url'], - "offline" => "pf-$system-$id.webp" - ], - 'median' => $metadata["median"], - 'little' => $metadata["little"] === 2, - 'name' => $member["display_name"] ?? $member["name"], - 'badges' => $badges, - 'prefixes' => $prefixes, - 'pronouns' => getTooltipsFromMark($member["pronouns"], $french) ?? "she/her", - 'pronouns_usage' => getMemberPronouns($member['pronouns']), - 'last_fronted' => $lastFronted, - 'species' => $speciesList, - 'system' => $systemData, - 'relations' => [ - 'marefriends' => $marefriends, - 'sisters' => $sisters, - 'caretakers' => $caretakers - ] - ]; -} \ No newline at end of file diff --git a/includes/bitset.inc b/includes/bitset.inc new file mode 100644 index 0000000..1d026e5 --- /dev/null +++ b/includes/bitset.inc @@ -0,0 +1,110 @@ + "earth", + "0010" => "unicorn", + "0011" => "pegasus", + "0100" => "alicorn", + "0101" => "batpony", + "0110" => "crystal", + default => null, + }; + + $species2 = match ($species2) { + "0001" => "earth", + "0010" => "unicorn", + "0011" => "pegasus", + "0100" => "alicorn", + "0101" => "batpony", + "0110" => "crystal", + default => null, + }; + + $species3 = match ($species3) { + "0001" => "earth", + "0010" => "unicorn", + "0011" => "pegasus", + "0100" => "alicorn", + "0101" => "batpony", + "0110" => "crystal", + default => null, + }; + + if ($little === 1) { + $ageRegressor = true; + $little = 0; + } + + return [ + 'shared_memory' => $sharedMemory, + 'median' => $median, + 'protector' => $protector, + 'fictive' => $fictive, + 'little' => $little, + 'not_talking' => $notTalking, + 'host' => $host, + 'robot' => $robot, + 'magic' => $magic, + 'sensitivity' => $sensitivity, + 'food' => $food, + 'plush' => $plush, + 'nonverbal' => $nonverbal, + 'less_frequent' => $lessFrequent, + 'age_spells' => $age, + 'age_regressor' => $ageRegressor, + 'sexually_active' => $sexuallyActive, + 'species' => array_filter([ + $species1, + $species2, + $species3 + ], function ($i) { + return isset($i); + }) + ]; +} + +function parseMetadata ($metadata) { + if (isset($metadata)) { + if ($metadata["bitset"]) { + $m = parseBitset($metadata["bitset"]); + $m["marefriends"] = $metadata["marefriends"] ?? []; + $m["bitset"] = $metadata["bitset"] ?? []; + $m["sisters"] = $metadata["sisters"] ?? []; + $m["regression"] = $metadata["regression"] ?? null; + $m["caretakers"] = $metadata["caretakers"] ?? []; + $m["median"] = $metadata["median"] ?? null; + $m["birth"] = $metadata["birth"] ?? null; + $m["heat"] = $metadata["heat"] ?? null; + } else { + $m = $metadata; + } + + return $m; + } else { + return $metadata; + } +} \ No newline at end of file diff --git a/includes/bitset.php b/includes/bitset.php deleted file mode 100644 index 1d026e5..0000000 --- a/includes/bitset.php +++ /dev/null @@ -1,110 +0,0 @@ - "earth", - "0010" => "unicorn", - "0011" => "pegasus", - "0100" => "alicorn", - "0101" => "batpony", - "0110" => "crystal", - default => null, - }; - - $species2 = match ($species2) { - "0001" => "earth", - "0010" => "unicorn", - "0011" => "pegasus", - "0100" => "alicorn", - "0101" => "batpony", - "0110" => "crystal", - default => null, - }; - - $species3 = match ($species3) { - "0001" => "earth", - "0010" => "unicorn", - "0011" => "pegasus", - "0100" => "alicorn", - "0101" => "batpony", - "0110" => "crystal", - default => null, - }; - - if ($little === 1) { - $ageRegressor = true; - $little = 0; - } - - return [ - 'shared_memory' => $sharedMemory, - 'median' => $median, - 'protector' => $protector, - 'fictive' => $fictive, - 'little' => $little, - 'not_talking' => $notTalking, - 'host' => $host, - 'robot' => $robot, - 'magic' => $magic, - 'sensitivity' => $sensitivity, - 'food' => $food, - 'plush' => $plush, - 'nonverbal' => $nonverbal, - 'less_frequent' => $lessFrequent, - 'age_spells' => $age, - 'age_regressor' => $ageRegressor, - 'sexually_active' => $sexuallyActive, - 'species' => array_filter([ - $species1, - $species2, - $species3 - ], function ($i) { - return isset($i); - }) - ]; -} - -function parseMetadata ($metadata) { - if (isset($metadata)) { - if ($metadata["bitset"]) { - $m = parseBitset($metadata["bitset"]); - $m["marefriends"] = $metadata["marefriends"] ?? []; - $m["bitset"] = $metadata["bitset"] ?? []; - $m["sisters"] = $metadata["sisters"] ?? []; - $m["regression"] = $metadata["regression"] ?? null; - $m["caretakers"] = $metadata["caretakers"] ?? []; - $m["median"] = $metadata["median"] ?? null; - $m["birth"] = $metadata["birth"] ?? null; - $m["heat"] = $metadata["heat"] ?? null; - } else { - $m = $metadata; - } - - return $m; - } else { - return $metadata; - } -} \ No newline at end of file diff --git a/includes/edit-private.inc b/includes/edit-private.inc new file mode 100644 index 0000000..e760b94 --- /dev/null +++ b/includes/edit-private.inc @@ -0,0 +1,147 @@ + + +
+
+ +
+ +
+ +

+ Saved · bytes · ">View page +

+ + + + + + + + +
+ + \ No newline at end of file diff --git a/includes/edit-private.php b/includes/edit-private.php deleted file mode 100644 index 58e9ed5..0000000 --- a/includes/edit-private.php +++ /dev/null @@ -1,147 +0,0 @@ - - -
-
- -
- -
- -

- Saved · bytes · ">View page -

- - - - - - - - -
- - \ No newline at end of file diff --git a/includes/edit.inc b/includes/edit.inc new file mode 100644 index 0000000..d8cf673 --- /dev/null +++ b/includes/edit.inc @@ -0,0 +1,147 @@ + + +
+
+ +
+ +
+ +

+ Saved · bytes · ">View page +

+ + + + + + + + +
+ + \ No newline at end of file diff --git a/includes/edit.php b/includes/edit.php deleted file mode 100644 index 5bbd38a..0000000 --- a/includes/edit.php +++ /dev/null @@ -1,147 +0,0 @@ - - -
-
- -
- -
- -

- Saved · bytes · ">View page -

- - - - - - - - -
- - \ No newline at end of file diff --git a/includes/emergency.inc b/includes/emergency.inc new file mode 100644 index 0000000..5490985 --- /dev/null +++ b/includes/emergency.inc @@ -0,0 +1,194 @@ +

Emergency alert +
+ + · +
+

+ +Turn ON + +

Sending next notification never

+ + + + + + + + \ No newline at end of file diff --git a/includes/emergency.php b/includes/emergency.php deleted file mode 100644 index 5490985..0000000 --- a/includes/emergency.php +++ /dev/null @@ -1,194 +0,0 @@ -

Emergency alert -
- - · -
-

- -Turn ON - -

Sending next notification never

- - - - - - - - \ No newline at end of file diff --git a/includes/footer.inc b/includes/footer.inc new file mode 100644 index 0000000..303b6f0 --- /dev/null +++ b/includes/footer.inc @@ -0,0 +1,36 @@ + + +
+
+ + © Equestria.dev Developers · version 2...
+ Data updated ( 360): ?>not updating; ; took ms, 0 ? (count($refresh["restored"]) > 1 ? "reported " . count($refresh["restored"]) . " failures" : "reported 1 failure") : "no failures reported" ?>) +


+
+ + + + + + + \ No newline at end of file diff --git a/includes/footer.php b/includes/footer.php deleted file mode 100644 index 720881a..0000000 --- a/includes/footer.php +++ /dev/null @@ -1,35 +0,0 @@ - - -
-
- - © Equestria.dev Developers · Source Code
- Data updated (; took ms, 0 ? (count($refresh["restored"]) > 1 ? "reported " . count($refresh["restored"]) . " failures" : "reported 1 failure") : "no failures reported" ?>) -


-
- - - - - - - \ No newline at end of file diff --git a/includes/functions.inc b/includes/functions.inc new file mode 100644 index 0000000..386d2b2 --- /dev/null +++ b/includes/functions.inc @@ -0,0 +1,477 @@ + $g) { + $h += 360; + } + break; + + case $g: + $h = 60 * (($b - $r) / $d + 2); + break; + + case $b: + $h = 60 * (($r - $g) / $d + 4); + break; + } + } + + return array(round($h, 2), round($s, 2), round($l, 2)); + } +} + +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]; + switch ($info['mime']) { + case 'image/jpeg': $src = imagecreatefromjpeg($sourceImageFile); + break; + case 'image/gif': $src = imagecreatefromgif($sourceImageFile); + break; + case 'image/png': $src = imagecreatefrompng($sourceImageFile); + break; + default: + $res = false; + } + } + + # create corners + if ($res) { + + $q = 10; # change this if you want + $radius *= $q; + + # find unique color + do { + $r = rand(0, 255); + $g = rand(0, 255); + $b = rand(0, 255); + } + while (imagecolorexact($src, $r, $g, $b) < 0); + + $nw = $w*$q; + $nh = $h*$q; + + $img = imagecreatetruecolor($nw, $nh); + $alphacolor = imagecolorallocatealpha($img, $r, $g, $b, 127); + imagealphablending($img, false); + imagesavealpha($img, true); + imagefilledrectangle($img, 0, 0, $nw, $nh, $alphacolor); + + imagefill($img, 0, 0, $alphacolor); + imagecopyresampled($img, $src, 0, 0, 0, 0, $nw, $nh, $w, $h); + + imagearc($img, $radius-1, $radius-1, $radius*2, $radius*2, 180, 270, $alphacolor); + imagefilltoborder($img, 0, 0, $alphacolor, $alphacolor); + imagearc($img, $nw-$radius, $radius-1, $radius*2, $radius*2, 270, 0, $alphacolor); + imagefilltoborder($img, $nw-1, 0, $alphacolor, $alphacolor); + imagearc($img, $radius-1, $nh-$radius, $radius*2, $radius*2, 90, 180, $alphacolor); + imagefilltoborder($img, 0, $nh-1, $alphacolor, $alphacolor); + imagearc($img, $nw-$radius, $nh-$radius, $radius*2, $radius*2, 0, 90, $alphacolor); + imagefilltoborder($img, $nw-1, $nh-1, $alphacolor, $alphacolor); + 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); + } + + return $res; + } +} + +if (!function_exists("getMiniName")) { + function getMiniName(string $name) { + $parts = explode(" ", $name); + + if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn")) { + if (str_contains($parts[0], "/")) { + return explode("/", $parts[0])[0]; + } else { + return $parts[0]; + } + } else { + return $name; + } + } +} + +if (!function_exists("withCaretakersDown")) { + function withCaretakersDown(array $ordered): array { + $caretakersNo = []; + $caretakersYes = []; + + foreach ($ordered as $item) { + if ($item["_metadata"]["little"] === 2) { + $caretakersYes[] = $item; + } else { + $caretakersNo[] = $item; + } + } + + return [...$caretakersNo, ...$caretakersYes]; + } +} + +if (!function_exists("getSystemMember")) { + function getSystemMember(string $system, string $id) { + $systemID = $system; + + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); + $member = null; + + foreach ($members as $m) { + if ($m["id"] === $id) $member = $m; + } + + $member["system"] = $member["_system"] = $system; + + return $member; + } +} + +if (!function_exists("getMemberWithoutSystem")) { + function getMemberWithoutSystem(string $id) { + $member = null; + + $members1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true); + foreach ($members1 as $m) { + $m["_system"] = "ynmuc"; + $m["system"] = "ynmuc"; + if ($m["id"] === $id) $member = $m; + } + + $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true); + foreach ($members2 as $m) { + $m["_system"] = "gdapd"; + $m["system"] = "gdapd"; + if ($m["id"] === $id) $member = $m; + } + + return $member; + } +} + +if (!function_exists("showMembersFromList")) { + function showMembersFromList(array $list) { + foreach ($list as $member) { if ($member['name'] !== "unknown" && $member['name'] !== "fusion") { + echo(' +
+ +
' . ($member['display_name'] ?? $member['name']) . '
+
' . (isset($member['travelling']) && $member['travelling'] ? "+" . ($member['proxy_tags'][0]['prefix'] ?? " ") : ($member['proxy_tags'][0]['prefix'] ?? " ")) . '
+
'); + }} + } +} + +if (!function_exists("showSubsystem")) { + function showSubsystem(array $data, string $parentSystem) { + $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$parentSystem-$data[source].json"), true); + + echo(' +
'); + echo('
'); + + showMembersFromList(scoreOrder(array_map(function ($i) use ($parentSystem) { + return getSystemMember($parentSystem, $i); + }, $data["members"]), $parentSystem)); + + echo('
+ +
'); + } +} + +if (!function_exists("showSystem")) { + function showSystem(string $id, string $name, string $color, bool $hideTitle) { + global $travelling; + + $global = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/general.json"), true); + + if ($hideTitle) { + echo(' +
'); + } else { + echo(' +
'); + } + if (!$hideTitle) echo(' + +

' . $name . '
+
'); + + if ($hideTitle) { + echo('
'); + } else { + echo('
'); + } + + showMembersFromList(scoreOrder([...array_map(function ($i) use ($id) { + $i["travelling"] = false; + $i["system"] = $id; + return $i; + }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/members.json"), true), function ($i) use ($travelling) { + return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']); + })), ...array_map(function ($i) use ($id) { + $i["travelling"] = true; + $i["system"] = ($id === "gdapd" ? "ynmuc" : "gdapd"); + return $i; + }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($id === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($travelling) { + return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']; + }))], $id)); + + echo('
+ +
'); + } +} + +if (!function_exists("cloudburst")) { + function cloudburst(bool $hideTitle): void { + showSystem("ynmuc", "Cloudburst System", "#5f08a9a6", $hideTitle); + } +} + +if (!function_exists("raindrops")) { + function raindrops(bool $hideTitle): void { + showSystem("gdapd", "Raindrops System", "#a95f08a6", $hideTitle); + } +} + +if (!function_exists("getMember")) { + function getMember(string $id) { + global $systemID; + + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); + $member = null; + + foreach ($members as $m) { + if ($m["id"] === $id) $member = $m; + } + + return $member; + } +} + +if (!function_exists("timeAgo")) { + function timeAgo($time): string { + if (!is_numeric($time)) { + $time = strtotime($time); + } + + $periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"]; + $lengths = array("60", "60", "24", "7", "4.35", "12", "100"); + + $now = time(); + + $difference = $now - $time; + if ($difference <= 10 && $difference >= 0) { + return $tense = "now"; + } elseif ($difference > 0) { + $tense = "ago"; + } else { + $tense = "later"; + } + + for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { + $difference /= $lengths[$j]; + } + + $difference = round($difference); + + $period = $periods[$j]; + return "{$difference} {$period} {$tense}"; + } +} + +if (!function_exists("timeIn")) { + function timeIn($time): string { + if (!is_numeric($time)) { + $time = strtotime($time); + } + + $periods = ["second", "minute", "hour", "day", "week", "month", "year", "age"]; + $lengths = array("60", "60", "24", "7", "4.35", "12", "100"); + + $now = time(); + + $difference = $time - $now; + if ($difference <= 10 && $difference >= 0) { + return $tense = "now"; + } elseif ($difference > 0) { + $tense = "in"; + } else { + $tense = "ago"; + } + + for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { + $difference /= $lengths[$j]; + } + + $difference = round($difference); + + $period = $periods[$j] . ($difference >1 ? "s" :''); + return "{$tense} {$difference} {$period}"; + } +} + +if (!function_exists("duration")) { + function duration($seconds) { + if ($seconds >= 60) { + if (floor($seconds / 60) >= 60) { + if (floor($seconds / 3600) >= 24) { + $days = floor($seconds / 86400); + return $days . " day" . ($days > 1 ? "s" : ""); + } else { + $hours = floor($seconds / 3600); + return $hours . " hour" . ($hours > 1 ? "s" : ""); + } + } else { + $minutes = floor($seconds / 60); + return $minutes . " minute" . ($minutes > 1 ? "s" : ""); + } + } else { + return $seconds . " seconds"; + } + } +} + +if (!function_exists("relativeDate")) { + function relativeDate($date, $showTime = true) { + if (!is_numeric($date)) $date = strtotime($date); + + if (!$showTime) { + if (date('Y-m-d', $date) === date('Y-m-d')) { + return "today"; + } elseif (date('Y-m-d', $date) === date('Y-m-d', time() + 86400)) { + return "tomorrow"; + } elseif ($date < time() + 518400) { + return date('l', $date); + } else { + return date('D j M', $date); + } + } else { + if (date('Y-m-d', $date) === date('Y-m-d')) { + return "today, " . date('H:i', $date) . ""; + } elseif (date('Y-m-d', $date) === date('Y-m-d', time() + 86400)) { + return "tomorrow, " . date('H:i', $date) . ""; + } elseif ($date < time() + 518400) { + return date('l', $date) . ", " . date('H:i', $date) . ""; + } else { + return date('D j M', $date) . ", " . date('H:i', $date) . ""; + } + } + } +} + +if (!function_exists("getMemberSystem")) { + function getMemberSystem(string $id) { + $list = scoreOrderGlobal(); + + foreach ($list as $item) { + if ($item["id"] === $id) return $item["_system"]; + } + } +} + +if (!function_exists("getMemberFromName")) { + function getMemberFromName(string $name) { + $list = [...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)]; + + foreach ($list as $item) { + if ($item["name"] === $name) return $item; + } + } +} + +if (!function_exists("resolveMember")) { + function resolveMember(mixed $name) { + if (is_string($name)) { + if (str_ends_with($name, "-travelling")) { + return substr($name, 0, strlen($name) - 11); + } else { + return $name; + } + } else { + return $name; + } + } +} \ No newline at end of file diff --git a/includes/functions.php b/includes/functions.php deleted file mode 100644 index 1a2bf4c..0000000 --- a/includes/functions.php +++ /dev/null @@ -1,319 +0,0 @@ - 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy") { - if (str_contains($parts[0], "/")) { - return explode("/", $parts[0])[0]; - } else { - return $parts[0]; - } - } else { - return $name; - } - } -} - -if (!function_exists("withCaretakersDown")) { - function withCaretakersDown(array $ordered): array { - $caretakersNo = []; - $caretakersYes = []; - - foreach ($ordered as $item) { - if ($item["_metadata"]["little"] === 2) { - $caretakersYes[] = $item; - } else { - $caretakersNo[] = $item; - } - } - - return [...$caretakersNo, ...$caretakersYes]; - } -} - -if (!function_exists("getSystemMember")) { - function getSystemMember(string $system, string $id) { - $systemID = $system; - - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); - $member = null; - - foreach ($members as $m) { - if ($m["id"] === $id) $member = $m; - } - - return $member; - } -} - -if (!function_exists("getMemberWithoutSystem")) { - function getMemberWithoutSystem(string $id) { - $member = null; - - $members1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true); - foreach ($members1 as $m) { - $m["_system"] = "ynmuc"; - if ($m["id"] === $id) $member = $m; - } - - $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true); - foreach ($members2 as $m) { - $m["_system"] = "gdapd"; - if ($m["id"] === $id) $member = $m; - } - - return $member; - } -} - -if (!function_exists("showMembersFromList")) { - function showMembersFromList(array $list) { - foreach ($list as $member) { if ($member['name'] !== "unknown" && $member['name'] !== "fusion") { - echo(' -
- -
' . ($member['display_name'] ?? $member['name']) . '
-
' . (isset($member['travelling']) && $member['travelling'] ? "+" . ($member['proxy_tags'][0]['prefix'] ?? " ") : ($member['proxy_tags'][0]['prefix'] ?? " ")) . '
-
'); - }} - } -} - -if (!function_exists("showSubsystem")) { - function showSubsystem(array $data, string $parentSystem) { - $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$parentSystem-subsystem-$data[source].json"), true); - - echo(' -
'); - echo('
'); - - showMembersFromList(scoreOrder(array_map(function ($i) use ($parentSystem) { - return getSystemMember($parentSystem, $i); - }, $data["members"]), $parentSystem)); - - echo('
- -
'); - } -} - -if (!function_exists("showSystem")) { - function showSystem(string $id, string $name, string $color, bool $hideTitle) { - global $travelling; - - $global = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id-general.json"), true); - - if ($hideTitle) { - echo(' -
'); - } else { - echo(' -
'); - } - if (!$hideTitle) echo(' - -

' . $name . '
-
'); - - if ($hideTitle) { - echo('
'); - } else { - echo('
'); - } - - showMembersFromList(scoreOrder([...array_map(function ($i) use ($id) { - $i["travelling"] = false; - $i["system"] = $id; - return $i; - }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id-members.json"), true), function ($i) use ($travelling) { - return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']); - })), ...array_map(function ($i) use ($id) { - $i["travelling"] = true; - $i["system"] = ($id === "gdapd" ? "ynmuc" : "gdapd"); - return $i; - }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($id === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true), function ($i) use ($travelling) { - return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']; - }))], $id)); - - echo('
- -
'); - } -} - -if (!function_exists("cloudburst")) { - function cloudburst(bool $hideTitle): void { - showSystem("ynmuc", "Cloudburst System", "#5f08a9a6", $hideTitle); - } -} - -if (!function_exists("raindrops")) { - function raindrops(bool $hideTitle): void { - showSystem("gdapd", "Raindrops System", "#a95f08a6", $hideTitle); - } -} - -if (!function_exists("getMember")) { - function getMember(string $id) { - global $systemID; - - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); - $member = null; - - foreach ($members as $m) { - if ($m["id"] === $id) $member = $m; - } - - return $member; - } -} - -if (!function_exists("timeAgo")) { - function timeAgo($time): string { - if (!is_numeric($time)) { - $time = strtotime($time); - } - - $periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"]; - $lengths = array("60", "60", "24", "7", "4.35", "12", "100"); - - $now = time(); - - $difference = $now - $time; - if ($difference <= 10 && $difference >= 0) { - return $tense = "now"; - } elseif ($difference > 0) { - $tense = "ago"; - } else { - $tense = "later"; - } - - for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { - $difference /= $lengths[$j]; - } - - $difference = round($difference); - - $period = $periods[$j]; - return "{$difference} {$period} {$tense}"; - } -} - -if (!function_exists("timeIn")) { - function timeIn($time): string { - if (!is_numeric($time)) { - $time = strtotime($time); - } - - $periods = ["second", "minute", "hour", "day", "week", "month", "year", "age"]; - $lengths = array("60", "60", "24", "7", "4.35", "12", "100"); - - $now = time(); - - $difference = $time - $now; - if ($difference <= 10 && $difference >= 0) { - return $tense = "now"; - } elseif ($difference > 0) { - $tense = "in"; - } else { - $tense = "ago"; - } - - for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { - $difference /= $lengths[$j]; - } - - $difference = round($difference); - - $period = $periods[$j] . ($difference >1 ? "s" :''); - return "{$tense} {$difference} {$period}"; - } -} - -if (!function_exists("duration")) { - function duration($seconds) { - if ($seconds >= 60) { - if (floor($seconds / 60) >= 60) { - if (floor($seconds / 3600) >= 24) { - $days = floor($seconds / 86400); - return $days . " day" . ($days > 1 ? "s" : ""); - } else { - $hours = floor($seconds / 3600); - return $hours . " hour" . ($hours > 1 ? "s" : ""); - } - } else { - $minutes = floor($seconds / 60); - return $minutes . " minute" . ($minutes > 1 ? "s" : ""); - } - } else { - return $seconds . " seconds"; - } - } -} - -if (!function_exists("relativeDate")) { - function relativeDate($date, $showTime = true) { - if (!is_numeric($date)) $date = strtotime($date); - - if (!$showTime) { - if (date('Y-m-d', $date) === date('Y-m-d')) { - return "today"; - } elseif (date('Y-m-d', $date) === date('Y-m-d', time() + 86400)) { - return "tomorrow"; - } elseif ($date < time() + 518400) { - return date('l', $date); - } else { - return date('D j M', $date); - } - } else { - if (date('Y-m-d', $date) === date('Y-m-d')) { - return "today, " . date('H:i', $date) . ""; - } elseif (date('Y-m-d', $date) === date('Y-m-d', time() + 86400)) { - return "tomorrow, " . date('H:i', $date) . ""; - } elseif ($date < time() + 518400) { - return date('l', $date) . ", " . date('H:i', $date) . ""; - } else { - return date('D j M', $date) . ", " . date('H:i', $date) . ""; - } - } - } -} - -if (!function_exists("getMemberSystem")) { - function getMemberSystem(string $id) { - $list = scoreOrderGlobal(); - - foreach ($list as $item) { - if ($item["id"] === $id) return $item["_system"]; - } - } -} - -if (!function_exists("getMemberFromName")) { - function getMemberFromName(string $name) { - $list = [...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true)]; - - foreach ($list as $item) { - if ($item["name"] === $name) return $item; - } - } -} - -if (!function_exists("resolveMember")) { - function resolveMember(mixed $name) { - if (is_string($name)) { - if (str_ends_with($name, "-travelling")) { - return substr($name, 0, strlen($name) - 11); - } else { - return $name; - } - } else { - return $name; - } - } -} \ No newline at end of file diff --git a/includes/header.inc b/includes/header.inc new file mode 100644 index 0000000..e851c85 --- /dev/null +++ b/includes/header.inc @@ -0,0 +1,1001 @@ +"> +
+ Error ' . $errno . ': ' . $errstr . ' [' . $file . ':' . $line . '] +
'); +} + +if (isset($_GET['errors'])) { + ini_set('display_errors', '1'); + ini_set('display_startup_errors', '1'); + error_reporting(E_ALL); + set_error_handler("error", E_ALL); +} + +global $_MemberName; +global $_MemberPage; +global $_SystemName; +global $_SystemPage; +global $toplevel; + +$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); +$page = $pages[$toplevel] ?? [ + "rail" => false +]; + +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.inc"; global $travelling; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.inc"; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.inc"; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; + +?> + + + + + + + + <?= $title ? $title . " · " : "" ?>Cold Haze + + + + + + + + + + + + + + + + + + + + + + + + id="admin-page"> + + + + + diff --git a/includes/header.php b/includes/header.php deleted file mode 100644 index 91d0aee..0000000 --- a/includes/header.php +++ /dev/null @@ -1,963 +0,0 @@ -"> -
- Error ' . $errno . ': ' . $errstr . ' [' . $file . ':' . $line . '] -
'); -} - -if (isset($_GET['errors'])) { - ini_set('display_errors', '1'); - ini_set('display_startup_errors', '1'); - error_reporting(E_ALL); - set_error_handler("error", E_ALL); -} - -global $_MemberName; -global $_MemberPage; -global $_SystemName; -global $_SystemPage; -global $toplevel; - -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.php"; global $travelling; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.php"; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.php"; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; global $isUserLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; - -?> - - - - - - - - <?= $title ? $title . " · " : "" ?>Cold Haze - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/includes/icons.inc b/includes/icons.inc new file mode 100644 index 0000000..ec433b2 --- /dev/null +++ b/includes/icons.inc @@ -0,0 +1,5 @@ + array_unique($keywords), + "link" => "/-/actions/$action[id]" + ]; + } + + foreach ($toys as $toy) { + $base = strtolower($toy["name"]); + $addKeywords = $toy["keywords"] ?? []; + $keywords = [ + $base, + ucfirst($base), + ucwords($base) + ]; + + for ($i = 0; $i < strlen($base); $i++) { + $keywords[] = substr($base, 0, $i) . strtoupper(substr($base, $i, 1)) . substr($base, $i + 1, strlen($base) - $i - 1); + + for ($j = 0; $j < strlen($base); $j++) { + $keywords[] = substr($base, 0, $i) . strtoupper(substr($base, $i, $j)) . substr($base, $i + $j, strlen($base) - $i - $j); + } + } + + foreach ($addKeywords as $keyword) { + $keywords[] = $keyword; + $keywords[] = ucfirst($keyword); + $keywords[] = ucwords($keyword); + + for ($i = 0; $i < strlen($keyword); $i++) { + $keywords[] = substr($keyword, 0, $i) . strtoupper(substr($keyword, $i, 1)) . substr($keyword, $i + 1, strlen($keyword) - $i - 1); + + for ($j = 0; $j < strlen($keyword); $j++) { + $keywords[] = substr($keyword, 0, $i) . strtoupper(substr($keyword, $i, $j)) . substr($keyword, $i + $j, strlen($keyword) - $i - $j); + } + } + } + + $pages[$toy["id"]] = [ + "keywords" => array_unique($keywords), + "link" => "/-/toys/$toy[id]" + ]; + } + + $keywords = []; + foreach ($pages as $page) { + foreach ($page["keywords"] as $keyword) { + $keywords[] = [ + "keyword" => $keyword, + "link" => $page["link"] + ]; + } + } + + uasort($keywords, function ($a, $b) { + return strlen($b["keyword"]) - strlen($a["keyword"]); + }); + + return $keywords; +} + +function replaceKeyWords(string $input): string { + $keywords = getKeyWords(); + + foreach ($keywords as $data) { + $keyword = $data["keyword"]; + $url = $data["link"]; + + $input = str_replace($keyword, "$keyword", $input); + } + + return $input; +} \ No newline at end of file diff --git a/includes/keywords.php b/includes/keywords.php deleted file mode 100644 index 270d905..0000000 --- a/includes/keywords.php +++ /dev/null @@ -1,110 +0,0 @@ - array_unique($keywords), - "link" => "/-/actions/$action[id]" - ]; - } - - foreach ($toys as $toy) { - $base = strtolower($toy["name"]); - $addKeywords = $toy["keywords"] ?? []; - $keywords = [ - $base, - ucfirst($base), - ucwords($base) - ]; - - for ($i = 0; $i < strlen($base); $i++) { - $keywords[] = substr($base, 0, $i) . strtoupper(substr($base, $i, 1)) . substr($base, $i + 1, strlen($base) - $i - 1); - - for ($j = 0; $j < strlen($base); $j++) { - $keywords[] = substr($base, 0, $i) . strtoupper(substr($base, $i, $j)) . substr($base, $i + $j, strlen($base) - $i - $j); - } - } - - foreach ($addKeywords as $keyword) { - $keywords[] = $keyword; - $keywords[] = ucfirst($keyword); - $keywords[] = ucwords($keyword); - - for ($i = 0; $i < strlen($keyword); $i++) { - $keywords[] = substr($keyword, 0, $i) . strtoupper(substr($keyword, $i, 1)) . substr($keyword, $i + 1, strlen($keyword) - $i - 1); - - for ($j = 0; $j < strlen($keyword); $j++) { - $keywords[] = substr($keyword, 0, $i) . strtoupper(substr($keyword, $i, $j)) . substr($keyword, $i + $j, strlen($keyword) - $i - $j); - } - } - } - - $pages[$toy["id"]] = [ - "keywords" => array_unique($keywords), - "link" => "/-/toys/$toy[id]" - ]; - } - - $keywords = []; - foreach ($pages as $page) { - foreach ($page["keywords"] as $keyword) { - $keywords[] = [ - "keyword" => $keyword, - "link" => $page["link"] - ]; - } - } - - uasort($keywords, function ($a, $b) { - return strlen($b["keyword"]) - strlen($a["keyword"]); - }); - - return $keywords; -} - -function replaceKeyWords(string $input): string { - $keywords = getKeyWords(); - - foreach ($keywords as $data) { - $keyword = $data["keyword"]; - $url = $data["link"]; - - $input = str_replace($keyword, "$keyword", $input); - } - - return $input; -} \ No newline at end of file diff --git a/includes/logo.inc b/includes/logo.inc new file mode 100644 index 0000000..442ff2b --- /dev/null +++ b/includes/logo.inc @@ -0,0 +1,97 @@ += $columns) { + $packs[] = $currentPack; + $currentPack = []; + } + + $currentPack[] = $member["color"]; +} + +if (count($currentPack) > 0) $packs[] = $currentPack; + +$newPacks = []; +foreach ($packs as $pack) { + usort($pack, function ($a, $b) { + $vra = hexdec(substr($a, 0, 2)); + $vga = hexdec(substr($a, 2, 2)); + $vba = hexdec(substr($a, 4, 2)); + + $hsla = rgbToHsl($vra, $vga, $vba); + $ra = $hsla[2] * $hsla[1]; + + $vrb = hexdec(substr($b, 0, 2)); + $vgb = hexdec(substr($b, 2, 2)); + $vbb = hexdec(substr($b, 4, 2)); + + $hslb = rgbToHsl($vrb, $vgb, $vbb); + $rb = $hslb[2] * $hslb[1]; + + return $rb < $ra; + }); + + while (count($pack) < $columns) $pack[] = "ffffff"; + + $newPacks[] = $pack; +} + +$img = imagecreatetruecolor($columns, $columns); +$factor = 64; + +for ($y = 0; $y < $columns; ++$y) { + for ($x = 0; $x < $columns; ++$x) { + imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2)))); + } +} + +$img2 = imagecreatetruecolor($columns * $factor, $columns * $factor); +imagecopyresampled($img2, $img, 0, 0, 0, 0, $columns * $factor, $columns * $factor, $columns, $columns); + +imagepng($img2, "/tmp/image.png"); +$img3 = imageCreateCorners("/tmp/image.png", $columns * 10); +unlink("/tmp/image.png"); + +imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo.png"); + +for ($x = 1; $x <= 120; $x++) { + imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR); +} + +imagefilter($img2, IMG_FILTER_BRIGHTNESS, -100); + +imagepng($img2, "/tmp/image.png"); +$img3 = imageCreateCorners("/tmp/image.png", $columns * 10); +unlink("/tmp/image.png"); + +imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo-template.png"); \ No newline at end of file diff --git a/includes/member.inc b/includes/member.inc new file mode 100644 index 0000000..2a0c346 --- /dev/null +++ b/includes/member.inc @@ -0,0 +1,268 @@ + + +
+
+ + +
+
+
"> +
+ Food:
+ "Not needed", + 1 => "Not animals", + 2 => "Not meat", + 3 => "All", + } ?> +
+
+ Shared memory:
+ "None", + 1 => "Partial", + 2 => "Full", + } ?> +
+
+ Magic:
+ "None", + 1 => "In some cases", + 2 => "Horn", + 3 => "Wings", + 4 => "Horn and wings", + 5 => "Yes", + } ?> +
+ +
+ Sensitivity:
+ "None", + 1 => "Maybe", + 2 => "Affectionate", + 3 => "Sexual", + 4 => "Affectionate and sexual", + } ?> +
+
+ Age:
+ + + - + + " . $metadata["birth"]["age"] . "* years old" ?> + + + + - + + + " . $age . " years old" ?> + + +
+
+ Birthday:
+ + + + - + +
+ +
+
+ +
+ + + +
+ + + +
+ This member's metadata needs an update. It still uses the old JSON metadata system instead of the new 24bit integer-based system. Contact a developer to request an update. (only administrators can see this; file: /includes/data/metadata/.json) +
+ +
+
+ Private administrator information +
    +
  • ID: (, )
  • +
  • Files: +
      +
    • ()
    • +
    • ()
    • +
    • ()
    • +
    +
  • +
  • Date added: (, )
  • +
  • Pronouns:
  • +
  • Pronouns usage:
      $usage) { + if (is_string($usage) && $type !== "color") { + echo("
    • " . $type . ": " . $usage . "
    • "); + } + } + + ?>
  • +
  • Color: ;display:inline-block;width:16px;height:16px;border-radius:5px;vertical-align: middle;filter: invert(1) hue-rotate(180deg);"> # +
  • Bitset: (0x, )
  • Not using bitset; please update. +
  • Reduced name:
  • +
  • Shared memory access: ()
  • +
  • Protector: ()
  • +
  • Little: ()
  • +
  • Relations count:
  • + +
  • + Score breakdown: +
      +
    • Most common fronter score:
    • +
    • Relationships score:
    • +
    • Fictive score:
    • +
    • Median score:
    • +
    • Species score:
    • +
    • Little score:
    • +
    • Not talking score:
    • +
    • Protector score:
    • +
    • Name score:
    • +
    • Shared memory score:
    • +
    +
  • +
  • Full metadata:
      $usage) { + if (is_string($usage)) { + echo("
    • " . $type . ": " . $usage . "
    • "); + } else { + echo("
    • " . $type . ": " . json_encode($usage, JSON_UNESCAPED_SLASHES) . "
    • "); + } + } + + ?>
  • +
+ +
+
+ AI-generated page: + +
+
+
+ + +
+ is visiting the since , therefore currently not in the . +
+ + +
+

Hello there!

+

I'm currently a new headmate slowly figuring myself out.

+

Give me some time to figure myself out and see this page change as I find new stuff about my identity. Don't be too worried if I accidentally get pushed to front, it's something that can happen sometimes.

+ Thanks! +
+ + +
+ +
+

Hello there!

+

I'm currently not totally sure who I am (it's a thing that can happen with plurality), but I am using as a temporary identity to stay calm and not panic while I figure out what is going on and who I am.

+

I can either be an existing headmate who cannot work out they are fronting (this can sometimes happen when one of us gets pushed out of front), multiple headmates blurring who cannot work out who we are, or a new pony trying to figure out their identity (this can sometimes take a while).

+ In all cases, feel free to ask! +
+ +
+

Hello there!

+

I'm the result of more than one pony temporarily merging together to the point they are unable to be told apart (this can be done for various reasons). We have not registered this switch for the "Unknown" member since this merge is made on purpose.

+

Below is the list of who is merged, we can be either from a single system or from different systems.

+ + + No members are currently merged. + +
+ + + (edit: public, private) + + + + +
+ + + + + +

This page is automatically generated and may not be 100% accurate.

+ + + +
+
+ + \ No newline at end of file diff --git a/includes/member.php b/includes/member.php deleted file mode 100644 index d0120d5..0000000 --- a/includes/member.php +++ /dev/null @@ -1,268 +0,0 @@ - - -
-
- - -
-
-
"> -
- Food:
- "Not needed", - 1 => "Not animals", - 2 => "Not meat", - 3 => "All", - } ?> -
-
- Shared memory:
- "None", - 1 => "Partial", - 2 => "Full", - } ?> -
-
- Magic:
- "None", - 1 => "In some cases", - 2 => "Horn", - 3 => "Wings", - 4 => "Horn and wings", - 5 => "Yes", - } ?> -
- -
- Sensitivity:
- "None", - 1 => "Maybe", - 2 => "Affectionate", - 3 => "Sexual", - 4 => "Affectionate and sexual", - } ?> -
-
- Age:
- - - - - - " . $metadata["birth"]["age"] . "* years old" ?> - - - - - - - - " . $age . " years old" ?> - - -
-
- Birthday:
- - - - - - -
- -
-
- -
- - - -
- - - -
- This member's metadata needs an update. It still uses the old JSON metadata system instead of the new 24bit integer-based system. Contact a developer to request an update. (only administrators can see this; file: /includes/data/--metadata.json) -
- -
-
- Private administrator information -
    -
  • ID: (, )
  • -
  • Files: -
      -
    • ()
    • -
    • ()
    • -
    • ()
    • -
    -
  • -
  • Date added: (, )
  • -
  • Pronouns:
  • -
  • Pronouns usage:
      $usage) { - if (is_string($usage) && $type !== "color") { - echo("
    • " . $type . ": " . $usage . "
    • "); - } - } - - ?>
  • -
  • Color: ;display:inline-block;width:16px;height:16px;border-radius:5px;vertical-align: middle;filter: invert(1) hue-rotate(180deg);"> # -
  • Bitset: (0x, )
  • Not using bitset; please update. -
  • Reduced name:
  • -
  • Shared memory access: ()
  • -
  • Protector: ()
  • -
  • Little: ()
  • -
  • Relations count:
  • - -
  • - Score breakdown: -
      -
    • Most common fronter score:
    • -
    • Relationships score:
    • -
    • Fictive score:
    • -
    • Median score:
    • -
    • Species score:
    • -
    • Little score:
    • -
    • Not talking score:
    • -
    • Protector score:
    • -
    • Name score:
    • -
    • Shared memory score:
    • -
    -
  • -
  • Full metadata:
      $usage) { - if (is_string($usage)) { - echo("
    • " . $type . ": " . $usage . "
    • "); - } else { - echo("
    • " . $type . ": " . json_encode($usage, JSON_UNESCAPED_SLASHES) . "
    • "); - } - } - - ?>
  • -
- -
-
- AI-generated page: - -
-
-
- - -
- is visiting the since , therefore currently not in the . -
- - -
-

Hello there!

-

I'm currently a new headmate slowly figuring myself out.

-

Give me some time to figure myself out and see this page change as I find new stuff about my identity. Don't be too worried if I accidentally get pushed to front, it's something that can happen sometimes.

- Thanks! -
- - -
- -
-

Hello there!

-

I'm currently not totally sure who I am (it's a thing that can happen with plurality), but I am using as a temporary identity to stay calm and not panic while I figure out what is going on and who I am.

-

I can either be an existing headmate who cannot work out they are fronting (this can sometimes happen when one of us gets pushed out of front), multiple headmates blurring who cannot work out who we are, or a new pony trying to figure out their identity (this can sometimes take a while).

- In all cases, feel free to ask! -
- -
-

Hello there!

-

I'm the result of more than one pony temporarily merging together to the point they are unable to be told apart (this can be done for various reasons). We have not registered this switch for the "Unknown" member since this merge is made on purpose.

-

Below is the list of who is merged, we can be either from a single system or from different systems.

- - - No members are currently merged. - -
- - - (edit: public, private) - - - - -
- - - - - -

This page is automatically generated and may not be 100% accurate.

- - - -
-
- - \ No newline at end of file diff --git a/includes/member/hierarchy.inc b/includes/member/hierarchy.inc new file mode 100644 index 0000000..dfb42c9 --- /dev/null +++ b/includes/member/hierarchy.inc @@ -0,0 +1,177 @@ + + +
+
+

's hierarchy

+
+ + + +

Part of:

+ + +
+ + 0): ?> +

Protected by:

+
+ +
+ +
+ +
+ +
+ + + 0): ?> +

Taken care of by:

+
+ +
+ +
+ +
+ +
+ + +

Member:

+
+
+ +
+
+ + 0): ?> +
+ +

Taking care of:

+
+ +
+ +
+ +
+ +
+ + + + \ No newline at end of file diff --git a/includes/member/hierarchy.php b/includes/member/hierarchy.php deleted file mode 100644 index 301bd1c..0000000 --- a/includes/member/hierarchy.php +++ /dev/null @@ -1,177 +0,0 @@ - - -
-
-

's hierarchy

-
- - - -

Part of:

- - -
- - 0): ?> -

Protected by:

-
- -
- -
- -
- -
- - - 0): ?> -

Taken care of by:

-
- -
- -
- -
- -
- - -

Member:

-
-
- -
-
- - 0): ?> -
- -

Taking care of:

-
- -
- -
- -
- -
- - - - \ No newline at end of file diff --git a/includes/member/tree.inc b/includes/member/tree.inc new file mode 100644 index 0000000..2e94951 --- /dev/null +++ b/includes/member/tree.inc @@ -0,0 +1,8 @@ + $day) { + foreach ($day as $index => $fronter) { + if (is_string($fronter)) { + $cloudburst[$id][$index] = [$fronter]; + } else if (is_array($fronter)) { + if (count($fronter) < 2) { + if (!isset($cloudburst[$id][$index][0])) $cloudburst[$id][$index][0] = null; + $cloudburst[$id][$index][1] = null; + } else if (count($fronter) > 2) { + $array = []; + + if (isset($cloudburst[$id][$index][0])) { + $array[0] = $cloudburst[$id][$index][0]; + } else { + $array[0] = null; + } + + if (isset($cloudburst[$id][$index][1])) { + $array[1] = $cloudburst[$id][$index][1]; + } else { + $array[1] = null; + } + + $cloudburst[$id][$index] = $array; + } + } + } +} + +foreach ($raindrops as $id => $day) { + foreach ($day as $index => $fronter) { + if (is_string($fronter)) { + $raindrops[$id][$index] = [$fronter]; + } else if (is_array($fronter)) { + if (count($fronter) < 2) { + if (!isset($raindrops[$id][$index][0])) $raindrops[$id][$index][0] = null; + $raindrops[$id][$index][1] = null; + } else if (count($fronter) > 2) { + $array = []; + + if (isset($raindrops[$id][$index][0])) { + $array[0] = $raindrops[$id][$index][0]; + } else { + $array[0] = null; + } + + if (isset($raindrops[$id][$index][1])) { + $array[1] = $raindrops[$id][$index][1]; + } else { + $array[1] = null; + } + + $raindrops[$id][$index] = $array; + } + } + } +} + +function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; ?> + + style="opacity: .75; pointer-events: none;"> + + + + style="opacity: .75; pointer-events: none;"> + Cloudburst System + Raindrops System + + + style="opacity: .75; pointer-events: none;"> + + + + + colspan="3" colspan="2"> + + + Multiple merged membersMerge + + " style="width:24px;"> + + + + + + + + + + + + + Multiple merged membersMerge + + " style="width:24px;"> + + + + + + + + Add new fronter + + + + + + + + + + + colspan="3" colspan="2"> + + Multiple merged membersMerge + + " style="width:24px;"> + + + + + + + + + + + + + Multiple merged membersMerge + + " style="width:24px;"> + + + + + + + + Add new fronter + + + + + + + + style="opacity: .75; pointer-events: none;"> + + 0 && count($dayRaindrops) > 0): ?> + will sleep with + + Unable to calculate who will sleep with who + + + + + + +

Front planner

+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/includes/planner.php b/includes/planner.php deleted file mode 100644 index f98d83b..0000000 --- a/includes/planner.php +++ /dev/null @@ -1,926 +0,0 @@ - $day) { - foreach ($day as $index => $fronter) { - if (is_string($fronter)) { - $cloudburst[$id][$index] = [$fronter]; - } else if (is_array($fronter)) { - if (count($fronter) < 2) { - if (!isset($cloudburst[$id][$index][0])) $cloudburst[$id][$index][0] = null; - $cloudburst[$id][$index][1] = null; - } else if (count($fronter) > 2) { - $array = []; - - if (isset($cloudburst[$id][$index][0])) { - $array[0] = $cloudburst[$id][$index][0]; - } else { - $array[0] = null; - } - - if (isset($cloudburst[$id][$index][1])) { - $array[1] = $cloudburst[$id][$index][1]; - } else { - $array[1] = null; - } - - $cloudburst[$id][$index] = $array; - } - } - } -} - -foreach ($raindrops as $id => $day) { - foreach ($day as $index => $fronter) { - if (is_string($fronter)) { - $raindrops[$id][$index] = [$fronter]; - } else if (is_array($fronter)) { - if (count($fronter) < 2) { - if (!isset($raindrops[$id][$index][0])) $raindrops[$id][$index][0] = null; - $raindrops[$id][$index][1] = null; - } else if (count($fronter) > 2) { - $array = []; - - if (isset($raindrops[$id][$index][0])) { - $array[0] = $raindrops[$id][$index][0]; - } else { - $array[0] = null; - } - - if (isset($raindrops[$id][$index][1])) { - $array[1] = $raindrops[$id][$index][1]; - } else { - $array[1] = null; - } - - $raindrops[$id][$index] = $array; - } - } - } -} - -function day($display, $diff): void { global $cloudburst; global $raindrops; ?> - - - - - - - Cloudburst System - Raindrops System - - - - - - - - colspan="3" colspan="2"> - - - Multiple merged membersMerge - - .png" style="width:24px;"> - - - - - - - - - - - - - Multiple merged membersMerge - - .png" style="width:24px;"> - - - - - - - - Add new fronter - - - - - - - - - - - colspan="3" colspan="2"> - - Multiple merged membersMerge - - .png" style="width:24px;"> - - - - - - - - - - - - - Multiple merged membersMerge - - .png" style="width:24px;"> - - - - - - - - Add new fronter - - - - - - - - - - 0 && count($dayRaindrops) > 0): ?> - will sleep with - - Unable to calculate who will sleep with who - - - - - - -

Front planner

- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/includes/pleasure.inc b/includes/pleasure.inc new file mode 100644 index 0000000..8b4835b --- /dev/null +++ b/includes/pleasure.inc @@ -0,0 +1,114 @@ +

Pleasure alert +
+ + · +
+

+ +Turn ON + +

Sending next notification never

+ + + + + + \ No newline at end of file diff --git a/includes/pleasure.php b/includes/pleasure.php deleted file mode 100644 index 8b4835b..0000000 --- a/includes/pleasure.php +++ /dev/null @@ -1,114 +0,0 @@ -

Pleasure alert -
- - · -
-

- -Turn ON - -

Sending next notification never

- - - - - - \ No newline at end of file diff --git a/includes/pronouns.inc b/includes/pronouns.inc new file mode 100644 index 0000000..6ab2487 --- /dev/null +++ b/includes/pronouns.inc @@ -0,0 +1,149 @@ + [ + "gender" => "ponygender", + "gender:fr" => "poneygenre", + "object" => "pony", + "person" => "pony", + "possessive_det" => "pony's", + "possessive_pro" => "pony's", + "reflexive" => "ponyself", + "subjective" => "pony", + "third" => true, + "color" => "warning" + ], + "she" => [ + "gender" => "female", + "gender:fr" => "fille", + "object" => "her", + "person" => "girl", + "possessive_det" => "her", + "possessive_pro" => "hers", + "reflexive" => "herself", + "subjective" => "she", + "third" => true, + "color" => "success" + ], + "he" => [ + "gender" => "male", + "gender:fr" => "garçon", + "object" => "him", + "person" => "boy", + "possessive_det" => "his", + "possessive_pro" => "his", + "reflexive" => "himself", + "subjective" => "he", + "third" => true, + "color" => "info" + ], + "it" => [ + "gender" => "agender", + "gender:fr" => "agenre", + "object" => "it", + "person" => "person", + "possessive_det" => "its", + "possessive_pro" => "its", + "reflexive" => "itself", + "subjective" => "it", + "third" => true, + "color" => "light" + ], + "they" => [ + "gender" => "non binary", + "gender:fr" => "non binaire", + "object" => "them", + "person" => "person", + "possessive_det" => "their", + "possessive_pro" => "theirs", + "reflexive" => "themself", + "subjective" => "they", + "third" => false, + "color" => "primary" + ] +]; + +$pronounGetCount = 0; + +$possibilitiesPerSet = []; +foreach ($pronounsSets as $name => $set) { + if (!isset($possibilitiesPerSet[$name])) $possibilitiesPerSet[$name] = []; + $possibilitiesPerSet[$name][] = $name; + + foreach ($set as $category => $value) { + if (is_string($value)) $possibilitiesPerSet[$name][] = $value; + } +} + +function getSetFromValue(string $value) { + global $possibilitiesPerSet; + + foreach ($possibilitiesPerSet as $name => $set) { + if (in_array($value, $set)) { + return $name; + } + } + + return null; +} + +function getPronounsFromMark(?string $mark = null): array { + if (!isset($mark) || trim($mark) === "") { + return ["they"]; + } else { + $parts = array_unique(array_map(function ($i) { + return getSetFromValue($i); + }, explode("/", $mark))); + return $parts; + } +} + +function getMemberPronouns(?string $pronouns): ?array { + global $pronounsSets; + $list = getPronounsFromMark($pronouns); + return $pronounsSets[$list[array_rand($list)]] ?? $pronounsSets["she"]; +} + +function getGenderFromPronoun(string $pronoun, bool $french = false) { + global $pronounsSets; + $set = getPronounsFromMark($pronoun)[0]; + + if ($french) { + return ($pronounsSets[$set] ?? $pronounsSets["they"])["gender:fr"]; + } else { + return ($pronounsSets[$set] ?? $pronounsSets["they"])["gender"]; + } +} + +function pronounInFrench(string $pronoun): string { + return match ($pronoun) { + "she" => "elle", + "her" => "elle", + "he" => "il", + "him" => "lui", + "they" => "iel", + "them" => "iel", + "it" => "iel", + "its" => "iel", + "pony" => "poney", + "pony's" => "à poney", + "ponys" => "à poney", + default => $pronoun, + }; +} + +function getTooltipsFromMark(string $mark = null, bool $french = false): ?string { + if (!isset($mark)) { + return null; + } else { + if ($french) { + return implode("/", array_map(function ($i) { + return "" . pronounInFrench($i) . ""; + }, explode("/", $mark))); + } else { + return implode("/", array_map(function ($i) { + return "" . $i . ""; + }, explode("/", $mark))); + } + } +} \ No newline at end of file diff --git a/includes/pronouns.php b/includes/pronouns.php deleted file mode 100644 index 6ab2487..0000000 --- a/includes/pronouns.php +++ /dev/null @@ -1,149 +0,0 @@ - [ - "gender" => "ponygender", - "gender:fr" => "poneygenre", - "object" => "pony", - "person" => "pony", - "possessive_det" => "pony's", - "possessive_pro" => "pony's", - "reflexive" => "ponyself", - "subjective" => "pony", - "third" => true, - "color" => "warning" - ], - "she" => [ - "gender" => "female", - "gender:fr" => "fille", - "object" => "her", - "person" => "girl", - "possessive_det" => "her", - "possessive_pro" => "hers", - "reflexive" => "herself", - "subjective" => "she", - "third" => true, - "color" => "success" - ], - "he" => [ - "gender" => "male", - "gender:fr" => "garçon", - "object" => "him", - "person" => "boy", - "possessive_det" => "his", - "possessive_pro" => "his", - "reflexive" => "himself", - "subjective" => "he", - "third" => true, - "color" => "info" - ], - "it" => [ - "gender" => "agender", - "gender:fr" => "agenre", - "object" => "it", - "person" => "person", - "possessive_det" => "its", - "possessive_pro" => "its", - "reflexive" => "itself", - "subjective" => "it", - "third" => true, - "color" => "light" - ], - "they" => [ - "gender" => "non binary", - "gender:fr" => "non binaire", - "object" => "them", - "person" => "person", - "possessive_det" => "their", - "possessive_pro" => "theirs", - "reflexive" => "themself", - "subjective" => "they", - "third" => false, - "color" => "primary" - ] -]; - -$pronounGetCount = 0; - -$possibilitiesPerSet = []; -foreach ($pronounsSets as $name => $set) { - if (!isset($possibilitiesPerSet[$name])) $possibilitiesPerSet[$name] = []; - $possibilitiesPerSet[$name][] = $name; - - foreach ($set as $category => $value) { - if (is_string($value)) $possibilitiesPerSet[$name][] = $value; - } -} - -function getSetFromValue(string $value) { - global $possibilitiesPerSet; - - foreach ($possibilitiesPerSet as $name => $set) { - if (in_array($value, $set)) { - return $name; - } - } - - return null; -} - -function getPronounsFromMark(?string $mark = null): array { - if (!isset($mark) || trim($mark) === "") { - return ["they"]; - } else { - $parts = array_unique(array_map(function ($i) { - return getSetFromValue($i); - }, explode("/", $mark))); - return $parts; - } -} - -function getMemberPronouns(?string $pronouns): ?array { - global $pronounsSets; - $list = getPronounsFromMark($pronouns); - return $pronounsSets[$list[array_rand($list)]] ?? $pronounsSets["she"]; -} - -function getGenderFromPronoun(string $pronoun, bool $french = false) { - global $pronounsSets; - $set = getPronounsFromMark($pronoun)[0]; - - if ($french) { - return ($pronounsSets[$set] ?? $pronounsSets["they"])["gender:fr"]; - } else { - return ($pronounsSets[$set] ?? $pronounsSets["they"])["gender"]; - } -} - -function pronounInFrench(string $pronoun): string { - return match ($pronoun) { - "she" => "elle", - "her" => "elle", - "he" => "il", - "him" => "lui", - "they" => "iel", - "them" => "iel", - "it" => "iel", - "its" => "iel", - "pony" => "poney", - "pony's" => "à poney", - "ponys" => "à poney", - default => $pronoun, - }; -} - -function getTooltipsFromMark(string $mark = null, bool $french = false): ?string { - if (!isset($mark)) { - return null; - } else { - if ($french) { - return implode("/", array_map(function ($i) { - return "" . pronounInFrench($i) . ""; - }, explode("/", $mark))); - } else { - return implode("/", array_map(function ($i) { - return "" . $i . ""; - }, explode("/", $mark))); - } - } -} \ No newline at end of file diff --git a/includes/rail.inc b/includes/rail.inc new file mode 100644 index 0000000..b2ed467 --- /dev/null +++ b/includes/rail.inc @@ -0,0 +1,176 @@ + + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/includes/rainbow.inc b/includes/rainbow.inc new file mode 100644 index 0000000..470f288 --- /dev/null +++ b/includes/rainbow.inc @@ -0,0 +1,57 @@ + $member + ]; + + if (isset($member["color"])) { + $data[$member["name"]]["rgb"] = [ + hexdec(substr($member["color"], 0, 2)), + hexdec(substr($member["color"], 2, 2)), + hexdec(substr($member["color"], 4, 2)) + ]; + $data[$member["name"]]["hsl"] = rgbToHsl( + $data[$member["name"]]["rgb"][0], + $data[$member["name"]]["rgb"][1], + $data[$member["name"]]["rgb"][2] + ); + } else { + $data[$member["name"]]["rgb"] = [255, 255, 255]; + $data[$member["name"]]["hsl"] = rgbToHsl(255, 255, 255); + } + } + + return $data; +} + +function getMembersByColor(): array { + $members = rainbow(); + uasort($members, function ($a, $b) { + return $a['hsl'][0] - $b['hsl'][0]; + }); + $members = [ + ...array_filter($members, function ($i) { + return $i['hsl'][2] < 0.9 || $i['hsl'][1] > 0.2; + }), + ...array_filter($members, function ($i) { + return $i['hsl'][2] >= 0.9 || $i['hsl'][1] <= 0.2; + }) + ]; + + $sorted = []; + foreach ($members as $data) { + $data["_data"]["hue"] = $data["hsl"][0]; + $sorted[] = $data["_data"]; + } + + return $sorted; +} \ No newline at end of file diff --git a/includes/rainbow.php b/includes/rainbow.php deleted file mode 100644 index c710be0..0000000 --- a/includes/rainbow.php +++ /dev/null @@ -1,97 +0,0 @@ - $g) { - $h += 360; - } - break; - - case $g: - $h = 60 * (($b - $r) / $d + 2); - break; - - case $b: - $h = 60 * (($r - $g) / $d + 4); - break; - } - } - - return array(round($h, 2), round($s, 2), round($l, 2)); -} - -function rainbow(): array { - $members = scoreOrderGlobal(); - $data = []; - - foreach ($members as $member) { - $data[$member["name"]] = [ - "_data" => $member - ]; - - if (isset($member["color"])) { - $data[$member["name"]]["rgb"] = [ - hexdec(substr($member["color"], 0, 2)), - hexdec(substr($member["color"], 2, 2)), - hexdec(substr($member["color"], 4, 2)) - ]; - $data[$member["name"]]["hsl"] = rgbToHsl( - $data[$member["name"]]["rgb"][0], - $data[$member["name"]]["rgb"][1], - $data[$member["name"]]["rgb"][2] - ); - } else { - $data[$member["name"]]["rgb"] = [255, 255, 255]; - $data[$member["name"]]["hsl"] = rgbToHsl(255, 255, 255); - } - } - - return $data; -} - -function getMembersByColor(): array { - $members = rainbow(); - uasort($members, function ($a, $b) { - return $a['hsl'][0] - $b['hsl'][0]; - }); - $members = [ - ...array_filter($members, function ($i) { - return $i['hsl'][2] < 0.9 || $i['hsl'][1] > 0.2; - }), - ...array_filter($members, function ($i) { - return $i['hsl'][2] >= 0.9 || $i['hsl'][1] <= 0.2; - }) - ]; - - $sorted = []; - foreach ($members as $data) { - $data["_data"]["hue"] = $data["hsl"][0]; - $sorted[] = $data["_data"]; - } - - return $sorted; -} \ No newline at end of file diff --git a/includes/random.inc b/includes/random.inc new file mode 100644 index 0000000..b6e7905 --- /dev/null +++ b/includes/random.inc @@ -0,0 +1,15 @@ + $versionHash[1], + "old" => isset($version["list"]) ? $version["list"]["current"] ?? null : null + ]; + $version["build"]++; +} else { + $version["revision"]++; +} + +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json", json_encode($version)); +$times["version"] = microtime(true) - $currentOpStart; + $currentOpStart = microtime(true); foreach (array_filter(scandir("./data"), function ($i) { - return !str_starts_with($i, ".") && $i !== "backup" && is_file("./data/" . $i); + return !str_starts_with($i, ".") && $i !== "backup" && (is_file("./data/" . $i) || is_dir("./data/" . $i)); }) as $file) { - $files[] = $file; + if (is_dir("./data/" . $file)) { + foreach (array_filter(scandir("./data"), function ($i) use ($file) { + return !str_starts_with($i, ".") && $i !== "backup" && is_file("./data/" . $file . "/" . $i); + }) as $file2) { + @mkdir("./data/backup/" . $file); + $files[] = $file . "/" . $file2; + } + } else { + $files[] = $file; + } } @mkdir("./data/backup"); @@ -57,17 +132,28 @@ function getSystem(string $id) { echo(" Base system info\n"); $currentOpStart = microtime(true); - file_put_contents("./data/$id-general.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id")); + $data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id"); + + if (trim($data) !== "" && $data !== false) { + file_put_contents("./data/$id/general.json", $data); + } $times["system-general-$id"] = microtime(true) - $currentOpStart; echo(" System members\n"); $currentOpStart = microtime(true); - file_put_contents("./data/$id-members.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/members")); + $data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/members"); + + if (trim($data) !== "" && $data !== false) { + file_put_contents("./data/$id/members.json", $data); + } $times["system-members-$id"] = microtime(true) - $currentOpStart; echo(" Fronters\n"); - $currentOpStart = microtime(true); - file_put_contents("./data/$id-fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/fronters")); + $data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/fronters"); + + if (trim($data) !== "" && $data !== false) { + file_put_contents("./data/$id/fronters.json", $data); + } $times["system-fronters-$id"] = microtime(true) - $currentOpStart; echo(" Switches\n"); @@ -84,8 +170,10 @@ function getSystem(string $id) { echo(" Part 3/3\n"); $switches3 = json_decode(file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/switches?before=$oldest"), true); - file_put_contents("./data/$id-switches.json", json_encode([...$switches1, ...$switches2, ...$switches3], JSON_PRETTY_PRINT)); - $times["system-switches-$id"] = microtime(true) - $currentOpStart; + if ($switches1 !== null && $switches2 !== null && $switches3 !== null) { + file_put_contents("./data/$id/switches.json", json_encode([...$switches1, ...$switches2, ...$switches3], JSON_PRETTY_PRINT)); + $times["system-switches-$id"] = microtime(true) - $currentOpStart; + } } getSystem("gdapd"); // Raindrops @@ -93,13 +181,13 @@ getSystem("ynmuc"); // Cloudburst echo("Calendar\n"); $currentOpStart = microtime(true); -file_put_contents("./data/calendar.ics", file_get_contents($app["calendar"])); +file_put_contents("./data/calendar/calendar.ics", file_get_contents($app["calendar"])); $times["calendar"] = microtime(true) - $currentOpStart; echo("Downloading images.\n"); if (!file_exists("./data/images")) mkdir("./data/images"); -foreach (json_decode(file_get_contents("./data/gdapd-members.json"), true) as $member) { +foreach (json_decode(file_get_contents("./data/gdapd/members.json"), true) as $member) { $currentOpStart2 = microtime(true); echo(" " . $member['id'] . "\n"); @@ -117,7 +205,7 @@ foreach (json_decode(file_get_contents("./data/gdapd-members.json"), true) as $m $times["images-gdapd-" . $member['id']] = microtime(true) - $currentOpStart2; } -foreach (json_decode(file_get_contents("./data/ynmuc-members.json"), true) as $member) { +foreach (json_decode(file_get_contents("./data/ynmuc/members.json"), true) as $member) { $currentOpStart2 = microtime(true); echo(" " . $member['id'] . "\n"); @@ -152,12 +240,36 @@ $times["restore"] = microtime(true) - $currentOpStart; echo("Backing up...\n"); if (date('i') === "00") { - require_once "./backup.php"; + require_once "./backup.inc"; echo("Backup completed\n"); } else { echo("Backup skipped\n"); } +echo("Generating logo...\n"); + +$currentOpStart = microtime(true); +require_once "./logo.inc"; +$times["logo"] = microtime(true) - $currentOpStart; + +echo("Generated logo\n"); + +echo("Generating favicons...\n"); + +$currentOpStart = microtime(true); +require_once "./icons.inc"; +$times["favicons"] = microtime(true) - $currentOpStart; + +echo("Generated favicons\n"); + +echo("Downloading assets...\n"); + +$currentOpStart = microtime(true); +require_once "./assets.inc"; +$times["assets"] = microtime(true) - $currentOpStart; + +echo("Downloading assets\n"); + $time = array_sum($times); echo("Completed in " . $time . " seconds.\n"); diff --git a/includes/restore.inc b/includes/restore.inc new file mode 100644 index 0000000..72748ab --- /dev/null +++ b/includes/restore.inc @@ -0,0 +1,130 @@ += 0) { + return $tense = "now"; + } elseif ($difference > 0) { + $tense = "ago"; + } else { + $tense = "later"; + } + + for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { + $difference /= $lengths[$j]; + } + + $difference = round($difference); + + $period = $periods[$j] . ($difference >1 ? "s" :''); + return "{$difference} {$period} {$tense}"; +} + +if (!isset($_SERVER['argv'][1]) || !isset($_SERVER['argv'][2])) { + echo("Usage: php " . $_SERVER['argv'][0] . " \n"); + die(); +} else { + $file = @file_get_contents($_SERVER['argv'][1]); + $raw = @file_get_contents($_SERVER['argv'][2]); + + if ($file === false) { + echo("Unable to open backup file\n"); + die(); + } + + if ($raw === false) { + echo("Unable to open key file\n"); + die(); + } + + $raw2 = base64_decode($raw); + + if (!isJson($raw2)) { + echo("Key file is corrupt\n"); + die(); + } + + $keydata = json_decode($raw2, true); + + if (!is_array($keydata) || !isset($keydata["iv"]) || !isset($keydata["key"])) { + echo("Key file is invalid\n"); + die(); + } + + $iv = hex2bin($keydata["iv"]); + $key = hex2bin($keydata["key"]); + + $decrypted = openssl_decrypt($file, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv); + + if ($decrypted === false) { + echo("Unable to decrypt backup\n"); + die(); + } + + $unpadded = pkcs7_unpad($decrypted); + + if (!is_string($unpadded)) { + echo("Unable to decrypt backup\n"); + die(); + } + + if (!isJson($unpadded)) { + echo("Backup is corrupt\n"); + die(); + } + + $data = json_decode($unpadded, true); + + if (!is_array($data) || !isset($data["date"]) || !isset($data["files"])) { + echo("Backup is invalid\n"); + die(); + } + + echo(realpath($_SERVER['argv'][1]) . "\n Key: " . $_SERVER['argv'][2] . "\n Date: " . date('r', strtotime($data["date"])) . " (" . timeAgo($data["date"]) . ")" . "\n Contents: " . count($data["files"]) . " files\n"); + + @mkdir("./_restored"); + + $index = 0; + foreach ($data["files"] as $file) { + if ($file["dir"] === "") { + print("[$index] /" . $file["file"] . "\n"); + } else { + print("[$index] /" . $file["dir"] . "/" . $file["file"] . "\n"); + } + + $content = base64_decode($file["content"]); + if (sha1($content) !== $file["checksum"][0]) { + print(" Backed up file is corrupted (SHA1 mismatch)\n Expected: " . $file["checksum"][0] . "\n Got: " . sha1($content) . "\n"); + die("Backup aborted.\n"); + } + if (md5($content) !== $file["checksum"][1]) { + print(" Backed up file is corrupted (MD5 mismatch)\n Expected: " . $file["checksum"][1] . "\n Got: " . md5($content) . "\n"); + die("Backup aborted.\n"); + } + + @mkdir("./_restored/" . $file["dir"], 0777, true); + file_put_contents("./_restored/" . $file["dir"] . "/" . $file["file"], $content); + + $index++; + } + + print("Restored backup to ./_restored; review files before restoring to production\n"); +} \ No newline at end of file diff --git a/includes/restore.php b/includes/restore.php deleted file mode 100644 index 72748ab..0000000 --- a/includes/restore.php +++ /dev/null @@ -1,130 +0,0 @@ -= 0) { - return $tense = "now"; - } elseif ($difference > 0) { - $tense = "ago"; - } else { - $tense = "later"; - } - - for ($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { - $difference /= $lengths[$j]; - } - - $difference = round($difference); - - $period = $periods[$j] . ($difference >1 ? "s" :''); - return "{$difference} {$period} {$tense}"; -} - -if (!isset($_SERVER['argv'][1]) || !isset($_SERVER['argv'][2])) { - echo("Usage: php " . $_SERVER['argv'][0] . " \n"); - die(); -} else { - $file = @file_get_contents($_SERVER['argv'][1]); - $raw = @file_get_contents($_SERVER['argv'][2]); - - if ($file === false) { - echo("Unable to open backup file\n"); - die(); - } - - if ($raw === false) { - echo("Unable to open key file\n"); - die(); - } - - $raw2 = base64_decode($raw); - - if (!isJson($raw2)) { - echo("Key file is corrupt\n"); - die(); - } - - $keydata = json_decode($raw2, true); - - if (!is_array($keydata) || !isset($keydata["iv"]) || !isset($keydata["key"])) { - echo("Key file is invalid\n"); - die(); - } - - $iv = hex2bin($keydata["iv"]); - $key = hex2bin($keydata["key"]); - - $decrypted = openssl_decrypt($file, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv); - - if ($decrypted === false) { - echo("Unable to decrypt backup\n"); - die(); - } - - $unpadded = pkcs7_unpad($decrypted); - - if (!is_string($unpadded)) { - echo("Unable to decrypt backup\n"); - die(); - } - - if (!isJson($unpadded)) { - echo("Backup is corrupt\n"); - die(); - } - - $data = json_decode($unpadded, true); - - if (!is_array($data) || !isset($data["date"]) || !isset($data["files"])) { - echo("Backup is invalid\n"); - die(); - } - - echo(realpath($_SERVER['argv'][1]) . "\n Key: " . $_SERVER['argv'][2] . "\n Date: " . date('r', strtotime($data["date"])) . " (" . timeAgo($data["date"]) . ")" . "\n Contents: " . count($data["files"]) . " files\n"); - - @mkdir("./_restored"); - - $index = 0; - foreach ($data["files"] as $file) { - if ($file["dir"] === "") { - print("[$index] /" . $file["file"] . "\n"); - } else { - print("[$index] /" . $file["dir"] . "/" . $file["file"] . "\n"); - } - - $content = base64_decode($file["content"]); - if (sha1($content) !== $file["checksum"][0]) { - print(" Backed up file is corrupted (SHA1 mismatch)\n Expected: " . $file["checksum"][0] . "\n Got: " . sha1($content) . "\n"); - die("Backup aborted.\n"); - } - if (md5($content) !== $file["checksum"][1]) { - print(" Backed up file is corrupted (MD5 mismatch)\n Expected: " . $file["checksum"][1] . "\n Got: " . md5($content) . "\n"); - die("Backup aborted.\n"); - } - - @mkdir("./_restored/" . $file["dir"], 0777, true); - file_put_contents("./_restored/" . $file["dir"] . "/" . $file["file"], $content); - - $index++; - } - - print("Restored backup to ./_restored; review files before restoring to production\n"); -} \ No newline at end of file diff --git a/includes/score.inc b/includes/score.inc new file mode 100644 index 0000000..c35e9bc --- /dev/null +++ b/includes/score.inc @@ -0,0 +1,86 @@ + $scoreHost, + "fictive" => $scoreFictive, + "little" => $scoreLittle, + "median" => $scoreMedian, + "not_talking" => $scoreNotTalking, + "name" => $scoreName, + "protector" => $scoreProtector, + "shared_memory" => $scoreSharedMemory, + "relations" => $scoreRelations, + "species" => $scoreSpecies, + "additional" => $scoreAdd, + "total" => $score + ]; +} + +function scoreOrder($members, $system) { + $ordered = []; + foreach ($members as $member) { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) { + $systemID = $member["system"] ?? $system; + + $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); + $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)), $member["display_name"] ?? $member["name"]); + $ordered[] = $member; + } + } + + uasort($ordered, function($a, $b) { + return $b["_score"]["total"] - $a["_score"]["total"]; + }); + + return $ordered; +} + +function scoreOrderGlobal() { + $ordered = []; + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) { + $member["_system"] = "gdapd"; + $member["system"] = "gdapd"; + $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); + $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)), $member["display_name"] ?? $member["name"]); + $ordered[] = $member; + } + } + + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) { + $member["_system"] = "ynmuc"; + $member["system"] = "ynmuc"; + $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); + $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)), $member["display_name"] ?? $member["name"]); + $ordered[] = $member; + } + } + + uasort($ordered, function($a, $b) { + return $b["_score"]["total"] - $a["_score"]["total"]; + }); + + return array_values($ordered); +} \ No newline at end of file diff --git a/includes/score.php b/includes/score.php deleted file mode 100644 index cd8c389..0000000 --- a/includes/score.php +++ /dev/null @@ -1,81 +0,0 @@ - $scoreHost, - "fictive" => $scoreFictive, - "little" => $scoreLittle, - "median" => $scoreMedian, - "not_talking" => $scoreNotTalking, - "name" => $scoreName, - "protector" => $scoreProtector, - "shared_memory" => $scoreSharedMemory, - "relations" => $scoreRelations, - "species" => $scoreSpecies, - "additional" => $scoreAdd, - "total" => $score - ]; -} - -function scoreOrder($members, $system) { - $ordered = []; - foreach ($members as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($member["system"] ?? $system) . "-$member[id]-metadata.json")) { - $systemID = $member["system"] ?? $system; - - $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$member[id]-metadata.json"), true)); - $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$member[id]-metadata.json"), true)), $member["display_name"] ?? $member["name"]); - $ordered[] = $member; - } - } - - uasort($ordered, function($a, $b) { - return $b["_score"]["total"] - $a["_score"]["total"]; - }); - - return $ordered; -} - -function scoreOrderGlobal() { - $ordered = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json")) { - $member["_system"] = "gdapd"; - $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); - $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)), $member["display_name"] ?? $member["name"]); - $ordered[] = $member; - } - } - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json")) { - $member["_system"] = "ynmuc"; - $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); - $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)), $member["display_name"] ?? $member["name"]); - $ordered[] = $member; - } - } - - uasort($ordered, function($a, $b) { - return $b["_score"]["total"] - $a["_score"]["total"]; - }); - - return $ordered; -} \ No newline at end of file diff --git a/includes/search.inc b/includes/search.inc new file mode 100644 index 0000000..d8e573f --- /dev/null +++ b/includes/search.inc @@ -0,0 +1,529 @@ + + + + + + + + \ No newline at end of file diff --git a/includes/search.php b/includes/search.php deleted file mode 100644 index 037b6de..0000000 --- a/includes/search.php +++ /dev/null @@ -1,529 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/includes/session.inc b/includes/session.inc new file mode 100644 index 0000000..b440c9c --- /dev/null +++ b/includes/session.inc @@ -0,0 +1,41 @@ + "/raindrops", + "cb" => "/cloudburst", + "minty" => "/cloudydreams", + "cloudy" => "/cloudydreams", + "zipp" => "/zippstorm", + "babs" => "/babsseed", + "frost" => "/frostcrystals", + "violet" => "/violetdawn" +]; + +foreach ($members as $member) { + for ($i = 1; $i < strlen($member["name"]); $i++) { + $part = substr($member["name"], 0, $i); + + if (in_array($part, array_keys($list))) { + $list[$part] = false; + } else { + $list[$part] = "/" . $member["name"]; + } + } + + foreach ($member["proxy_tags"] as $proxy) { + $system = $member["_system"] === "gdapd" ? "rd" : "cb"; + $list[$system . preg_replace("/[^a-z]/m", "", $proxy["prefix"])] = "/" . $member["name"]; + } + + $list[$member["id"]] = "/" . $member["name"]; + $list[$member["uuid"]] = "/" . $member["name"]; +} + +$list["minty"] = "/cloudy"; + +if (in_array($toplevel, array_keys($list)) && $list[$toplevel]) { + if ($toplevel !== "unknown") { + header("Location: " . $list[$toplevel]); + } else { + header("Location: /?error=Page not found: " . strip_tags($toplevel)) and die(); + } +} else { + header("Location: /?error=Page not found: " . strip_tags($toplevel)) and die(); +} \ No newline at end of file diff --git a/includes/short.php b/includes/short.php deleted file mode 100644 index 59b3cae..0000000 --- a/includes/short.php +++ /dev/null @@ -1,52 +0,0 @@ - "/raindrops", - "cb" => "/cloudburst", - "minty" => "/cloudydreams", - "cloudy" => "/cloudydreams", - "zipp" => "/zippstorm", - "babs" => "/babsseed", - "frost" => "/frostcrystals", - "violet" => "/violetdawn" -]; - -foreach ($members as $member) { - for ($i = 1; $i < strlen($member["name"]); $i++) { - $part = substr($member["name"], 0, $i); - - if (in_array($part, array_keys($list))) { - $list[$part] = false; - } else { - $list[$part] = "/" . $member["name"]; - } - } - - foreach ($member["proxy_tags"] as $proxy) { - $system = $member["_system"] === "gdapd" ? "rd" : "cb"; - $list[$system . preg_replace("/[^a-z]/m", "", $proxy["prefix"])] = "/" . $member["name"]; - } - - $list[$member["id"]] = "/" . $member["name"]; - $list[$member["uuid"]] = "/" . $member["name"]; -} - -$list["minty"] = "/cloudy"; - -if (in_array($toplevel, array_keys($list)) && $list[$toplevel]) { - if ($toplevel !== "unknown") { - header("Location: " . $list[$toplevel]); - } else { - header("Location: /?error=Page not found: " . strip_tags($toplevel)) and die(); - } -} else { - header("Location: /?error=Page not found: " . strip_tags($toplevel)) and die(); -} \ No newline at end of file diff --git a/includes/subsysbanner.inc b/includes/subsysbanner.inc new file mode 100644 index 0000000..176380f --- /dev/null +++ b/includes/subsysbanner.inc @@ -0,0 +1,70 @@ + + +
+ +
+
+

+
+ + Fronter: + + ">" style="width:24px;"> + + N/A + + + + + Last fronter: ">" style="width:24px;"> + + + Members: + + + Parent system: + +
+
+
+
+ +
+
+ You are viewing the page of a subsystem of the . +
+
\ No newline at end of file diff --git a/includes/subsysbanner.php b/includes/subsysbanner.php deleted file mode 100644 index 7788155..0000000 --- a/includes/subsysbanner.php +++ /dev/null @@ -1,69 +0,0 @@ - - -
- -
-
-

-
- - Fronter: - - ">.png" style="width:24px;"> - - N/A - - - - - Last fronter: ">.png" style="width:24px;"> - - - Members: - - - Parent system: - -
-
-
-
- -
-
- You are viewing the page of a subsystem of the . -
-
\ No newline at end of file diff --git a/includes/subsysedit.inc b/includes/subsysedit.inc new file mode 100644 index 0000000..e9c4b4c --- /dev/null +++ b/includes/subsysedit.inc @@ -0,0 +1,143 @@ + + +
+
+ +
+ +

+ Saved · bytes +

+ + + + + + + + +
+ + \ No newline at end of file diff --git a/includes/subsysedit.php b/includes/subsysedit.php deleted file mode 100644 index e6aa9ca..0000000 --- a/includes/subsysedit.php +++ /dev/null @@ -1,143 +0,0 @@ - - -
-
- -
- -

- Saved · bytes -

- - - - - - - - -
- - \ No newline at end of file diff --git a/includes/sysbanner.inc b/includes/sysbanner.inc new file mode 100644 index 0000000..d3caecd --- /dev/null +++ b/includes/sysbanner.inc @@ -0,0 +1,132 @@ + + +
+ +
+
+

+
+ + + + Fronter: + + + ">" style="width:24px;"> More than one" : $member["name"])) ?> + + +
(with + ">" style="width:24px;"> More than one" : $member2["name"])) ?>) + + - +
+ + Last fronter: + + ">" style="width:24px;"> More than one" : $member["name"])) ?> + +
(with + ">" style="width:24px;"> More than one" : $member2["name"])) ?>) + + - +
+ + + Members: 0) { + echo("
+ " . count($travellers) . " traveller" . (count($travellers) > 1 ? "s" : "")); + } + + ?> +
+ + Last switch: "> + +
+
+
+
+ + \ No newline at end of file diff --git a/includes/sysbanner.php b/includes/sysbanner.php deleted file mode 100644 index 45c1c16..0000000 --- a/includes/sysbanner.php +++ /dev/null @@ -1,132 +0,0 @@ - - -
- -
-
-

-
- - - - Fronter: - - - ">.png" style="width:24px;"> More than one" : $member["name"])) ?> - - -
(with - ">.png" style="width:24px;"> More than one" : $member2["name"])) ?>) - - - - -
- - Last fronter: - - ">.png" style="width:24px;"> More than one" : $member["name"])) ?> - -
(with - ">.png" style="width:24px;"> More than one" : $member2["name"])) ?>) - - - - -
- - - Members: 0) { - echo("
+ " . count($travellers) . " traveller" . (count($travellers) > 1 ? "s" : "")); - } - - ?> -
- - Last switch: "> - -
-
-
-
- - \ No newline at end of file diff --git a/includes/sysedit.inc b/includes/sysedit.inc new file mode 100644 index 0000000..95a0b5b --- /dev/null +++ b/includes/sysedit.inc @@ -0,0 +1,143 @@ + + +
+
+ +
+ +

+ Saved · bytes +

+ + + + + + + + +
+ + \ No newline at end of file diff --git a/includes/sysedit.php b/includes/sysedit.php deleted file mode 100644 index 0eca518..0000000 --- a/includes/sysedit.php +++ /dev/null @@ -1,143 +0,0 @@ - - -
-
- -
- -

- Saved · bytes -

- - - - - - - - -
- - \ No newline at end of file diff --git a/includes/system.inc b/includes/system.inc new file mode 100644 index 0000000..099f522 --- /dev/null +++ b/includes/system.inc @@ -0,0 +1,19 @@ + + +
+
+ +
+ +
+ + (edit) + + +
+ +
+ + \ No newline at end of file diff --git a/includes/system.php b/includes/system.php deleted file mode 100644 index 46adeb1..0000000 --- a/includes/system.php +++ /dev/null @@ -1,19 +0,0 @@ - - -
-
- -
- -
- - (edit) - - -
- -
- - \ No newline at end of file diff --git a/includes/system/compare.inc b/includes/system/compare.inc new file mode 100644 index 0000000..de777aa --- /dev/null +++ b/includes/system/compare.inc @@ -0,0 +1,189 @@ + + +
+
+

Compare members of the

+
+ + Member + Member + Member + Member + Member + Mmbr. + + + Species + Species + Species + Species + Spec. + Spec. + + + Relations + Relations + Relations + Relations + Relt. + Relt. + + + MCF + MCF + MCF + MCF + MCF + MCF + + + Fictive + Fictive + Fictive + Fictive + Fic. + Fic. + + + Little + Little + Little + Little + Ltl. + Ltl. + + + Protector + Protector + Protect. + Protect. + Prt. + Prt. + + + + " data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" href="/"> + " style="width:24px;"> + ; height: 16px; width: 16px;display: inline-block;vertical-align: middle;border-radius:2px;"> + + + + " style="width:24px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/.png" alt=""> + + + + + + 0 ? count($metadata["marefriends"]) + count($metadata["sisters"]) : "" ?> + + +
Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">

Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">

Caretaker" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">" style="width:24px;">
+
+
+ + + + Yes, but currently travelling + + Yes + + + No + + + + + Yes + + No + + + + = 2): ?> + Yes + + Partial + + No + + + + + + Yes, but currently travelling + + Yes + + + No + + + +
+
+ + \ No newline at end of file diff --git a/includes/system/compare.php b/includes/system/compare.php deleted file mode 100644 index 9714488..0000000 --- a/includes/system/compare.php +++ /dev/null @@ -1,189 +0,0 @@ - - -
-
-

Compare members of the

-
- - Member - Member - Member - Member - Member - Mmbr. - - - Species - Species - Species - Species - Spec. - Spec. - - - Relations - Relations - Relations - Relations - Relt. - Relt. - - - MCF - MCF - MCF - MCF - MCF - MCF - - - Fictive - Fictive - Fictive - Fictive - Fic. - Fic. - - - Little - Little - Little - Little - Ltl. - Ltl. - - - Protector - Protector - Protect. - Protect. - Prt. - Prt. - - - - " data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" href="/"> - .png" style="width:24px;"> - ; height: 16px; width: 16px;display: inline-block;vertical-align: middle;border-radius:2px;"> - - - - " style="width:24px;vertical-align: middle;position:relative;top:-5px;" src="/assets/species/.png" alt=""> - - - - - - 0 ? count($metadata["marefriends"]) + count($metadata["sisters"]) : "" ?> - - -
Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">.png" style="width:24px;">

Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">.png" style="width:24px;">

Caretaker" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/">.png" style="width:24px;">
-
-
- - - - Yes, but currently travelling - - Yes - - - No - - - - - Yes - - No - - - - = 2): ?> - Yes - - Partial - - No - - - - - - Yes, but currently travelling - - Yes - - - No - - - -
-
- - \ No newline at end of file diff --git a/includes/system/history.inc b/includes/system/history.inc new file mode 100644 index 0000000..ee687d7 --- /dev/null +++ b/includes/system/history.inc @@ -0,0 +1,528 @@ + + +
+
+ (86400 * ($day - 1)); + })); + + uksort($filtered, function ($a, $b) { + if (isset($b["timestamp"]) && isset($a["timestamp"])) { + return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); + } else { + return null; + } + }); + + return $filtered; + } + + function getSwitchBefore(string $id) { + global $switches; + + $currentPassed = false; + $before = null; + + foreach ($switches as $switch) { + if ($currentPassed) { + $before = $switch; + break; + } else { + if ($switch["id"] === $id) { + $currentPassed = true; + } + } + } + + return $before; + } + + function isNotToday(int $timestamp, int $offset) { + if (date('Y-m-d', $timestamp) !== date('Y-m-d', time() - (86400 * $offset))) { + return true; + } else { + return false; + } + } + + $switches1 = getSwitchesForDay(0); + $switches2 = getSwitchesForDay(1); + $switches3 = getSwitchesForDay(2); + $switches4 = getSwitchesForDay(3); + $switches5 = getSwitchesForDay(4); + $switches6 = getSwitchesForDay(5); + $switches7 = getSwitchesForDay(6); + $switches8 = getSwitchesForDay(7); + $switches9 = getSwitchesForDay(8); + $switches10 = getSwitchesForDay(9); + + ?> +

Front history in the

+ +

Today

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches1); + + $fronters[] = [ + "member" => isset($switches2[0]) ? (isset($switches2[0]["members"]) && isset($switches2[0]["members"][0]) ? $switches2[0]["members"][0] : null) : (isset($switches3[0]) ? (isset($switches3[0]["members"]) && isset($switches3[0]["members"][0]) ? $switches3[0]["members"][0] : null) : (isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][0]) ? $switches4[0]["members"][0] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][0]) ? $switches5[0]["members"][0] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0]))))))), + "member2" => isset($switches2[0]) ? (isset($switches2[0]["members"]) && isset($switches2[0]["members"][1]) ? $switches2[0]["members"][1] : null) : (isset($switches3[0]) ? (isset($switches3[0]["members"]) && isset($switches3[0]["members"][1]) ? $switches3[0]["members"][1] : null) : (isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][1]) ? $switches4[0]["members"][1] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][1]) ? $switches5[0]["members"][1] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1]))))))), + "date" => strtotime(isset($switches2[0]) ? $switches2[0]["timestamp"] : (isset($switches3[0]) ? $switches3[0]["timestamp"] : (isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))))) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

Yesterday

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches2); + + $fronters[] = [ + "member" => isset($switches3[0]) ? (isset($switches3[0]["members"]) && isset($switches3[0]["members"][0]) ? $switches3[0]["members"][0] : null) : (isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][0]) ? $switches4[0]["members"][0] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][0]) ? $switches5[0]["members"][0] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0])))))), + "member2" => isset($switches3[0]) ? (isset($switches3[0]["members"]) && isset($switches3[0]["members"][1]) ? $switches3[0]["members"][1] : null) : (isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][1]) ? $switches4[0]["members"][1] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][1]) ? $switches5[0]["members"][1] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1])))))), + "date" => strtotime(isset($switches3[0]) ? $switches3[0]["timestamp"] : (isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))))) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches3); + + $fronters[] = [ + "member" => isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][0]) ? $switches4[0]["members"][0] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][0]) ? $switches5[0]["members"][0] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0]))))), + "member2" => isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][1]) ? $switches4[0]["members"][1] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][1]) ? $switches5[0]["members"][1] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1]))))), + "date" => strtotime(isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches4); + + $fronters[] = [ + "member" => isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][0]) ? $switches5[0]["members"][0] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0])))), + "member2" => isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][1]) ? $switches5[0]["members"][1] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1])))), + "date" => strtotime(isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches5); + + $fronters[] = [ + "member" => isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0]))), + "member2" => isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1]))), + "date" => strtotime(isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches6); + + $fronters[] = [ + "member" => isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0])), + "member2" => isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1])), + "date" => strtotime(isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches7); + + $fronters[] = [ + "member" => isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0]), + "member2" => isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1]), + "date" => strtotime(isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches8); + + $fronters[] = [ + "member" => isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0], + "member2" => isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1], + "date" => strtotime(isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches9); + + $fronters[] = [ + "member" => isset($switches10[0]) ? $switches10[0]["members"][0] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][0], + "member2" => isset($switches10[0]) && isset($switches10[0]["members"]) && isset($switches10[0]["members"][1]) ? $switches10[0]["members"][1] : (isset(getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][1]) ? getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][1] : null), + "date" => strtotime(isset($switches10[0]) ? $switches10[0]["timestamp"] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["timestamp"]) + ]; + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +

+ $i["members"][0] ?? null, + "member2" => $i["members"][1] ?? null, + "date" => strtotime($i["timestamp"]) + ]; + }, $switches10); + + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); + ?> +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + "> + " style="width:24px;"> + + + (with "> + " style="width:24px;"> ) + + +
+ +
+ " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + + + + Fallback pony + +
+ +
+ + + \ No newline at end of file diff --git a/includes/system/history.php b/includes/system/history.php deleted file mode 100644 index a13a3e1..0000000 --- a/includes/system/history.php +++ /dev/null @@ -1,460 +0,0 @@ - - -
-
- (86400 * ($day - 1)); - })); - - uksort($filtered, function ($a, $b) { - if (isset($b["timestamp"]) && isset($a["timestamp"])) { - return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); - } else { - return null; - } - }); - - return $filtered; - } - - function getSwitchBefore(string $id) { - global $switches; - - $currentPassed = false; - $before = null; - - foreach ($switches as $switch) { - if ($currentPassed) { - $before = $switch; - break; - } else { - if ($switch["id"] === $id) { - $currentPassed = true; - } - } - } - - return $before; - } - - function isNotToday(int $timestamp, int $offset) { - if (date('Y-m-d', $timestamp) !== date('Y-m-d', time() - (86400 * $offset))) { - return true; - } else { - return false; - } - } - - $switches1 = getSwitchesForDay(0); - $switches2 = getSwitchesForDay(1); - $switches3 = getSwitchesForDay(2); - $switches4 = getSwitchesForDay(3); - $switches5 = getSwitchesForDay(4); - $switches6 = getSwitchesForDay(5); - $switches7 = getSwitchesForDay(6); - $switches8 = getSwitchesForDay(7); - $switches9 = getSwitchesForDay(8); - $switches10 = getSwitchesForDay(9); - - ?> -

Front history in the

- -

Today

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches1); - - $fronters[] = [ - "member" => isset($switches2[0]) ? (isset($switches2[0]["members"]) && isset($switches2[0]["members"][0]) ? $switches2[0]["members"][0] : null) : (isset($switches3[0]) ? (isset($switches3[0]["members"]) && isset($switches3[0]["members"][0]) ? $switches3[0]["members"][0] : null) : (isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][0]) ? $switches4[0]["members"][0] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][0]) ? $switches5[0]["members"][0] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0]))))))), - "member2" => isset($switches2[0]) ? (isset($switches2[0]["members"]) && isset($switches2[0]["members"][1]) ? $switches2[0]["members"][1] : null) : (isset($switches3[0]) ? (isset($switches3[0]["members"]) && isset($switches3[0]["members"][1]) ? $switches3[0]["members"][1] : null) : (isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][1]) ? $switches4[0]["members"][1] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][1]) ? $switches5[0]["members"][1] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1]))))))), - "date" => strtotime(isset($switches2[0]) ? $switches2[0]["timestamp"] : (isset($switches3[0]) ? $switches3[0]["timestamp"] : (isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))))) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

Yesterday

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches2); - - $fronters[] = [ - "member" => isset($switches3[0]) ? (isset($switches3[0]["members"]) && isset($switches3[0]["members"][0]) ? $switches3[0]["members"][0] : null) : (isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][0]) ? $switches4[0]["members"][0] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][0]) ? $switches5[0]["members"][0] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0])))))), - "member2" => isset($switches3[0]) ? (isset($switches3[0]["members"]) && isset($switches3[0]["members"][1]) ? $switches3[0]["members"][1] : null) : (isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][1]) ? $switches4[0]["members"][1] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][1]) ? $switches5[0]["members"][1] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1])))))), - "date" => strtotime(isset($switches3[0]) ? $switches3[0]["timestamp"] : (isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))))) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches3); - - $fronters[] = [ - "member" => isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][0]) ? $switches4[0]["members"][0] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][0]) ? $switches5[0]["members"][0] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0]))))), - "member2" => isset($switches4[0]) ? (isset($switches4[0]["members"]) && isset($switches4[0]["members"][1]) ? $switches4[0]["members"][1] : null) : (isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][1]) ? $switches5[0]["members"][1] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1]))))), - "date" => strtotime(isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches4); - - $fronters[] = [ - "member" => isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][0]) ? $switches5[0]["members"][0] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0])))), - "member2" => isset($switches5[0]) ? (isset($switches5[0]["members"]) && isset($switches5[0]["members"][1]) ? $switches5[0]["members"][1] : null) : (isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1])))), - "date" => strtotime(isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches5); - - $fronters[] = [ - "member" => isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][0]) ? $switches6[0]["members"][0] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0]))), - "member2" => isset($switches6[0]) ? (isset($switches6[0]["members"]) && isset($switches6[0]["members"][1]) ? $switches6[0]["members"][1] : null) : (isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1]))), - "date" => strtotime(isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches6); - - $fronters[] = [ - "member" => isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][0]) ? $switches7[0]["members"][0] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0])), - "member2" => isset($switches7[0]) ? (isset($switches7[0]["members"]) && isset($switches7[0]["members"][1]) ? $switches7[0]["members"][1] : null) : (isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1])), - "date" => strtotime(isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches7); - - $fronters[] = [ - "member" => isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][0]) ? $switches8[0]["members"][0] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0]), - "member2" => isset($switches8[0]) ? (isset($switches8[0]["members"]) && isset($switches8[0]["members"][1]) ? $switches8[0]["members"][1] : null) : (isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1]), - "date" => strtotime(isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches8); - - $fronters[] = [ - "member" => isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][0]) ? $switches9[0]["members"][0] : null) : $switches10[0]["members"][0], - "member2" => isset($switches9[0]) ? (isset($switches9[0]["members"]) && isset($switches9[0]["members"][1]) ? $switches9[0]["members"][1] : null) : $switches10[0]["members"][1], - "date" => strtotime(isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches9); - - $fronters[] = [ - "member" => isset($switches10[0]) ? $switches10[0]["members"][0] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][0], - "member2" => isset($switches10[0]) && isset($switches10[0]["members"]) && isset($switches10[0]["members"][1]) ? $switches10[0]["members"][1] : (isset(getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][1]) ? getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][1] : null), - "date" => strtotime($switches10[0] ? $switches10[0]["timestamp"] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["timestamp"]) - ]; - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -

- $i["members"][0], - "member2" => $i["members"][1] ?? null, - "date" => strtotime($i["timestamp"]) - ]; - }, $switches10); - - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); - ?> -
- " style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> - - - - "> - .png" style="width:24px;"> - - - (with "> - .png" style="width:24px;"> ) - - -
- -
- - - \ No newline at end of file diff --git a/includes/system/species.inc b/includes/system/species.inc new file mode 100644 index 0000000..bd37d7b --- /dev/null +++ b/includes/system/species.inc @@ -0,0 +1,70 @@ + + +
+
+ () +
+ +
+ 0): ?> + + ">" style="width:24px;"> ,  
'); $index++; endforeach; ?> + - +
+
+ + +
+
+

members by species

+ + + + + + + + +
+ + \ No newline at end of file diff --git a/includes/system/species.php b/includes/system/species.php deleted file mode 100644 index a35e811..0000000 --- a/includes/system/species.php +++ /dev/null @@ -1,70 +0,0 @@ - - -
-
- () -
- -
- 0): ?> - - ">.png" style="width:24px;"> ,  
'); $index++; endforeach; ?> - - -
-
- - -
-
-

members by species

- - - - - - - - -
- - \ No newline at end of file diff --git a/includes/system/subsystem.inc b/includes/system/subsystem.inc new file mode 100644 index 0000000..b7d73f1 --- /dev/null +++ b/includes/system/subsystem.inc @@ -0,0 +1,100 @@ + + +
+
+ +
+ +
+ + (edit) + + +
+ +
+ + \ No newline at end of file diff --git a/includes/system/subsystem.php b/includes/system/subsystem.php deleted file mode 100644 index 372ad08..0000000 --- a/includes/system/subsystem.php +++ /dev/null @@ -1,100 +0,0 @@ - - -
-
- -
- -
- - (edit) - - -
- -
- - \ No newline at end of file diff --git a/includes/system/tree.inc b/includes/system/tree.inc new file mode 100644 index 0000000..c3cc5c4 --- /dev/null +++ b/includes/system/tree.inc @@ -0,0 +1,114 @@ + + +
+
+

System tree for the

+ + .png" style="width:24px;"> + + + + + +
+
"> 
+ + + +
+
 
+
"> 
+ +
+ + +
+ +
+ + \ No newline at end of file diff --git a/includes/system/tree.php b/includes/system/tree.php deleted file mode 100644 index 21d146b..0000000 --- a/includes/system/tree.php +++ /dev/null @@ -1,114 +0,0 @@ - - -
- - - \ No newline at end of file diff --git a/includes/travelling.inc b/includes/travelling.inc new file mode 100644 index 0000000..edcb267 --- /dev/null +++ b/includes/travelling.inc @@ -0,0 +1,47 @@ + false, + "history" => [] + ]; + } +} + +function withTravelers(array $members, string $system): array { + global $travelling; + + return [ + ...array_map(function ($i) use ($system) { + $i['system'] = $system; + return $i; + }, array_filter($members, function ($i) use ($travelling) { + return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']); + })), + ...array_filter(array_map(function ($i) use ($system) { + $i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd"; + return $i; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true)), function ($i) use ($travelling) { + return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']; + }) + ]; +} + +@file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); \ No newline at end of file diff --git a/includes/travelling.php b/includes/travelling.php deleted file mode 100644 index b74c826..0000000 --- a/includes/travelling.php +++ /dev/null @@ -1,47 +0,0 @@ - false, - "history" => [] - ]; - } -} - -function withTravelers(array $members, string $system): array { - global $travelling; - - return [ - ...array_map(function ($i) use ($system) { - $i['system'] = $system; - return $i; - }, array_filter($members, function ($i) use ($travelling) { - return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']); - })), - ...array_filter(array_map(function ($i) use ($system) { - $i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd"; - return $i; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true)), function ($i) use ($travelling) { - return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']; - }) - ]; -} - -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); \ No newline at end of file diff --git a/includes/wakeup.inc b/includes/wakeup.inc new file mode 100644 index 0000000..587e705 --- /dev/null +++ b/includes/wakeup.inc @@ -0,0 +1,114 @@ +

Wake-up alert +
+ + · +
+

+ +Turn ON + +

Sending next notification never

+ + + + + + \ No newline at end of file diff --git a/includes/wakeup.php b/includes/wakeup.php deleted file mode 100644 index 587e705..0000000 --- a/includes/wakeup.php +++ /dev/null @@ -1,114 +0,0 @@ -

Wake-up alert -
- - · -
-

- -Turn ON - -

Sending next notification never

- - - - - - \ No newline at end of file -- cgit