summaryrefslogtreecommitdiff
path: root/includes/fullbanner.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/fullbanner.inc')
-rw-r--r--includes/fullbanner.inc102
1 files changed, 102 insertions, 0 deletions
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