summaryrefslogtreecommitdiff
path: root/includes/metadata.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 14:20:13 +0100
committerMinteck <contact@minteck.org>2023-02-23 14:20:13 +0100
commit8cc1f13c17fa2fb5a4410542d39e650e02945634 (patch)
treee3f668e635253310b97fb379d71318dc96d1dd2d /includes/metadata.inc
parent6563d542af0930ebb6b2f9b71f2b7538d7467665 (diff)
downloadpluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.tar.gz
pluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.tar.bz2
pluralconnect-8cc1f13c17fa2fb5a4410542d39e650e02945634.zip
Updated 27 files, added assets/uploads/pt-twilightsparkle.png and deleted 3 files (automated)
Diffstat (limited to 'includes/metadata.inc')
-rw-r--r--includes/metadata.inc16
1 files changed, 8 insertions, 8 deletions
diff --git a/includes/metadata.inc b/includes/metadata.inc
index 2e009cd..10a87ab 100644
--- a/includes/metadata.inc
+++ b/includes/metadata.inc
@@ -1,4 +1,4 @@
-<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing metadata for " . $memberCommonName . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
+<?php global $system; global $app; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing metadata for " . $memberCommonName . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")) {
$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true));
@@ -86,10 +86,12 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<h3>Relationships</h3>
+ <?php if ($systemID !== $app["other"]["id"]): ?>
<p>
<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>
+ <?php endif; ?>
<p>
<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"]) ?>">
@@ -102,11 +104,8 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<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>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>
+ <?php if ($systemID !== $app["other"]["id"]): ?>
<hr>
<h3>Technical details</h3>
@@ -132,6 +131,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<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>
+ <?php endif; ?>
<hr>
@@ -141,7 +141,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
$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)): ?>
+ foreach ($flags as $id => $name): if (!is_array($name) && !is_null($name)): if (($systemID === $app["other"]["id"] && str_starts_with($name, "!!")) || $systemID !== $app["other"]["id"]): ?>
<label style="margin-bottom:5px;">
<input <?= $metadata[$id] ? "checked" : "" ?> class="form-check-input" type="checkbox" name="flags[<?= $id ?>]">
<?= str_starts_with($name, "!!") ? substr($name, 2) : $name ?>
@@ -151,11 +151,11 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member
<input <?= $metadata[$id][$id2] ? "checked" : "" ?> class="form-check-input" type="checkbox" name="flags[<?= $id ?>][<?= $id2 ?>]">
<?= str_starts_with($name2, "!!") ? substr($name2, 2) : $name2 ?>
</label><br>
- <?php endforeach; endif; endforeach; ?>
+ <?php endforeach; endif; endif; endforeach; ?>
<hr>
- <input name="submit" class="btn btn-outline-primary" value="Save and quit" type="submit">
+ <input name="submit" class="btn btn-outline-primary" value="Save and refresh" type="submit">
</form>
<?php else: ?>
<div class="alert alert-warning">