summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/assets.inc34
-rw-r--r--includes/cleanup.inc45
-rw-r--r--includes/details.inc82
-rw-r--r--includes/edit-private.inc7
-rw-r--r--includes/edit.inc7
-rw-r--r--includes/fullbanner.inc102
-rw-r--r--includes/header.inc24
-rw-r--r--includes/logo.inc16
-rw-r--r--includes/member.inc260
-rw-r--r--includes/navigation.inc17
-rw-r--r--includes/pages.json14
-rw-r--r--includes/planner.inc17
-rw-r--r--includes/refresh.php10
-rw-r--r--includes/score.inc6
-rw-r--r--includes/subsysedit.inc4
-rw-r--r--includes/sysedit.inc264
-rw-r--r--includes/system.inc4
-rw-r--r--includes/system/compare.inc20
-rw-r--r--includes/system/species.inc12
-rw-r--r--includes/titlebar.inc476
20 files changed, 1008 insertions, 413 deletions
diff --git a/includes/assets.inc b/includes/assets.inc
index 9a0a9ac..3f9971a 100644
--- a/includes/assets.inc
+++ b/includes/assets.inc
@@ -11,14 +11,18 @@ function downloadAssets($system) {
if (isset($general["avatar_url"])) {
$id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]);
echo(" /avatars/$id.webp\n");
- exec("convert -resize 512x512 \"" . $general["avatar_url"] . "\" ../assets/avatars/" . $id . ".webp");
- exec("convert -resize 512x512 \"" . $general["avatar_url"] . "\" ../assets/uploads/" . ($id === "gdapd" ? "raindrops" : "cloudburst") . ".png");
+ file_put_contents("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION), file_get_contents($general['avatar_url']));
+ exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" ../assets/avatars/" . $id . ".webp");
+ exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION) . "\" ../assets/uploads/" . ($id === "gdapd" ? "raindrops" : "cloudburst") . ".png");
+ unlink("/tmp/img." . pathinfo($general['avatar_url'], PATHINFO_EXTENSION));
}
if (isset($general["banner"])) {
$id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]);
echo(" /banners/$id.webp\n");
- exec("convert -resize 2048x2048 \"" . $general["banner"] . "\" ../assets/banners/" . $id . ".webp");
+ file_put_contents("/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION), file_get_contents($general['banner']));
+ exec("convert -resize 2048x2048 \"" . "/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION) ."\" ../assets/banners/" . $id . ".webp");
+ unlink("/tmp/img." . pathinfo($general['banner'], PATHINFO_EXTENSION));
}
$members = json_decode(file_get_contents("./data/$system/members.json"), true);
@@ -28,12 +32,30 @@ function downloadAssets($system) {
if (isset($member["avatar_url"])) {
echo(" /avatars/$id.webp\n");
- exec("convert -resize 512x512 \"" . $member["avatar_url"] . "\" ../assets/avatars/" . $id . ".webp");
+ file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url']));
+ exec("convert -resize 512x512 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" ../assets/avatars/" . $id . ".webp");
+ unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION));
}
+ echo(" /banners/$id.webp\n");
+
if (isset($member["banner"])) {
- echo(" /banners/$id.webp\n");
- exec("convert -resize 2048x2048 \"" . $member["banner"] . "\" ../assets/banners/" . $id . ".webp");
+ file_put_contents("/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION), file_get_contents($member['banner']));
+ exec("convert -resize 2048x2048 \"" . "/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION) . "\" ../assets/banners/" . $id . ".webp");
+ unlink("/tmp/img." . pathinfo($member['banner'], PATHINFO_EXTENSION));
+ } else {
+ $img = imagecreate(2048, 1024);
+
+ if (isset($member["color"])) {
+ imagecolorallocate($img, hexdec(substr($member["color"], 0, 2)) / 2, hexdec(substr($member["color"], 2, 2)) / 2, hexdec(substr($member["color"], 4, 2)) / 2);
+ } else {
+ imagecolorallocate($img, 0, 0, 0);
+ }
+
+ imagejpeg($img, "/tmp/img.jpeg", 100);
+ imagedestroy($img);
+ exec("convert -resize 2048x2048 \"/tmp/img.jpeg\" ../assets/banners/" . $id . ".webp");
+ unlink("/tmp/img.jpeg");
}
if (file_exists("../assets/uploads/pt-" . $member["name"] . ".png")) {
diff --git a/includes/cleanup.inc b/includes/cleanup.inc
new file mode 100644
index 0000000..1d02081
--- /dev/null
+++ b/includes/cleanup.inc
@@ -0,0 +1,45 @@
+<?php
+
+$screens = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens"), function ($i) {
+ return !str_starts_with($i, ".");
+}));
+
+$windows = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows"), function ($i) {
+ return !str_starts_with($i, ".");
+}));
+
+$computers = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata"), function ($i) {
+ return !str_starts_with($i, ".");
+}));
+
+foreach ($screens as $screen) {
+ $delete = true;
+ $id = explode(".", explode("-", $screen)[2])[0];
+
+ foreach ($computers as $file) {
+ $computer = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $file), true);
+
+ foreach ($computer["screens"] as $sel) {
+ if ($sel["id"] === $id) $delete = false;
+ }
+ }
+
+ if ($delete) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/screens/" . $screen);
+}
+
+foreach ($windows as $window) {
+ $delete = true;
+ $id = explode(".", explode("-", $window)[2])[0];
+
+ foreach ($computers as $file) {
+ $computer = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $file), true);
+
+ foreach ($computer["windows"] as $sel) {
+ $id2 = sha1($sel["gid"]);
+
+ if ($id2 === $id) $delete = false;
+ }
+ }
+
+ if ($delete) unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/windows/" . $window);
+} \ No newline at end of file
diff --git a/includes/details.inc b/includes/details.inc
new file mode 100644
index 0000000..abd07bc
--- /dev/null
+++ b/includes/details.inc
@@ -0,0 +1,82 @@
+<?php global $isLoggedIn; global $metadata; global $memberData; ?>
+<div id="member-details" class="<?= $isLoggedIn ? 'member-details-loggedIn' : '' ?>" style="<?php if (!$isLoggedIn): ?>grid-template-columns: repeat(3, 1fr);<?php endif; ?> background-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] . "33" : "transparent" ?>; margin-left: -20px; margin-right: -20px;">
+ <div>
+ <b>Food:</b><span class="member-small-separator"><br></span>
+ <?= match ($metadata["food"]) {
+ 0 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"])) . " species indicates that " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($memberData["pronouns"])["third"] ? "doesn&apos;t" : "don&apos;t") . " need to eat food, therefore " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"]) . " can eat all foods.'>Not needed</span>",
+ 1 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can&apos;t eat fish or meat.'>Not animals</span>",
+ 2 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can&apos;t eat meat, but can eat fish.'>Not meat</span>",
+ 3 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can eat all foods, meat and fish included.'>All</span>",
+ } ?>
+ </div>
+ <div>
+ <b>Shared memory:</b><span class="member-small-separator"><br></span>
+ <?= match ($metadata["shared_memory"]) {
+ 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " doesn&apos;t directly share" : " don&apos;t directly share") . " memory with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates, but is able to (slowly) query it if that is needed.'>None</span>",
+ 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " doesn&apos;t directly shares" : " don&apos;t directly share") . " all memories with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates, but may be able to share certain memories and/or share memories at will.'>Partial</span>",
+ 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " shares" : " share") . " all memories with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates.'>Full</span>",
+ } ?>
+ </div>
+ <div>
+ <b>Magic:</b><span class="member-small-separator"><br></span>
+ <?= match ($metadata["magic"]) {
+ 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " is unable to use magic at all.'>None</span>",
+ 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can use magic in rare cases, such as when somepony else is pouring magic into " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " or when a physical event occurs.'>In some cases</span>",
+ 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " horn.'>Horn</span>",
+ 3 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " wings.'>Wings</span>",
+ 4 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using both " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " horn and wings.'>Horn and wings</span>",
+ 5 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using another part of " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body that is neither a horn or wings.'>Yes</span>",
+ } ?>
+ </div>
+ <?php if ($isLoggedIn): ?>
+ <div>
+ <b>Sensitivity:</b><span class="member-small-separator"><br></span>
+ <?= match ($metadata["sensitivity"]) {
+ 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " does" : " do") . " not have sensitive spots on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body.'>None</span>",
+ 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " may have (a) sensitive spot·s on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body.'>Maybe</span>",
+ 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " has" : " have") . " (a) sensitive spot·s on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body, and playing with it/them will make " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " feel affectionate: extremely safe and cared for.'>Affectionate</span>",
+ 3 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " has" : " have") . " (a) sensitive spot·s on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body, and playing with it/them will make " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " feel sexually pleasured.'>Sexual</span>",
+ 4 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " has" : " have") . " (a) sensitive spot·s on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body, and playing with it/them will make " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " feel affectionate or sexually pleasured.'>Affectionate and sexual</span>",
+ } ?>
+ </div>
+ <div>
+ <b>Age:</b><span class="member-small-separator"><br></span>
+ <?php if (!isset($metadata["birth"]["year"])): ?>
+ <?php if ($metadata["birth"]["age"] <= 0): ?>
+ -
+ <?php else: ?>
+ <?= "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . str_replace("'", "&apos;", getMemberPronouns($memberData["pronouns"])["third"] ? " doesn't" : " don't") . " age like the body does, making " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " stay " . $metadata["birth"]["age"] . " years old for " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " entire life.'>" . $metadata["birth"]["age"] . "* years old</span>" ?>
+ <?php endif; ?>
+ <?php else: ?>
+ <?php if ($metadata["birth"]["year"] <= 1900): ?>
+ -
+ <?php else: ?>
+ <?php
+
+ $birthdate = $metadata["birth"]["year"] . date('-m-d');
+ if (isset($metadata["birth"]["date"]) && trim($metadata["birth"]["date"]) !== "" && $metadata["birth"]["date"] !== "01-01") {
+ $birthdate = $metadata["birth"]["year"] . "-" . $metadata["birth"]["date"];
+ }
+
+ $age = floor((time() - strtotime($birthdate)) / 31557600);
+ $birthday = "as time passes";
+
+ if (isset($metadata["birth"]["date"]) && trim($metadata["birth"]["date"]) !== "" && $metadata["birth"]["date"] !== "01-01") {
+ $birthday = "every " . date('F jS', strtotime(date('Y') . "-" . $metadata["birth"]["date"]));
+ }
+
+ ?>
+ <?= "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " age" . str_replace("'", "&apos;", getMemberPronouns($memberData["pronouns"])["third"] ? "s" : "") . " like the body does, making " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " stay " . $age . " years old for now, having this age change $birthday.'>" . $age . " years old</span>" ?>
+ <?php endif; ?>
+ <?php endif; ?>
+ </div>
+ <div>
+ <b>Birthday:</b><span class="member-small-separator"><br></span>
+ <?php if (isset($metadata["birth"]["date"]) && trim($metadata["birth"]["date"]) !== "" && $metadata["birth"]["date"] !== "01-01"): ?>
+ <?= date('F jS', strtotime(date('Y') . "-" . $metadata["birth"]["date"])) ?>
+ <?php else: ?>
+ -
+ <?php endif; ?>
+ </div>
+ <?php endif; ?>
+</div> \ No newline at end of file
diff --git a/includes/edit-private.inc b/includes/edit-private.inc
index e760b94..69f50d8 100644
--- a/includes/edit-private.inc
+++ b/includes/edit-private.inc
@@ -8,12 +8,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<br>
<div class="container">
- <script>
- window.currentMemberData = JSON.parse(atob(`<?= base64_encode(json_encode(getMemberBannerData($memberID, $systemID))) ?>`));
- </script>
- <div id="member-banner"></div>
- <script src="/app/banner.js"></script><script>refreshBanner()</script>
- <br>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fullbanner.inc"; ?>
<p class="text-muted" id="page-content">
<span id="editor-save-status" class="text-muted">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html")) : "0" ?></span> bytes · <a href="/<?= $memberData["name"] ?>">View page</a>
diff --git a/includes/edit.inc b/includes/edit.inc
index d8cf673..61e9f29 100644
--- a/includes/edit.inc
+++ b/includes/edit.inc
@@ -8,12 +8,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<br>
<div class="container">
- <script>
- window.currentMemberData = JSON.parse(atob(`<?= base64_encode(json_encode(getMemberBannerData($memberID, $systemID))) ?>`));
- </script>
- <div id="member-banner"></div>
- <script src="/app/banner.js"></script><script>refreshBanner()</script>
- <br>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fullbanner.inc"; ?>
<p class="text-muted" id="page-content">
<span id="editor-save-status" class="text-muted">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html")) : "0" ?></span> bytes · <a href="/<?= $memberData["name"] ?>">View page</a>
diff --git a/includes/fullbanner.inc b/includes/fullbanner.inc
new file mode 100644
index 0000000..1c449d3
--- /dev/null
+++ b/includes/fullbanner.inc
@@ -0,0 +1,102 @@
+<?php global $memberData; global $memberID; global $systemID; global $metadata; global $travelling; global $systemCommonName; global $member; ?>
+<script>
+ window.currentMemberData = JSON.parse(atob(`<?= base64_encode(json_encode(getMemberBannerData($memberID, $systemID, false))) ?>`));
+</script>
+<?php if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion"): ?>
+ <div id="member-banner-container">
+ <div id="member-banner"></div>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/details.inc"; ?>
+ </div>
+<?php else: ?>
+ <div id="member-banner"></div>
+<?php endif; ?>
+
+<script src="/app/banner.js"></script><script>refreshBanner(false)</script>
+<br>
+
+<?php global $isLoggedIn; if ($isLoggedIn && $memberData["name"] !== "unknown" && $memberData["name"] !== "fusion"): ?>
+ <?php if (!isset($metadata["bitset"])): ?>
+ <div class="alert alert-warning">
+ <b>This member's metadata needs an update.</b> 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: <code><?= $_SERVER['DOCUMENT_ROOT'] ?>/includes/data/metadata/<?= $memberID ?>.json</code>)
+ </div>
+ <?php endif; ?>
+ <div class="alert alert-dark">
+ <details>
+ <summary>Private administrator information</summary>
+ <ul style="margin-bottom:0;">
+ <li><b>ID:</b> <code><?= $memberID ?></code> (<code><?= $systemID . "/" . $memberID ?></code>, <?= $memberData["name"] ?>)</li>
+ <li><b>Files:</b>
+ <ul>
+ <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json") . " bytes" : "not found" ?>)</li>
+ <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") . " bytes" : "not found" ?>)</li>
+ <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") . " bytes" : "not found" ?>)</li>
+ </ul>
+ </li>
+ <li><b>Date added:</b> <?= date('l j F Y', strtotime($memberData["created"])) ?> (<?= timeAgo($memberData["created"]) ?>, <code><?= $memberData["created"] ?></code>)</li>
+ <li><b>Pronouns:</b> <?= implode(", ", getPronounsFromMark($memberData['pronouns'])) ?></li>
+ <li><b>Pronouns usage:</b> <ul><?php
+
+ foreach (getMemberPronouns($memberData['pronouns']) as $type => $usage) {
+ if (is_string($usage) && $type !== "color") {
+ echo("<li><b>" . $type . ":</b> " . $usage . "</li>");
+ }
+ }
+
+ ?></ul></li>
+ <li><b>Color:</b> <span style="border:1px solid rgba(255, 255, 255, .5);background-color:#<?= $memberData["color"] ?? "ffffff" ?>;display:inline-block;width:16px;height:16px;border-radius:5px;vertical-align: middle;filter: invert(1) hue-rotate(180deg);"></span> <span style="vertical-align: middle;"><code>#<?= $memberData["color"] ?? "ffffff" ?></code></span>
+ <li><b>Bitset:</b><?php if (isset($metadata["bitset"])): ?> <code><?= str_repeat("0", 48 - strlen(decbin($metadata["bitset"]))) . decbin($metadata["bitset"]) ?></code> (0x<?= str_repeat("0", 12 - strlen(dechex($metadata["bitset"]))) . dechex($metadata["bitset"]) ?>, <?= $metadata["bitset"] ?>)</li><?php else: ?> <span class="text-warning" style="filter:invert(1) hue-rotate(180deg);">Not using bitset; please update.</span><?php endif; ?>
+ <li><b>Reduced name:</b> <?= getMiniName($memberData["display_name"] ?? $member["name"]) ?></li>
+ <li><b>Shared memory access:</b> <code><?= $metadata["shared_memory"] ?></code> (<?= $metadata["shared_memory"] === 2 ? "Full direct access" : ($metadata["shared_memory"] === 0 ? "No direct access" : "Partial direct access") ?>)</li>
+ <li><b>Protector:</b> <code><?= $metadata["protector"] ? "1" : "0" ?></code> (<?= $metadata["protector"] ? "Yes" : "No" ?>)</li>
+ <li><b>Little:</b> <code><?= $metadata["little"] ?></code> (<?= $metadata["little"] === 2 ? "Is a little" : ($metadata["little"] === 1 ? "Is an age regressor" : ($metadata["little"] === 3 ? "Not a little, but younger" : "No")) ?>)</li>
+ <li><b>Relations count:</b> <code><?= count($metadata["marefriends"]) + count($metadata["sisters"]) ?></code></li>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; $score = calculateScore($metadata, $memberData["display_name"] ?? $memberData["name"]); ?>
+ <li>
+ <b>Score breakdown:</b> <code><?= $score["total"] ?></code>
+ <ul>
+ <li><b>Most common fronter score:</b> <code><?= $score["host"] ?></code></li>
+ <li><b>Relationships score:</b> <code><?= $score["relations"] ?></code></li>
+ <li><b>Fictive score:</b> <code><?= $score["fictive"] ?></code></li>
+ <li><b>Median score:</b> <code><?= $score["median"] ?></code></li>
+ <li><b>Species score:</b> <code><?= $score["species"] ?></code></li>
+ <li><b>Little score:</b> <code><?= $score["little"] ?></code></li>
+ <li><b>Not talking score:</b> <code><?= $score["not_talking"] ?></code></li>
+ <li><b>Protector score:</b> <code><?= $score["protector"] ?></code></li>
+ <li><b>Name score:</b> <code><?= $score["name"] ?></code></li>
+ <li><b>Shared memory score:</b> <code><?= $score["shared_memory"] ?></code></li>
+ </ul>
+ </li>
+ <li><b>Full metadata:</b> <ul><?php
+
+ foreach ($metadata as $type => $usage) {
+ if (is_string($usage)) {
+ echo("<li><b>" . $type . ":</b> " . $usage . "</li>");
+ } else {
+ echo("<li><b>" . $type . ":</b> " . json_encode($usage, JSON_UNESCAPED_SLASHES) . "</li>");
+ }
+ }
+
+ ?></ul></li>
+ </ul>
+
+ <br>
+ <div style="filter:invert(0);" class="alert alert-warning">
+ <b>AI-generated page:</b>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.inc"; ?>
+ </div>
+ </details>
+ </div>
+<?php endif; ?>
+<?php if ($travelling[$memberID]['travelling']): ?>
+ <div class="alert alert-primary">
+ <?= getMiniName($memberData["display_name"] ?? $memberData["name"]) ?> is visiting the <?= $systemID === "ynmuc" ? "Raindrops System" : "Cloudburst System" ?>, therefore <?= getMemberPronouns($memberData["pronouns"])["subjective"] ?> <?= getMemberPronouns($memberData["pronouns"])["third"] ? "is" : "are" ?> currently not in the <?= $systemCommonName ?>.
+ </div>
+<?php endif; ?>
+<?php if ($memberData["name"] === "new"): ?>
+ <div class="alert alert-secondary">
+ <p>Hello there!</p>
+ <p>I'm currently a new headmate slowly figuring myself out.</p>
+ <p>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.</p>
+ <span>Thanks!</span>
+ </div>
+<?php endif; ?> \ No newline at end of file
diff --git a/includes/header.inc b/includes/header.inc
index c893cea..2d95799 100644
--- a/includes/header.inc
+++ b/includes/header.inc
@@ -1,6 +1,6 @@
<?php global $title; global $pages;
-$useNewUI = isset($_GET['new']) || isset($_COOKIE['new']);
+$useNewUI = !isset($_GET['old']);
$readOnly = false;
@file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test", "hello");
@@ -755,6 +755,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php";
position: relative;
z-index: 9999;
}
+
+ html, body {
+ overflow-x: hidden;
+ }
</style>
</head>
<body<?php if ($page["rail"] && $isLoggedIn && !$useNewUI): ?> id="admin-page"<?php endif; ?>>
@@ -851,6 +855,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php";
body {
margin-left: 250px !important;
}
+
+ #system-banner-container, #member-banner-container {
+ width: 100% !important;
+ }
}
@media (max-width: 1300px) {
@@ -894,6 +902,20 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php";
display: block !important;
}
}
+
+ @media (max-width: 700px) {
+ #title-bar-parts-mobile {
+ display: inline !important;
+ }
+
+ #title-bar-parts-desktop {
+ display: none;
+ }
+
+ #title-bar {
+ text-align: left;
+ }
+ }
</style>
<?php endif; ?>
diff --git a/includes/logo.inc b/includes/logo.inc
index 442ff2b..9b4a03f 100644
--- a/includes/logo.inc
+++ b/includes/logo.inc
@@ -4,7 +4,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
-$columns = round(sqrt(count(scoreOrderGlobal())));
+$columns = ceil(sqrt(count(scoreOrderGlobal())));
+echo(" Using " . $columns . " columns\n");
+
$members = scoreOrderGlobal();
usort($members, function ($a, $b) {
@@ -27,6 +29,8 @@ usort($members, function ($a, $b) {
return $ra - $rb;
});
+echo(" " . count($members) . " members\n");
+
$packs = [];
$currentPack = [];
@@ -71,7 +75,11 @@ $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))));
+ if (isset($newPacks[$y][$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))));
+ } else {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, 255, 255, 255));
+ }
}
}
@@ -83,6 +91,7 @@ $img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
unlink("/tmp/image.png");
imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo.png");
+imagepng($img3, "/tmp/ponieslogo1.png");
for ($x = 1; $x <= 120; $x++) {
imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR);
@@ -94,4 +103,5 @@ 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
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo-template.png");
+imagepng($img3, "/tmp/ponieslogo2.png"); \ No newline at end of file
diff --git a/includes/member.inc b/includes/member.inc
index 6f36f75..02f7769 100644
--- a/includes/member.inc
+++ b/includes/member.inc
@@ -39,230 +39,62 @@ if ($memberData["name"] === "fusion") {
?>
+<div id="member-banner-container" style="width: calc(100% - 300px);height: 65vh;position: fixed;background-image: url('<?= getAsset($systemID, $memberID, "banners") ?>');background-size: cover;background-position: center; top: 0;">
+ <div id="member-banner-inner" style="height: 100%;width: 100%;background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,1) 100%);"></div>
+</div>
+
+<script>
+ window.onscroll = () => {
+ document.getElementById("member-banner-container").style.height = (65 - ((window.scrollY / window.screen.availHeight) * 100)) + "vh";
+ }
+</script>
+
<br>
<div class="container">
- <script>
- window.currentMemberData = JSON.parse(atob(`<?= base64_encode(json_encode(getMemberBannerData($memberID, $systemID, false))) ?>`));
- </script>
- <?php if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion"): ?>
- <div id="member-banner-container">
- <div id="member-banner"></div>
- <div id="member-details" class="<?= $isLoggedIn ? 'member-details-loggedIn' : '' ?>" style="<?php if (!$isLoggedIn): ?>grid-template-columns: repeat(3, 1fr);<?php endif; ?> border-color: <?= isset($memberData["color"]) ? '#' . $memberData["color"] : "transparent" ?>">
- <div>
- <b>Food:</b><span class="member-small-separator"><br></span>
- <?= match ($metadata["food"]) {
- 0 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"])) . " species indicates that " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($memberData["pronouns"])["third"] ? "doesn&apos;t" : "don&apos;t") . " need to eat food, therefore " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"]) . " can eat all foods.'>Not needed</span>",
- 1 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can&apos;t eat fish or meat.'>Not animals</span>",
- 2 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can&apos;t eat meat, but can eat fish.'>Not meat</span>",
- 3 => "<span data-bs-toggle='tooltip' title='" . ucfirst(str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["subjective"])) . " can eat all foods, meat and fish included.'>All</span>",
- } ?>
- </div>
- <div>
- <b>Shared memory:</b><span class="member-small-separator"><br></span>
- <?= match ($metadata["shared_memory"]) {
- 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " doesn&apos;t directly share" : " don&apos;t directly share") . " memory with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates, but is able to (slowly) query it if that is needed.'>None</span>",
- 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " doesn&apos;t directly shares" : " don&apos;t directly share") . " all memories with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates, but may be able to share certain memories and/or share memories at will.'>Partial</span>",
- 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " shares" : " share") . " all memories with " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " headmates.'>Full</span>",
- } ?>
- </div>
- <div>
- <b>Magic:</b><span class="member-small-separator"><br></span>
- <?= match ($metadata["magic"]) {
- 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " is unable to use magic at all.'>None</span>",
- 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can use magic in rare cases, such as when somepony else is pouring magic into " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " or when a physical event occurs.'>In some cases</span>",
- 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " horn.'>Horn</span>",
- 3 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " wings.'>Wings</span>",
- 4 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using both " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " horn and wings.'>Horn and wings</span>",
- 5 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " can cast spells using another part of " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body that is neither a horn or wings.'>Yes</span>",
- } ?>
- </div>
- <?php if ($isLoggedIn): ?>
- <div>
- <b>Sensitivity:</b><span class="member-small-separator"><br></span>
- <?= match ($metadata["sensitivity"]) {
- 0 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " does" : " do") . " not have sensitive spots on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body.'>None</span>",
- 1 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " may have (a) sensitive spot·s on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body.'>Maybe</span>",
- 2 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " has" : " have") . " (a) sensitive spot·s on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body, and playing with it/them will make " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " feel affectionate: extremely safe and cared for.'>Affectionate</span>",
- 3 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " has" : " have") . " (a) sensitive spot·s on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body, and playing with it/them will make " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " feel sexually pleasured.'>Sexual</span>",
- 4 => "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . (getMemberPronouns($memberData["pronouns"])["third"] ? " has" : " have") . " (a) sensitive spot·s on " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " body, and playing with it/them will make " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " feel affectionate or sexually pleasured.'>Affectionate and sexual</span>",
- } ?>
- </div>
- <div>
- <b>Age:</b><span class="member-small-separator"><br></span>
- <?php if (!isset($metadata["birth"]["year"])): ?>
- <?php if ($metadata["birth"]["age"] <= 0): ?>
- -
- <?php else: ?>
- <?= "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . str_replace("'", "&apos;", getMemberPronouns($memberData["pronouns"])["third"] ? " doesn't" : " don't") . " age like the body does, making " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " stay " . $metadata["birth"]["age"] . " years old for " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " entire life.'>" . $metadata["birth"]["age"] . "* years old</span>" ?>
+ <div id="member-page" style="background-color: rgba(26,26,26,0.8);border-radius: 10px;padding:20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);margin-top:30vh;">
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/fullbanner.inc"; ?>
+
+ <div id="page-content">
+ <?php if ($memberData["name"] === "unknown"): ?>
+ <div class="alert alert-secondary">
+ <p>Hello there!</p>
+ <p>I'm currently not totally sure who I am (it's a thing that can happen with plurality), but I am using <?= $systemID === "ynmuc" ? "Twilight Sparkle" : "Scootaloo" ?> as a temporary identity to stay calm and not panic while I figure out what is going on and who I am.</p>
+ <p>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).</p>
+ <span>In all cases, feel free to ask!</span>
+ </div>
+ <?php elseif ($memberData["name"] === "fusion"): ?>
+ <div class="alert alert-secondary">
+ <p>Hello there!</p>
+ <p>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.</p>
+ <p>Below is the list of who is merged, we can be either from a single system or from different systems.</p>
+ <div class="list-group">
+ <?php $foundFusion = false; $fusionOn = false; foreach ($fusionRaindrops ? $frontersRaindrops['members'] : $frontersCloudburst['members'] as $fronter): if ($fronter["name"] !== "fusion"): if ($fusionOn): $foundFusion = true; $name = str_ends_with($fronter['name'], "-travelling") ? substr($fronter['name'], 0, strlen($fronter['name']) - 11) : $fronter['name'] ?>
+ <a class="list-group-item list-group-item-action text-black" href="/<?= $name ?>"><img src="<?= getAsset($system, $fronter["id"], "heads") ?>" style="filter:invert(1) hue-rotate(180deg);width:24px;"> <?= $fronter["display_name"] ?? $name ?></a>
+ <?php endif; else: $fusionOn = true; endif; endforeach; ?>
+ </div>
+ <?php if (!$foundFusion): ?>
+ <i>No members are currently merged.</i>
<?php endif; ?>
- <?php else: ?>
- <?php if ($metadata["birth"]["year"] <= 1900): ?>
- -
- <?php else: ?>
- <?php
-
- $birthdate = $metadata["birth"]["year"] . date('-m-d');
- if (isset($metadata["birth"]["date"]) && trim($metadata["birth"]["date"]) !== "" && $metadata["birth"]["date"] !== "01-01") {
- $birthdate = $metadata["birth"]["year"] . "-" . $metadata["birth"]["date"];
- }
-
- $age = floor((time() - strtotime($birthdate)) / 31557600);
- $birthday = "as time passes";
-
- if (isset($metadata["birth"]["date"]) && trim($metadata["birth"]["date"]) !== "" && $metadata["birth"]["date"] !== "01-01") {
- $birthday = "every " . date('F jS', strtotime(date('Y') . "-" . $metadata["birth"]["date"]));
- }
+ </div>
+ <?php else: ?>
+ <?php global $isLoggedIn; if ($isLoggedIn): ?>
+ <small style="opacity:.5;display:block;">(edit: <a href="/-/edit/<?= $system ?>/<?= $memberData['name'] ?>">public</a>, <a href="/-/edit-private/<?= $system ?>/<?= $memberData['name'] ?>">private</a>)</small>
+ <?php endif; ?>
- ?>
- <?= "<span data-bs-toggle='tooltip' title='" . str_replace("'", "&apos;", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . " age" . str_replace("'", "&apos;", getMemberPronouns($memberData["pronouns"])["third"] ? "s" : "") . " like the body does, making " . str_replace("'", "&apos;", getMemberPronouns($memberData['pronouns'])["object"]) . " stay " . $age . " years old for now, having this age change $birthday.'>" . $age . " years old</span>" ?>
- <?php endif; ?>
+ <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") && $isLoggedIn): ?>
+ <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ?>
+ <hr>
<?php endif; ?>
- </div>
- <div>
- <b>Birthday:</b><span class="member-small-separator"><br></span>
- <?php if (isset($metadata["birth"]["date"]) && trim($metadata["birth"]["date"]) !== "" && $metadata["birth"]["date"] !== "01-01"): ?>
- <?= date('F jS', strtotime(date('Y') . "-" . $metadata["birth"]["date"])) ?>
+
+ <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html")): ?>
+ <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ?>
<?php else: ?>
- -
+ <p class="text-muted">This page is automatically generated and may not be 100% accurate.</p>
+ <?php require $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.inc"; ?>
<?php endif; ?>
- </div>
<?php endif; ?>
</div>
</div>
- <?php else: ?>
- <div id="member-banner"></div>
- <?php endif; ?>
-
- <script src="/app/banner.js"></script><script>refreshBanner(false)</script>
- <br>
-
- <?php global $isLoggedIn; if ($isLoggedIn && $memberData["name"] !== "unknown" && $memberData["name"] !== "fusion"): ?>
- <?php if (!isset($metadata["bitset"])): ?>
- <div class="alert alert-warning">
- <b>This member's metadata needs an update.</b> 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: <code><?= $_SERVER['DOCUMENT_ROOT'] ?>/includes/data/metadata/<?= $memberID ?>.json</code>)
- </div>
- <?php endif; ?>
- <div class="alert alert-dark">
- <details>
- <summary>Private administrator information</summary>
- <ul style="margin-bottom:0;">
- <li><b>ID:</b> <code><?= $memberID ?></code> (<code><?= $systemID . "/" . $memberID ?></code>, <?= $memberData["name"] ?>)</li>
- <li><b>Files:</b>
- <ul>
- <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json") . " bytes" : "not found" ?>)</li>
- <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") . " bytes" : "not found" ?>)</li>
- <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") . " bytes" : "not found" ?>)</li>
- </ul>
- </li>
- <li><b>Date added:</b> <?= date('l j F Y', strtotime($memberData["created"])) ?> (<?= timeAgo($memberData["created"]) ?>, <code><?= $memberData["created"] ?></code>)</li>
- <li><b>Pronouns:</b> <?= implode(", ", getPronounsFromMark($memberData['pronouns'])) ?></li>
- <li><b>Pronouns usage:</b> <ul><?php
-
- foreach (getMemberPronouns($memberData['pronouns']) as $type => $usage) {
- if (is_string($usage) && $type !== "color") {
- echo("<li><b>" . $type . ":</b> " . $usage . "</li>");
- }
- }
-
- ?></ul></li>
- <li><b>Color:</b> <span style="border:1px solid rgba(255, 255, 255, .5);background-color:#<?= $memberData["color"] ?? "ffffff" ?>;display:inline-block;width:16px;height:16px;border-radius:5px;vertical-align: middle;filter: invert(1) hue-rotate(180deg);"></span> <span style="vertical-align: middle;"><code>#<?= $memberData["color"] ?? "ffffff" ?></code></span>
- <li><b>Bitset:</b><?php if (isset($metadata["bitset"])): ?> <code><?= str_repeat("0", 48 - strlen(decbin($metadata["bitset"]))) . decbin($metadata["bitset"]) ?></code> (0x<?= str_repeat("0", 12 - strlen(dechex($metadata["bitset"]))) . dechex($metadata["bitset"]) ?>, <?= $metadata["bitset"] ?>)</li><?php else: ?> <span class="text-warning" style="filter:invert(1) hue-rotate(180deg);">Not using bitset; please update.</span><?php endif; ?>
- <li><b>Reduced name:</b> <?= getMiniName($memberData["display_name"] ?? $member["name"]) ?></li>
- <li><b>Shared memory access:</b> <code><?= $metadata["shared_memory"] ?></code> (<?= $metadata["shared_memory"] === 2 ? "Full direct access" : ($metadata["shared_memory"] === 0 ? "No direct access" : "Partial direct access") ?>)</li>
- <li><b>Protector:</b> <code><?= $metadata["protector"] ? "1" : "0" ?></code> (<?= $metadata["protector"] ? "Yes" : "No" ?>)</li>
- <li><b>Little:</b> <code><?= $metadata["little"] ?></code> (<?= $metadata["little"] === 2 ? "Is a little" : ($metadata["little"] === 1 ? "Is an age regressor" : ($metadata["little"] === 3 ? "Not a little, but younger" : "No")) ?>)</li>
- <li><b>Relations count:</b> <code><?= count($metadata["marefriends"]) + count($metadata["sisters"]) ?></code></li>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; $score = calculateScore($metadata, $memberData["display_name"] ?? $memberData["name"]); ?>
- <li>
- <b>Score breakdown:</b> <code><?= $score["total"] ?></code>
- <ul>
- <li><b>Most common fronter score:</b> <code><?= $score["host"] ?></code></li>
- <li><b>Relationships score:</b> <code><?= $score["relations"] ?></code></li>
- <li><b>Fictive score:</b> <code><?= $score["fictive"] ?></code></li>
- <li><b>Median score:</b> <code><?= $score["median"] ?></code></li>
- <li><b>Species score:</b> <code><?= $score["species"] ?></code></li>
- <li><b>Little score:</b> <code><?= $score["little"] ?></code></li>
- <li><b>Not talking score:</b> <code><?= $score["not_talking"] ?></code></li>
- <li><b>Protector score:</b> <code><?= $score["protector"] ?></code></li>
- <li><b>Name score:</b> <code><?= $score["name"] ?></code></li>
- <li><b>Shared memory score:</b> <code><?= $score["shared_memory"] ?></code></li>
- </ul>
- </li>
- <li><b>Full metadata:</b> <ul><?php
-
- foreach ($metadata as $type => $usage) {
- if (is_string($usage)) {
- echo("<li><b>" . $type . ":</b> " . $usage . "</li>");
- } else {
- echo("<li><b>" . $type . ":</b> " . json_encode($usage, JSON_UNESCAPED_SLASHES) . "</li>");
- }
- }
-
- ?></ul></li>
- </ul>
-
- <br>
- <div style="filter:invert(0);" class="alert alert-warning">
- <b>AI-generated page:</b>
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.inc"; ?>
- </div>
- </details>
- </div>
- <?php endif; ?>
- <?php if ($travelling[$memberID]['travelling']): ?>
- <div class="alert alert-primary">
- <?= getMiniName($memberData["display_name"] ?? $memberData["name"]) ?> is visiting the <?= $systemID === "ynmuc" ? "Raindrops System" : "Cloudburst System" ?>, therefore <?= getMemberPronouns($memberData["pronouns"])["subjective"] ?> <?= getMemberPronouns($memberData["pronouns"])["third"] ? "is" : "are" ?> currently not in the <?= $systemCommonName ?>.
- </div>
- <?php endif; ?>
- <?php if ($memberData["name"] === "new"): ?>
- <div class="alert alert-secondary">
- <p>Hello there!</p>
- <p>I'm currently a new headmate slowly figuring myself out.</p>
- <p>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.</p>
- <span>Thanks!</span>
- </div>
- <?php endif; ?>
-
- <div id="page-content">
- <?php if ($memberData["name"] === "unknown"): ?>
- <div class="alert alert-secondary">
- <p>Hello there!</p>
- <p>I'm currently not totally sure who I am (it's a thing that can happen with plurality), but I am using <?= $systemID === "ynmuc" ? "Twilight Sparkle" : "Scootaloo" ?> as a temporary identity to stay calm and not panic while I figure out what is going on and who I am.</p>
- <p>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).</p>
- <span>In all cases, feel free to ask!</span>
- </div>
- <?php elseif ($memberData["name"] === "fusion"): ?>
- <div class="alert alert-secondary">
- <p>Hello there!</p>
- <p>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.</p>
- <p>Below is the list of who is merged, we can be either from a single system or from different systems.</p>
- <div class="list-group">
- <?php $foundFusion = false; $fusionOn = false; foreach ($fusionRaindrops ? $frontersRaindrops['members'] : $frontersCloudburst['members'] as $fronter): if ($fronter["name"] !== "fusion"): if ($fusionOn): $foundFusion = true; $name = str_ends_with($fronter['name'], "-travelling") ? substr($fronter['name'], 0, strlen($fronter['name']) - 11) : $fronter['name'] ?>
- <a class="list-group-item list-group-item-action text-black" href="/<?= $name ?>"><img src="<?= getAsset($system, $fronter["id"], "heads") ?>" style="filter:invert(1) hue-rotate(180deg);width:24px;"> <?= $fronter["display_name"] ?? $name ?></a>
- <?php endif; else: $fusionOn = true; endif; endforeach; ?>
- </div>
- <?php if (!$foundFusion): ?>
- <i>No members are currently merged.</i>
- <?php endif; ?>
- </div>
- <?php else: ?>
- <?php global $isLoggedIn; if ($isLoggedIn): ?>
- <small style="opacity:.5;display:block;">(edit: <a href="/-/edit/<?= $system ?>/<?= $memberData['name'] ?>">public</a>, <a href="/-/edit-private/<?= $system ?>/<?= $memberData['name'] ?>">private</a>)</small>
- <?php endif; ?>
-
- <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") && $isLoggedIn): ?>
- <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ?>
- <hr>
- <?php endif; ?>
-
- <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html")): ?>
- <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ?>
- <?php else: ?>
- <p class="text-muted">This page is automatically generated and may not be 100% accurate.</p>
- <?php require $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.inc"; ?>
- <?php endif; ?>
- <?php endif; ?>
- </div>
</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/navigation.inc b/includes/navigation.inc
index 8ad019c..8e6e8cd 100644
--- a/includes/navigation.inc
+++ b/includes/navigation.inc
@@ -81,10 +81,10 @@ $navigation_admin = [
"stepped" => null
],
[
- "name" => $pages["rules"]["name"],
- "icon" => "/assets/icons/rules.svg",
+ "name" => $pages["rules-old"]["name"],
+ "icon" => "/assets/icons/rules-old.svg",
"invert" => true,
- "link" => "/-/rules",
+ "link" => "/-/rules-old",
"stepped" => null
],
[
@@ -95,6 +95,13 @@ $navigation_admin = [
"stepped" => null
],
[
+ "name" => $pages["computers"]["name"],
+ "icon" => "/assets/icons/computers.svg",
+ "invert" => true,
+ "link" => "/-/computers",
+ "stepped" => null
+ ],
+ [
"name" => $pages["nicknames"]["name"],
"icon" => "/assets/icons/nicknames.svg",
"invert" => true,
@@ -228,7 +235,7 @@ $navigation_global = [
]
]
],
- "tools" => [
+ /*"tools" => [
"name" => "Tools",
"minimal" => false,
"items" => [
@@ -247,7 +254,7 @@ $navigation_global = [
"stepped" => null
]
]
- ]
+ ]*/
]
];
$navigation_cloudburst = [
diff --git a/includes/pages.json b/includes/pages.json
index cb05739..659de57 100644
--- a/includes/pages.json
+++ b/includes/pages.json
@@ -41,6 +41,12 @@
"admin": true,
"rail": true
},
+ "computers": {
+ "name": "Computers",
+ "short": "PCs",
+ "admin": true,
+ "rail": true
+ },
"dashboard": {
"name": "Dashboard",
"short": null,
@@ -156,11 +162,17 @@
"rail": false
},
"rules": {
- "name": "Systems rules",
+ "name": "General rules",
"short": "Rules",
"admin": true,
"rail": true
},
+ "rules-old": {
+ "name": "Systems rules (legacy)",
+ "short": "Rules (old)",
+ "admin": true,
+ "rail": true
+ },
"s:compare": {
"name": "Compare members",
"short": null,
diff --git a/includes/planner.inc b/includes/planner.inc
index 69e0331..72c82a5 100644
--- a/includes/planner.inc
+++ b/includes/planner.inc
@@ -110,7 +110,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
</td>
<?php if (!isset($dayCloudburst[$index][1])): ?>
<td class="planner-cofronter-inner planner-link" style="width:5%;text-align:center;">
- <a href="#" onclick="addCofronter('cloudburst', <?= $diff ?>, <?= $index ?>);" class="planner-add-link">
+ <a onclick="addCofronter('cloudburst', <?= $diff ?>, <?= $index ?>);" class="planner-add-link">
<img src="/assets/icons/add.svg" alt="" class="planner-add-icon">
</a>
</td>
@@ -126,7 +126,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
<?php elseif ($index === count($dayCloudburst)): ?>
<td class="planner-add-inner planner-link" colspan="5">
- <a href="#" onclick="addFronter('cloudburst', <?= $diff ?>, <?= $index ?>);" class="planner-add-link">
+ <a onclick="addFronter('cloudburst', <?= $diff ?>, <?= $index ?>);" id="planner-add-link-cloudburst-<?= $diff ?>" class="planner-add-link">
<img src="/assets/icons/add.svg" alt="" class="planner-add-icon">
<span class="planner-add-text">Add new fronter</span>
</a>
@@ -148,7 +148,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
</td>
<?php if (!isset($dayRaindrops[$index][1])): ?>
<td class="planner-cofronter-inner planner-link" style="width:5%;text-align:center;">
- <a href="#" onclick="addCofronter('raindrops', <?= $diff ?>, <?= $index ?>);" class="planner-add-link">
+ <a onclick="addCofronter('raindrops', <?= $diff ?>, <?= $index ?>);" class="planner-add-link">
<img src="/assets/icons/add.svg" alt="" class="planner-add-icon">
</a>
</td>
@@ -164,7 +164,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<?php endif; ?>
<?php elseif ($index === count($dayRaindrops)): ?>
<td class="planner-add-inner planner-link" colspan="5">
- <a href="#" onclick="addFronter('raindrops', <?= $diff ?>, <?= $index ?>);" class="planner-add-link">
+ <a onclick="addFronter('raindrops', <?= $diff ?>, <?= $index ?>);" id="planner-add-link-raindrops-<?= $diff ?>" class="planner-add-link">
<img src="/assets/icons/add.svg" alt="" class="planner-add-icon">
<span class="planner-add-text">Add new fronter</span>
</a>
@@ -220,7 +220,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
}
td {
- border: 1px solid rgba(255, 255, 255, .25);
+ border: 1px solid #404040;
padding: 5px 10px;
}
@@ -259,6 +259,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
.planner-add-link {
color: rgba(255, 255, 255, .75);
text-decoration: none;
+ cursor: pointer;
}
.planner-add-link:hover {
@@ -773,9 +774,9 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<div id="list">
<div class="list-group">
<?php foreach (scoreOrderGlobal() as $member): ?>
- <a id="list-pony-<?= $member['id'] ?>" onclick="confirmFronterAdd(window.addSystem, '<?= $member['id'] ?>');" class="new-fronter-link member-link list-group-item list-group-item-action" href="#"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?><peh-schedule-add></peh-schedule-add></a>
+ <a id="list-pony-<?= $member['id'] ?>" onclick="confirmFronterAdd(window.addSystem, '<?= $member['id'] ?>');" class="new-fronter-link member-link list-group-item list-group-item-action"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?><peh-schedule-add></peh-schedule-add></a>
<?php endforeach; $member = getSystemMember("gdapd", "irxyh") ?>
- <a onclick="confirmFronterAdd(window.addSystem, 'irxyh');" class="new-fronter-link member-link list-group-item list-group-item-action" href="#"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="text-muted">Multiple merged members</span></a>
+ <a onclick="confirmFronterAdd(window.addSystem, 'irxyh');" class="new-fronter-link member-link list-group-item list-group-item-action"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="text-muted">Multiple merged members</span></a>
</div>
</div>
@@ -804,7 +805,7 @@ function day($display, $diff): void { if ($diff < 0) $disabled = true; else $dis
<div id="list2">
<div class="list-group">
<?php foreach (scoreOrderGlobal() as $member): ?>
- <a id="list2-pony-<?= $member['id'] ?>" onclick="confirmCofronterAdd(window.addSystem, '<?= $member['id'] ?>');" class="new-cofronter-link member-link list-group-item list-group-item-action" href="#"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?><peh-schedule-add></peh-schedule-add></a>
+ <a id="list2-pony-<?= $member['id'] ?>" onclick="confirmCofronterAdd(window.addSystem, '<?= $member['id'] ?>');" class="new-cofronter-link member-link list-group-item list-group-item-action"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?><peh-schedule-add></peh-schedule-add></a>
<?php endforeach; $member = getSystemMember("gdapd", "irxyh") ?>
</div>
</div>
diff --git a/includes/refresh.php b/includes/refresh.php
index ff8d1eb..fefebb2 100644
--- a/includes/refresh.php
+++ b/includes/refresh.php
@@ -41,6 +41,8 @@ foreach ($deletable as $item) {
}
$times["docs_cleanup"] = microtime(true) - $currentOpStart;
+require_once "./cleanup.inc";
+
$currentOpStart = microtime(true);
$version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true);
@@ -193,7 +195,9 @@ foreach (json_decode(file_get_contents("./data/gdapd/members.json"), true) as $m
if (isset($member['avatar_url'])) {
echo(" Profile picture\n");
- exec("convert -resize 128x128 -quality 50 \"" . $member['avatar_url'] . "\" \"./data/images/pf-gdapd-" . $member['id'] . ".webp\"");
+ file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url']));
+ exec("convert -resize 128x128 -quality 50 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" \"./data/images/pf-gdapd-" . $member['id'] . ".webp\"");
+ unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION));
}
echo(" Pony Town character\n");
@@ -211,7 +215,9 @@ foreach (json_decode(file_get_contents("./data/ynmuc/members.json"), true) as $m
if (isset($member['avatar_url'])) {
echo(" Profile picture\n");
- exec("convert -resize 128x128 -quality 50 \"" . $member['avatar_url'] . "\" \"./data/images/pf-ynmuc-" . $member['id'] . ".webp\"");
+ file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url']));
+ exec("convert -resize 128x128 -quality 50 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" \"./data/images/pf-ynmuc-" . $member['id'] . ".webp\"");
+ unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION));
}
echo(" Pony Town character\n");
diff --git a/includes/score.inc b/includes/score.inc
index 80a90d1..21baf67 100644
--- a/includes/score.inc
+++ b/includes/score.inc
@@ -40,7 +40,7 @@ function calculateScore($metadata, $name) {
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")) {
+ if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_starts_with($member["name"], "smol") && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) {
$systemID = $member["system"] ?? $system;
$member["_system"] = $member["system"] = $systemID;
@@ -60,7 +60,7 @@ function scoreOrder($members, $system) {
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")) {
+ if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_starts_with($member["name"], "smol") && !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));
@@ -70,7 +70,7 @@ function scoreOrderGlobal() {
}
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")) {
+ if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_starts_with($member["name"], "smol") && !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));
diff --git a/includes/subsysedit.inc b/includes/subsysedit.inc
index e9c4b4c..ab71e37 100644
--- a/includes/subsysedit.inc
+++ b/includes/subsysedit.inc
@@ -8,12 +8,12 @@
<br>
<p class="text-muted">
- <span id="editor-save-status">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html")) : "0" ?></span> bytes
+ <span id="editor-save-status">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html")) : "0" ?></span> bytes
</p>
<!--suppress HtmlFormInputWithoutLabel -->
<textarea id="page-editor">
- <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html") : "" ?>
+ <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html") : "" ?>
</textarea>
<script src="/assets/editor/editor.js"></script>
diff --git a/includes/sysedit.inc b/includes/sysedit.inc
index 95a0b5b..bfff61b 100644
--- a/includes/sysedit.inc
+++ b/includes/sysedit.inc
@@ -2,142 +2,152 @@
?>
+<div id="system-banner-container" style="width: 100%;height: 65vh;position: fixed;background-image: url('/assets/uploads/banner-<?= $system ?>.jpg');background-size: cover;background-position: center; top: 0;">
+ <div id="system-banner-inner" style="height: 100%;width: 100%;background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);"></div>
+</div>
+
<br>
<div class="container">
- <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.inc"; ?>
- <br>
+ <div class="container">
- <p class="text-muted">
- <span id="editor-save-status">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-disclaimers.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-disclaimers.html")) : "0" ?></span> bytes
- </p>
+ <div id="system-page" style="background-color: rgba(26,26,26,0.8);border-radius: 10px;padding:20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);margin-top:30vh;">
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.inc"; ?>
+ <br>
- <!--suppress HtmlFormInputWithoutLabel -->
- <textarea id="page-editor">
- <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-disclaimers.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-disclaimers.html") : "" ?>
+ <p class="text-muted">
+ <span id="editor-save-status">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/content.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/content.html")) : "0" ?></span> bytes
+ </p>
+
+ <!--suppress HtmlFormInputWithoutLabel -->
+ <textarea id="page-editor">
+ <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/content.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/content.html") : "" ?>
</textarea>
- <script src="/assets/editor/editor.js"></script>
- <script>
- let editor;
- ClassicEditor
- .create( document.querySelector( '#page-editor' ), {
- toolbar: [
- 'undo', 'redo', '|', 'removeFormat', '|', 'heading', '|', 'fontSize', 'fontColor', 'fontBackgroundColor', 'alignment', '|', 'bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|', 'code', '|', 'outdent', 'indent', '|', 'bulletedList', 'numberedList', '|', 'link', 'imageUpload', 'mediaEmbed', 'blockQuote', 'insertTable', 'codeBlock', '|', 'horizontalLine'
- ]
- } )
-
- .then( newEditor => {
- editor = newEditor;
- } )
- .catch( error => {
- console.error( error );
- } );
- </script>
- <style>
- :root {
- --ck-color-base-background: transparent;
- }
-
- .ck-toolbar {
- filter: invert(1);
- }
-
- .ck-tooltip__text {
- color: white !important;
- }
-
- .ck-dropdown__panel {
- background: #ddd !important;
- }
-
- .ck-color-grid__tile {
- filter: invert(1);
- }
-
- .ck-balloon-rotator {
- background-color: #ccc !important;
- }
-
- .ck-balloon-panel {
- filter: invert(1);
- }
- </style>
- <script>
- let lastSavedData = editor.getData();
- let lastFetchedData = editor.getData();
- let timeSinceLastModified = 0;
- let saving = false;
-
- async function save() {
- let data = editor.getData();
- document.getElementById("editor-save-status").innerHTML = "Saving...";
- document.getElementById("editor-save-status").classList.remove("text-danger");
- document.getElementById("editor-save-status").classList.remove("text-muted");
- document.getElementById("editor-save-status").classList.remove("text-warning");
- document.getElementById("editor-save-status").classList.add("text-primary");
- saving = true;
-
- try {
- await window.fetch("/api/save?system=<?= $systemID ?>&member=null", {
- method: "POST",
- body: JSON.stringify({ content: data })
- });
- document.getElementById("editor-save-status").innerHTML = "Saved";
- document.getElementById("editor-save-status").classList.remove("text-danger");
- document.getElementById("editor-save-status").classList.add("text-muted");
- document.getElementById("editor-save-status").classList.remove("text-warning");
- document.getElementById("editor-save-status").classList.remove("text-primary");
- lastSavedData = data;
- saving = false;
- } catch (e) {
- console.error(e);
- document.getElementById("editor-save-status").innerHTML = "Failed to save";
- document.getElementById("editor-save-status").classList.add("text-danger");
- document.getElementById("editor-save-status").classList.remove("text-muted");
- document.getElementById("editor-save-status").classList.remove("text-warning");
- document.getElementById("editor-save-status").classList.remove("text-primary");
- }
- }
-
- document.onclick = async () => {
- if (saving) return;
-
- if (editor.getData() !== lastSavedData) {
- await save();
- }
- }
-
- setInterval(async () => {
- if (saving) return;
-
- document.getElementById("editor-size").innerHTML = editor.getData().length;
-
- if (editor.getData() !== lastSavedData) {
- document.getElementById("editor-save-status").innerHTML = "Modified";
- document.getElementById("editor-save-status").classList.remove("text-danger");
- document.getElementById("editor-save-status").classList.remove("text-muted");
- document.getElementById("editor-save-status").classList.add("text-warning");
- document.getElementById("editor-save-status").classList.remove("text-primary");
-
- if (editor.getData() !== lastFetchedData) {
- lastFetchedData = editor.getData();
- timeSinceLastModified = 0;
- } else {
- timeSinceLastModified++;
+ <script src="/assets/editor/editor.js"></script>
+ <script>
+ let editor;
+ ClassicEditor
+ .create( document.querySelector( '#page-editor' ), {
+ toolbar: [
+ 'undo', 'redo', '|', 'removeFormat', '|', 'heading', '|', 'fontSize', 'fontColor', 'fontBackgroundColor', 'alignment', '|', 'bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|', 'code', '|', 'outdent', 'indent', '|', 'bulletedList', 'numberedList', '|', 'link', 'imageUpload', 'mediaEmbed', 'blockQuote', 'insertTable', 'codeBlock', '|', 'horizontalLine'
+ ]
+ } )
+
+ .then( newEditor => {
+ editor = newEditor;
+ } )
+ .catch( error => {
+ console.error( error );
+ } );
+ </script>
+ <style>
+ :root {
+ --ck-color-base-background: transparent;
+ }
+
+ .ck-toolbar {
+ filter: invert(1);
+ }
+
+ .ck-tooltip__text {
+ color: white !important;
+ }
+
+ .ck-dropdown__panel {
+ background: #ddd !important;
}
- if (timeSinceLastModified > 20) {
- await save();
+ .ck-color-grid__tile {
+ filter: invert(1);
}
- } else {
- timeSinceLastModified = 0;
- document.getElementById("editor-save-status").innerHTML = "Saved";
- document.getElementById("editor-save-status").classList.add("text-muted");
- document.getElementById("editor-save-status").classList.remove("text-warning");
- document.getElementById("editor-save-status").classList.remove("text-primary");
- }
- }, 100)
- </script>
+
+ .ck-balloon-rotator {
+ background-color: #ccc !important;
+ }
+
+ .ck-balloon-panel {
+ filter: invert(1);
+ }
+ </style>
+ <script>
+ let lastSavedData = editor.getData();
+ let lastFetchedData = editor.getData();
+ let timeSinceLastModified = 0;
+ let saving = false;
+
+ async function save() {
+ let data = editor.getData();
+ document.getElementById("editor-save-status").innerHTML = "Saving...";
+ document.getElementById("editor-save-status").classList.remove("text-danger");
+ document.getElementById("editor-save-status").classList.remove("text-muted");
+ document.getElementById("editor-save-status").classList.remove("text-warning");
+ document.getElementById("editor-save-status").classList.add("text-primary");
+ saving = true;
+
+ try {
+ await window.fetch("/api/save?system=<?= $systemID ?>&member=null", {
+ method: "POST",
+ body: JSON.stringify({ content: data })
+ });
+ document.getElementById("editor-save-status").innerHTML = "Saved";
+ document.getElementById("editor-save-status").classList.remove("text-danger");
+ document.getElementById("editor-save-status").classList.add("text-muted");
+ document.getElementById("editor-save-status").classList.remove("text-warning");
+ document.getElementById("editor-save-status").classList.remove("text-primary");
+ lastSavedData = data;
+ saving = false;
+ } catch (e) {
+ console.error(e);
+ document.getElementById("editor-save-status").innerHTML = "Failed to save";
+ document.getElementById("editor-save-status").classList.add("text-danger");
+ document.getElementById("editor-save-status").classList.remove("text-muted");
+ document.getElementById("editor-save-status").classList.remove("text-warning");
+ document.getElementById("editor-save-status").classList.remove("text-primary");
+ }
+ }
+
+ document.onclick = async () => {
+ if (saving) return;
+
+ if (editor.getData() !== lastSavedData) {
+ await save();
+ }
+ }
+
+ setInterval(async () => {
+ if (saving) return;
+
+ document.getElementById("editor-size").innerHTML = editor.getData().length;
+
+ if (editor.getData() !== lastSavedData) {
+ document.getElementById("editor-save-status").innerHTML = "Modified";
+ document.getElementById("editor-save-status").classList.remove("text-danger");
+ document.getElementById("editor-save-status").classList.remove("text-muted");
+ document.getElementById("editor-save-status").classList.add("text-warning");
+ document.getElementById("editor-save-status").classList.remove("text-primary");
+
+ if (editor.getData() !== lastFetchedData) {
+ lastFetchedData = editor.getData();
+ timeSinceLastModified = 0;
+ } else {
+ timeSinceLastModified++;
+ }
+
+ if (timeSinceLastModified > 20) {
+ await save();
+ }
+ } else {
+ timeSinceLastModified = 0;
+ document.getElementById("editor-save-status").innerHTML = "Saved";
+ document.getElementById("editor-save-status").classList.add("text-muted");
+ document.getElementById("editor-save-status").classList.remove("text-warning");
+ document.getElementById("editor-save-status").classList.remove("text-primary");
+ }
+ }, 100)
+ </script>
+ </div>
+ </div>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.inc"; ?>
</div>
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file
diff --git a/includes/system.inc b/includes/system.inc
index ae6477c..85b8a9c 100644
--- a/includes/system.inc
+++ b/includes/system.inc
@@ -2,8 +2,8 @@
?>
-<div id="system-banner-container" style="width: 100%;height: 65vh;position: fixed;background-image: url('/assets/uploads/banner-<?= $system ?>.jpg');background-size: cover;background-position: center; top: 0;">
- <div id="system-banner-inner" style="height: 100%;width: 100%;background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);"></div>
+<div id="system-banner-container" style="width: calc(100% - 300px);height: 65vh;position: fixed;background-image: url('/assets/uploads/banner-<?= $system ?>.jpg');background-size: cover;background-position: center; top: 0;">
+ <div id="system-banner-inner" style="height: 100%;width: 100%;background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,1) 100%);"></div>
</div>
<script>
diff --git a/includes/system/compare.inc b/includes/system/compare.inc
index d2023e4..d7fbdc6 100644
--- a/includes/system/compare.inc
+++ b/includes/system/compare.inc
@@ -46,12 +46,12 @@ function getMember(string $id) {
<span class="comparison-header-l5"><abbr title="Relations" data-bs-toggle="tooltip">Relt.</abbr></span>
</span>
<span class="comparison-header comparison-item">
- <span class="comparison-header-l0"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l1"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l2"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l3"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l4"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
- <span class="comparison-header-l5"><abbr title="Most common fronter" data-bs-toggle="tooltip">MCF</abbr></span>
+ <span class="comparison-header-l0">Memory</span>
+ <span class="comparison-header-l1">Memory</span>
+ <span class="comparison-header-l2">Memory</span>
+ <span class="comparison-header-l3">Memory</span>
+ <span class="comparison-header-l4"><abbr title="Memory" data-bs-toggle="tooltip">Mem.</abbr></span>
+ <span class="comparison-header-l5"><abbr title="Memory" data-bs-toggle="tooltip">Mem.</abbr></span>
</span>
<span class="comparison-header comparison-item">
<span class="comparison-header-l0">Fictive</span>
@@ -127,7 +127,7 @@ function getMember(string $id) {
<?php endforeach; ?>
</span>
<span class="comparison-item">
- <?= count($metadata["marefriends"]) + count($metadata["sisters"]) === 0 ? "-" : "" ?>
+ <?= count($metadata["marefriends"]) + count($metadata["sisters"]) + count($metadata["caretakers"]) === 0 ? "-" : "" ?>
<span class="comparison-relations-count">
<?= count($metadata["marefriends"]) + count($metadata["sisters"]) > 0 ? count($metadata["marefriends"]) + count($metadata["sisters"]) : "" ?>
</span>
@@ -145,9 +145,9 @@ function getMember(string $id) {
</span>
</span>
<span class="comparison-item">
- <?php if ($metadata["host"]): ?>
- <?php if ($travelling[$member["id"]]["travelling"]): ?>
- <img data-bs-toggle="tooltip" title="Yes, but currently travelling" src="/assets/icons/partial.svg" alt="Yes, but currently travelling" style="width:24px;">
+ <?php if ($metadata["shared_memory"] > 0): ?>
+ <?php if ($metadata["shared_memory"] === 1): ?>
+ <img data-bs-toggle="tooltip" title="Partial" src="/assets/icons/partial.svg" alt="Partial" style="width:24px;">
<?php else: ?>
<img data-bs-toggle="tooltip" title="Yes" src="/assets/icons/complete.svg" alt="Yes" style="width:24px;">
<?php endif; ?>
diff --git a/includes/system/species.inc b/includes/system/species.inc
index cca1eb8..fb1ba69 100644
--- a/includes/system/species.inc
+++ b/includes/system/species.inc
@@ -3,18 +3,18 @@
$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true);
$members = scoreOrder($members, $systemID);
-function species(array $members, string $id, string $name) { global $systemID; ?>
+function species(array $members, string $id, string $name) { global $systemID; global $travelling; ?>
<?php
$members = [
- ...array_filter($members, function ($i) {
+ ...array_map(function ($i) use ($systemID) { $i["_system"] = $systemID; return $i; },array_filter($members, function ($i) use ($systemID) {
global $travelling;
return !$travelling[$i['id']]['travelling'];
- }),
- ...array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($id, $systemID) {
+ })),
+ ...array_map(function ($i) use ($systemID) { $i["_system"] = $systemID === "gdapd" ? "ynmuc" : "gdapd"; return $i; }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($id, $systemID) {
global $travelling;
return $travelling[$i['id']]['travelling'] && in_array($id, parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $i['id'] . ".json"), true))["species"]);
- })
+ }))
];
?>
@@ -26,7 +26,7 @@ function species(array $members, string $id, string $name) { global $systemID; ?
<div class="relation-item" style="margin-left:10px;padding:0 20px;">
<?php if (count($members) > 0): ?>
<?php $index = 0; foreach ($members as $member): ?>
- <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, &nbsp;</span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?>
+ <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, &nbsp;</span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?>
<?php else: ?>-<?php endif; ?>
</div>
</div>
diff --git a/includes/titlebar.inc b/includes/titlebar.inc
index de58549..5166f08 100644
--- a/includes/titlebar.inc
+++ b/includes/titlebar.inc
@@ -1,7 +1,10 @@
-<?php global $toplevel; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); ?>
+<?php global $toplevel; global $system; global $isLoggedIn; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); ?>
<span>
<?php
+$membersNames = array_map(function ($i) {
+ return $i["name"];
+}, scoreOrderGlobal());
$parts = explode("/", $_GET['_']);
$name = $toplevel === "" ? "home" : $toplevel;
@@ -11,13 +14,15 @@ $part2 = null;
$part3 = null;
if (isset($pages[$name])) {
- if (($name === "docs" || $name === "toys" || $name === "actions") && isset($parts[2])) {
+ if (($name === "docs" || $name === "toys" || $name === "actions" || $name === "computers") && isset($parts[2])) {
$part3 = "<a class='title-bar-backlink' href='/-/dashboard'>Dashboard</a>";
$part2 = "<a class='title-bar-backlink' href='/-/$name'>" . $pages[$name]['name'] . "</a>";
if ($name === "docs") {
$actionsProfile = "docs-item";
$part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $parts[2] . ".json"), true)["name"];
+ } elseif ($name === "computers") {
+ $part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $parts[2] . ".json"), true)["host"];
} else {
$actionsProfile = "$name-item";
$list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($name === "toys" ? "toys/toys" : "actions/actions") . ".json"), true);
@@ -104,6 +109,13 @@ if ($actionsProfile === "default") {
$actionsProfile = "docs";
break;
+ case "edit":
+ case "edit-private":
+ if (count($parts) === 3) $actionsProfile = "editor-system";
+ if (count($parts) > 3 && in_array($parts[3], $membersNames)) $actionsProfile = "editor-member";
+ if (count($parts) > 3 && !in_array($parts[3], $membersNames)) $actionsProfile = "editor-subsystem";
+ break;
+
case "debug":
$actionsProfile = "debug";
break;
@@ -112,13 +124,14 @@ if ($actionsProfile === "default") {
$actionsProfile = "bitset";
break;
- case "parser":
- case "prefix":
- $actionsProfile = "parser-prefix";
+ case "computers":
+ if (count($parts) === 3) $actionsProfile = "computers";
+ if (count($parts) === 4) $actionsProfile = "computers-remote";
break;
}
}
+echo("<span id='title-bar-parts-desktop''>");
if (isset($part3)) {
echo "$part3 > $part2 > <b>$part1</b>";
} elseif (isset($part2)) {
@@ -126,6 +139,10 @@ if (isset($part3)) {
} else {
echo "<b>$part1</b>";
}
+echo("</span>");
+echo("<span id='title-bar-parts-mobile' style='display:none;'>");
+echo "<b>$part1</b>";
+echo("</span>");
$links = [
"default" => [
@@ -138,18 +155,455 @@ $links = [
"icon" => "/assets/icons/up.svg",
"invert" => true
]
+ ],
+ "computers" => [
+ [
+ "name" => "Remote control",
+ "link" => [
+ "type" => "url",
+ "text" => "/-/computers/" . ($parts[2] ?? null) . "/control"
+ ],
+ "icon" => "/assets/icons/computers-remote.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Screens",
+ "link" => [
+ "type" => "url",
+ "text" => "#screens"
+ ],
+ "icon" => "/assets/icons/computers-screens.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Windows",
+ "link" => [
+ "type" => "url",
+ "text" => "#windows"
+ ],
+ "icon" => "/assets/icons/computers-windows.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "computers-remote" => [
+ [
+ "name" => "Enable controlling",
+ "link" => [
+ "type" => "js",
+ "text" => "enableControl();"
+ ],
+ "icon" => "/assets/icons/computers-on.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Disable controlling",
+ "link" => [
+ "type" => "js",
+ "text" => "disableControl();"
+ ],
+ "icon" => "/assets/icons/computers-off.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Back to computer info",
+ "link" => [
+ "type" => "url",
+ "text" => "/-/computers/" . ($parts[2] ?? null)
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "editor-member" => [
+ [
+ "name" => "View page",
+ "link" => [
+ "type" => "url",
+ "text" => "/" . ($parts[3] ?? null)
+ ],
+ "icon" => "/assets/icons/view.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "editor-system" => [
+ [
+ "name" => "View page",
+ "link" => [
+ "type" => "url",
+ "text" => "/" . ($parts[2] ?? null)
+ ],
+ "icon" => "/assets/icons/view.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "editor-subsystem" => [
+ [
+ "name" => "View page",
+ "link" => [
+ "type" => "url",
+ "text" => "/" . ($parts[2] ?? null) . "/-/subsystem" . ($parts[3] ?? null)
+ ],
+ "icon" => "/assets/icons/view.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "member" => [
+ [
+ "name" => "System",
+ "link" => [
+ "type" => "url",
+ "text" => "/$system"
+ ],
+ "icon" => "/assets/icons/parent.svg",
+ "invert" => true
+ ],
+ [
+ "name" => $pages["edit-private"]["name"],
+ "link" => [
+ "type" => "url",
+ "text" => "/-/edit-private/$system/$name"
+ ],
+ "icon" => "/assets/icons/edit-private.svg",
+ "invert" => true,
+ "show" => $isLoggedIn
+ ],
+ [
+ "name" => $pages["edit"]["name"],
+ "link" => [
+ "type" => "url",
+ "text" => "/-/edit/$system/$name"
+ ],
+ "icon" => "/assets/icons/edit.svg",
+ "invert" => true,
+ "show" => $isLoggedIn
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "subsystem" => [
+ [
+ "name" => "Parent system",
+ "link" => [
+ "type" => "url",
+ "text" => "/$parts[0]"
+ ],
+ "icon" => "/assets/icons/parent.svg",
+ "invert" => true
+ ],
+ [
+ "name" => $pages["edit"]["name"],
+ "link" => [
+ "type" => "url",
+ "text" => "/-/edit/$system/" . ($parts[3] ?? null)
+ ],
+ "icon" => "/assets/icons/edit.svg",
+ "invert" => true,
+ "show" => $isLoggedIn
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "home" => [
+ [
+ "name" => "Cloudburst System",
+ "link" => [
+ "type" => "url",
+ "text" => "/cloudburst"
+ ],
+ "icon" => "/assets/avatars/ade46823206b4b0cad3ccaae934a5f3b.webp",
+ "invert" => false
+ ],
+ [
+ "name" => "Raindrops System",
+ "link" => [
+ "type" => "url",
+ "text" => "/raindrops"
+ ],
+ "icon" => "/assets/avatars/7d9f543ef74240f69d0786c3f2983124.webp",
+ "invert" => false
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "planner" => [
+ [
+ "name" => "Add in the Cloudburst System",
+ "link" => [
+ "type" => "js",
+ "text" => "document.getElementById('planner-add-link-cloudburst-0').click()"
+ ],
+ "icon" => "https://static.equestria.horse/ponies/icons/add-cloudburst.svg",
+ "invert" => false
+ ],
+ [
+ "name" => "Add in the Raindrops System",
+ "link" => [
+ "type" => "js",
+ "text" => "document.getElementById('planner-add-link-raindrops-0').click()"
+ ],
+ "icon" => "https://static.equestria.horse/ponies/icons/add-raindrops.svg",
+ "invert" => false
+ ]
+ ],
+ "actions-or-toys" => [
+ [
+ "name" => "Search",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0; document.getElementById('search').focus();"
+ ],
+ "icon" => "/assets/icons/search.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Add",
+ "link" => [
+ "type" => "js",
+ "text" => "(new bootstrap.Modal(document.getElementById('creator'))).show(); setInterval(() => { document.getElementById('creator-title').focus(); }, 500);"
+ ],
+ "icon" => "/assets/icons/add.svg",
+ "invert" => true
+ ]
+ ],
+ "docs" => [
+ [
+ "name" => "Marked for deletion",
+ "link" => [
+ "type" => "url",
+ "text" => "#deletable"
+ ],
+ "icon" => "/assets/icons/delete.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Create new",
+ "link" => [
+ "type" => "url",
+ "text" => "/-/docs/add"
+ ],
+ "icon" => "/assets/icons/add.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "docs-item" => [
+ [
+ "name" => "Save",
+ "link" => [
+ "type" => "js",
+ "text" => "save();"
+ ],
+ "icon" => "/assets/icons/save.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "debug" => [
+ [
+ "name" => "Reported failures",
+ "link" => [
+ "type" => "url",
+ "text" => "#failures"
+ ],
+ "icon" => "/assets/icons/failures.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Processing times",
+ "link" => [
+ "type" => "url",
+ "text" => "#times"
+ ],
+ "icon" => "/assets/icons/time.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
+ ],
+ "bitset" => [
+ [
+ "name" => "Copy bitset",
+ "link" => [
+ "type" => "js",
+ "text" => "navigator.clipboard.writeText(document.getElementById('input').value);"
+ ],
+ "icon" => "/assets/icons/copy.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Reset",
+ "link" => [
+ "type" => "js",
+ "text" => "document.getElementById('input').value = '2048'; calculateInput();"
+ ],
+ "icon" => "/assets/icons/reset.svg",
+ "invert" => true
+ ]
+ ],
+ "alert" => [
+ [
+ "name" => "Turn alert on",
+ "link" => [
+ "type" => "js",
+ "text" => "if (document.getElementById('btn-on').style.display === 'block') (new bootstrap.Modal(document.getElementById('turn-on'))).show();"
+ ],
+ "icon" => "/assets/icons/alert-on.svg",
+ "invert" => true
+ ],
+ [
+ "name" => "Turn alert off",
+ "link" => [
+ "type" => "js",
+ "text" => "if (document.getElementById('btn-off').style.display === 'block') (new bootstrap.Modal(document.getElementById('turn-off'))).show();"
+ ],
+ "icon" => "/assets/icons/alert-off.svg",
+ "invert" => true
+ ]
+ ],
+ "system" => [
+ [
+ "name" => $pages["s:history"]["name"],
+ "link" => [
+ "type" => "url",
+ "text" => "/$name/-/history"
+ ],
+ "icon" => "/assets/icons/history.svg",
+ "invert" => true
+ ],
+ [
+ "name" => $pages["s:compare"]["name"],
+ "link" => [
+ "type" => "url",
+ "text" => "/$name/-/compare"
+ ],
+ "icon" => "/assets/icons/compare.svg",
+ "invert" => true
+ ],
+ [
+ "name" => $pages["s:tree"]["name"],
+ "link" => [
+ "type" => "url",
+ "text" => "/$name/-/tree"
+ ],
+ "icon" => "/assets/icons/tree.svg",
+ "invert" => true
+ ],
+ [
+ "name" => $pages["s:species"]["name"],
+ "link" => [
+ "type" => "url",
+ "text" => "/$name/-/species"
+ ],
+ "icon" => "/assets/icons/species.svg",
+ "invert" => true
+ ],
+ [
+ "name" => $pages["edit"]["name"],
+ "link" => [
+ "type" => "url",
+ "text" => "/-/edit/$name"
+ ],
+ "icon" => "/assets/icons/edit.svg",
+ "invert" => true,
+ "show" => $isLoggedIn
+ ],
+ [
+ "name" => "Go back to top",
+ "link" => [
+ "type" => "js",
+ "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
+ ],
+ "icon" => "/assets/icons/up.svg",
+ "invert" => true
+ ]
]
];
$linksList = $links[isset($links[$actionsProfile]) ? $actionsProfile : "default"];
-?> (<code><?= $actionsProfile ?></code>)<!--<pre><?php var_dump($parts); ?></pre>-->
+?><!-- (<code><?= $actionsProfile ?></code>)--><!--<pre><?php var_dump($parts); ?></pre>-->
<span id="title-bar-actions">
- <?php foreach ($linksList as $index => $link): ?>
- <a style="display: inline-block; padding: 4px;" id="title-bar-action-<?= $index ?>" <?php if ($link["link"]["type"] === "url"): ?>href<?php else: ?>onclick<?php endif; ?>="<?= $link["link"]["text"] ?>" title="<?= $link["name"] ?>" data-bs-toggle="tooltip" class="title-bar-action tooltip-nohelp">
- <img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px;vertical-align: middle;">
- </a>
- <?php endforeach; ?>
+ <?php foreach ($linksList as $index => $link): if (!(isset($link["show"]) && !$link["show"])): ?><a style="display: inline-block; padding: 4px;" id="title-bar-action-<?= $index ?>" <?php if ($link["link"]["type"] === "url"): ?>href<?php else: ?>onclick<?php endif; ?>="<?= $link["link"]["text"] ?>" title="<?= $link["name"] ?>" data-bs-toggle="tooltip" class="title-bar-action tooltip-nohelp"><img src="<?= $link["icon"] ?>" <?php if ($link["invert"]): ?>class="dropdown-icon"<?php endif; ?> alt="" style="width:24px;vertical-align: middle;"></a><?php endif; endforeach; ?>
</span>
</span>