summaryrefslogtreecommitdiff
path: root/includes/metadata.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/metadata.inc')
-rw-r--r--includes/metadata.inc182
1 files changed, 116 insertions, 66 deletions
diff --git a/includes/metadata.inc b/includes/metadata.inc
index 7bc82ef..d7875c5 100644
--- a/includes/metadata.inc
+++ b/includes/metadata.inc
@@ -16,47 +16,145 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<b>File</b><br>
<?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json" ?>
</p>
+
+ <hr>
+
+ <h3>General information</h3>
+
+ <div style="margin-bottom: 1rem;">
+ <b>General:</b><br>
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px;">
+ <select class="tooltip-nohelp form-select" style='display:inline-block;filter:invert(1) hue-rotate(180deg);background-image:url("data:image/svg+xml,%3csvg xmlns=&apos;http://www.w3.org/2000/svg&apos; viewBox=&apos;0 0 16 16&apos;%3e%3cpath fill=&apos;none&apos; stroke=&apos;%23000000&apos; stroke-linecap=&apos;round&apos; stroke-linejoin=&apos;round&apos; stroke-width=&apos;2&apos; d=&apos;M2 5l6 6 6-6&apos;/%3e%3c/svg%3e");' name="food">
+ <option <?= $metadata["food"] === 0 ? "selected" : "" ?> value="0">Doesn't need to eat</option>
+ <option <?= $metadata["food"] === 1 ? "selected" : "" ?> value="1">Can't eat fish or meat</option>
+ <option <?= $metadata["food"] === 2 ? "selected" : "" ?> value="2">Can't eat meat</option>
+ <option <?= $metadata["food"] === 3 ? "selected" : "" ?> value="3">Can eat everything</option>
+ </select>
+ <select class="tooltip-nohelp form-select" style='display:inline-block;filter:invert(1) hue-rotate(180deg);background-image:url("data:image/svg+xml,%3csvg xmlns=&apos;http://www.w3.org/2000/svg&apos; viewBox=&apos;0 0 16 16&apos;%3e%3cpath fill=&apos;none&apos; stroke=&apos;%23000000&apos; stroke-linecap=&apos;round&apos; stroke-linejoin=&apos;round&apos; stroke-width=&apos;2&apos; d=&apos;M2 5l6 6 6-6&apos;/%3e%3c/svg%3e");' name="shared_memory">
+ <option <?= $metadata["shared_memory"] === 2 ? "selected" : "" ?> value="2">Doing subconsciously</option>
+ <option <?= $metadata["shared_memory"] === 1 ? "selected" : "" ?> value="1">Consciously willing</option>
+ <option <?= $metadata["shared_memory"] === 0 ? "selected" : "" ?> value="0">Incapable/not willing</option>
+ </select>
+ </div>
+ </div>
+ <div style="margin-bottom: 1rem;">
+ <b>Species</b><br>
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px;">
+ <select class="tooltip-nohelp form-select" style='display:inline-block;filter:invert(1) hue-rotate(180deg);background-image:url("data:image/svg+xml,%3csvg xmlns=&apos;http://www.w3.org/2000/svg&apos; viewBox=&apos;0 0 16 16&apos;%3e%3cpath fill=&apos;none&apos; stroke=&apos;%23000000&apos; stroke-linecap=&apos;round&apos; stroke-linejoin=&apos;round&apos; stroke-width=&apos;2&apos; d=&apos;M2 5l6 6 6-6&apos;/%3e%3c/svg%3e");' name="species[0]">
+ <option <?= !isset($metadata["species"][0]) || $metadata["species"][0] === "" ? "selected" : "" ?> value="" disabled>None</option>
+ <option <?= $metadata["species"][0] === "earth" ? "selected" : "" ?> value="earth">Earth pony</option>
+ <option <?= $metadata["species"][0] === "unicorn" ? "selected" : "" ?> value="unicorn">Unicorn</option>
+ <option <?= $metadata["species"][0] === "pegasus" ? "selected" : "" ?> value="pegasus">Pegasus</option>
+ <option <?= $metadata["species"][0] === "alicorn" ? "selected" : "" ?> value="alicorn">Alicorn</option>
+ <option <?= $metadata["species"][0] === "batpony" ? "selected" : "" ?> value="batpony">Bat pony</option>
+ <option <?= $metadata["species"][0] === "crystal" ? "selected" : "" ?> value="crystal">Crystal pony</option>
+ <option <?= $metadata["species"][0] === "changeling" ? "selected" : "" ?> value="changeling">Changeling</option>
+ </select>
+ <select class="tooltip-nohelp form-select" style='display:inline-block;filter:invert(1) hue-rotate(180deg);background-image:url("data:image/svg+xml,%3csvg xmlns=&apos;http://www.w3.org/2000/svg&apos; viewBox=&apos;0 0 16 16&apos;%3e%3cpath fill=&apos;none&apos; stroke=&apos;%23000000&apos; stroke-linecap=&apos;round&apos; stroke-linejoin=&apos;round&apos; stroke-width=&apos;2&apos; d=&apos;M2 5l6 6 6-6&apos;/%3e%3c/svg%3e");' name="species[1]">
+ <option <?= !isset($metadata["species"][1]) || $metadata["species"][1] === "" ? "selected" : "" ?> value="">None</option>
+ <option <?= $metadata["species"][1] === "earth" ? "selected" : "" ?> value="earth">Earth pony</option>
+ <option <?= $metadata["species"][1] === "unicorn" ? "selected" : "" ?> value="unicorn">Unicorn</option>
+ <option <?= $metadata["species"][1] === "pegasus" ? "selected" : "" ?> value="pegasus">Pegasus</option>
+ <option <?= $metadata["species"][1] === "alicorn" ? "selected" : "" ?> value="alicorn">Alicorn</option>
+ <option <?= $metadata["species"][1] === "batpony" ? "selected" : "" ?> value="batpony">Bat pony</option>
+ <option <?= $metadata["species"][1] === "crystal" ? "selected" : "" ?> value="crystal">Crystal pony</option>
+ <option <?= $metadata["species"][1] === "changeling" ? "selected" : "" ?> value="changeling">Changeling</option>
+ </select>
+ </div>
+ </div>
+ <div style="margin-bottom: 1rem;">
+ <b>Alignment</b><br>
+ <div style="display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px;">
+ <select class="tooltip-nohelp form-select" style='display:inline-block;filter:invert(1) hue-rotate(180deg);background-image:url("data:image/svg+xml,%3csvg xmlns=&apos;http://www.w3.org/2000/svg&apos; viewBox=&apos;0 0 16 16&apos;%3e%3cpath fill=&apos;none&apos; stroke=&apos;%23000000&apos; stroke-linecap=&apos;round&apos; stroke-linejoin=&apos;round&apos; stroke-width=&apos;2&apos; d=&apos;M2 5l6 6 6-6&apos;/%3e%3c/svg%3e");' name="alignment[sexual]">
+ <option <?= $metadata["alignment"]["sexual"] === "aroace" ? "selected" : "" ?> value="aroace">Asexual</option>
+ <option <?= $metadata["alignment"]["sexual"] === "hetero" ? "selected" : "" ?> value="hetero">Heterosexual</option>
+ <option <?= $metadata["alignment"]["sexual"] === "homo" ? "selected" : "" ?> value="homo">Homosexual</option>
+ <option <?= $metadata["alignment"]["sexual"] === "bi" ? "selected" : "" ?> value="bi">Bisexual</option>
+ <option <?= $metadata["alignment"]["sexual"] === "pan" ? "selected" : "" ?> value="pan">Pansexual</option>
+ </select>
+ <select class="tooltip-nohelp form-select" style='display:inline-block;filter:invert(1) hue-rotate(180deg);background-image:url("data:image/svg+xml,%3csvg xmlns=&apos;http://www.w3.org/2000/svg&apos; viewBox=&apos;0 0 16 16&apos;%3e%3cpath fill=&apos;none&apos; stroke=&apos;%23000000&apos; stroke-linecap=&apos;round&apos; stroke-linejoin=&apos;round&apos; stroke-width=&apos;2&apos; d=&apos;M2 5l6 6 6-6&apos;/%3e%3c/svg%3e");' name="alignment[romantic]">
+ <option <?= $metadata["alignment"]["romantic"] === "aroace" ? "selected" : "" ?> value="aroace">Aromantic</option>
+ <option <?= $metadata["alignment"]["romantic"] === "hetero" ? "selected" : "" ?> value="hetero">Heteroromantic</option>
+ <option <?= $metadata["alignment"]["romantic"] === "homo" ? "selected" : "" ?> value="homo">Homoromantic</option>
+ <option <?= $metadata["alignment"]["romantic"] === "bi" ? "selected" : "" ?> value="bi">Biromantic</option>
+ <option <?= $metadata["alignment"]["romantic"] === "pan" ? "selected" : "" ?> value="pan">Panromantic</option>
+ </select>
+ </div>
+ </div>
+
+ <hr>
+
+ <h3>Relationships</h3>
+
<p>
- <b>Bitset</b><br>
- <code id="bitset-text"><?= $metadata["bitset"] ?></code> ยท <a data-bs-toggle="modal" data-bs-target="#bitset" href="#">Edit...</a>
- <input name="bitset" id="bitset-value" type="hidden" value="<?= $metadata["bitset"] ?>">
- </p>
- <p>
- <b>Sexfriends (full IDs, comma-separated):</b><br>
+ <b>Sexfriends (full IDs, comma-separated)</b><br>
<input name="sexfriends" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["sexfriends"]) ?>">
</p>
<p>
- <b>Marefriends (full IDs, comma-separated):</b><br>
+ <b>Marefriends (full IDs, comma-separated)</b><br>
<input name="marefriends" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["marefriends"]) ?>">
</p>
<p>
- <b>Sisters (full IDs, comma-separated):</b><br>
+ <b>Sisters (full IDs, comma-separated)</b><br>
<input name="sisters" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["sisters"]) ?>">
</p>
<p>
- <b>Caretakers (full IDs, comma-separated):</b><br>
+ <b>Caretakers (full IDs, comma-separated)</b><br>
<input name="caretakers" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= implode(", ", $metadata["caretakers"]) ?>">
</p>
<p>
- <b>Primary interest (keep it short):</b><br>
+ <b>Age regressed version (local ID)</b><br>
+ <input name="regressed" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= $metadata["regressed"] ?? "" ?>">
+ </p>
+
+ <hr>
+
+ <h3>Technical details</h3>
+
+ <p>
+ <b>Primary interest (keep it short)</b><br>
<input name="interest" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= $metadata["interest"] ?? "" ?>">
</p>
<p>
- <b>Age regressed version (local ID):</b><br>
- <input name="regressed" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= $metadata["regressed"] ?? "" ?>">
+ <b>Member code</b><br>
+ <input name="membc" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= $metadata["code"] ?? "" ?>">
</p>
+
+ <hr>
+
+ <h3>Age information</h3>
+
<p>
- <b>Birth date (use January 1<sup>st</sup> for none):</b><br>
+ <b>Birth date (use January 1<sup>st</sup> for none)</b><br>
<input name="birth" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="date" value="<?= $metadata["birth"]["year"] ?? "" ?>-<?= $metadata["birth"]["date"] ?? "" ?>">
</p>
<p>
- <b>Age (for ponies with fixed age):</b><br>
+ <b>Age (for ponies with fixed age)</b><br>
<input name="age" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="number" value="<?= $metadata["birth"]["age"] ?? "" ?>">
</p>
- <p>
- <b>Member code:</b><br>
- <input name="membc" class="form-control" style="filter: invert(1) hue-rotate(180deg);" type="text" value="<?= $metadata["code"] ?? "" ?>">
- </p>
+
+ <hr>
+
+ <h3>Toggleable flags</h3>
+
+ <?php
+
+ $flags = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/flags.json"), true);
+
+ foreach ($flags as $id => $name): if (!is_array($name) && !is_null($name)): ?>
+ <label style="margin-bottom:5px;">
+ <input <?= $metadata[$id] ? "checked" : "" ?> class="form-check-input" type="checkbox" name="flags[<?= $id ?>]">
+ <?= $name ?>
+ </label><br>
+ <?php else: foreach ($name as $id2 => $name2): ?>
+ <label style="margin-bottom:5px;">
+ <input <?= $metadata[$id][$id2] ? "checked" : "" ?> class="form-check-input" type="checkbox" name="flags[<?= $id ?>][<?= $id2 ?>]">
+ <?= $name2 ?>
+ </label><br>
+ <?php endforeach; endif; endforeach; ?>
+
+ <hr>
+
<input name="submit" class="btn btn-outline-primary" value="Save and quit" type="submit">
</form>
<?php else: ?>
@@ -66,52 +164,4 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<?php endif; ?>
</div>
-<div class="modal fade" id="bitset">
- <div class="modal-dialog modal-xl">
- <div class="modal-content">
- <div class="modal-header">
- <h4 class="modal-title">
- <img src="/assets/icons/bitset.svg" style="filter: invert(1); vertical-align: middle; height: 32px; margin-right: 10px;">
- <span style="vertical-align: middle;">Bitset editor</span>
- </h4>
- <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
- </div>
- <div class="modal-body">
- <iframe src="/-/bitset?embed=<?= $metadata["bitset"] ?>"></iframe>
- <script>
- setInterval(() => {
- try {
- document.getElementById("bitset-text").innerText = document.getElementById("bitset-value").value = document.getElementsByTagName("iframe")[0].contentDocument.getElementById("output-dec").innerText;
- } catch (e) {}
- })
- </script>
- </div>
- </div>
- </div>
-</div>
-
-<style>
- .modal-header {
- border-bottom: 1px solid #353738;
- }
-
- .modal-content {
- border: 1px solid rgba(255, 255, 255, .2);
- background-color: #111;
- }
-
- .btn-close {
- filter: invert(1);
- }
-
- iframe {
- width: calc(100% + 2rem);
- min-height: calc(100% + 2rem);
- border-bottom-left-radius: .3rem;
- border-bottom-right-radius: .3rem;
- height: 60vh;
- margin: -1rem -1rem calc(-1rem - 6px);
- }
-</style>
-
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file