diff options
Diffstat (limited to 'includes/fragments/member.inc')
-rw-r--r-- | includes/fragments/member.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/includes/fragments/member.inc b/includes/fragments/member.inc index 0b1ce03..c621bc3 100644 --- a/includes/fragments/member.inc +++ b/includes/fragments/member.inc @@ -1,4 +1,4 @@ -<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; global $lang; global $pages; global $app; global $isLoggedIn; global $isLowerLoggedIn; +<?php global $system; global $defaultMember; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; global $lang; global $pages; global $app; global $isLoggedIn; global $isLowerLoggedIn; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; @@ -11,7 +11,7 @@ if ($memberData["name"] === "fusion") { } if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion") { - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true)); + $metadata = parseMetadata(json_decode(file_get_contents_or_defaults($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", $defaultMember), true)); if (isset($metadata["private"]) && $metadata["private"] && !$isLoggedIn && !$isLowerLoggedIn) { peh_error("Page not found: " . strip_tags($member), 404); @@ -20,10 +20,10 @@ if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion") { require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); +$travelling = []; if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion") { - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true)); + $metadata = parseMetadata(json_decode(file_get_contents_or_defaults($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", $defaultMember), true)); } global $isLoggedIn; @@ -105,7 +105,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".pn <details> <summary style="list-style: none;"> - <small style="opacity:.5;display:block;"><a href="/-/metadata/<?= $system ?>/<?= $memberData['name'] ?>">Edit metadata</a> ยท <a href="/-/ponytown/<?= $memberData['id'] ?>">Upload Pony Town character</a></small> + <small style="opacity:.5;display:block;">Click here for technical details.</small> </summary> <div class="alert alert-dark"> <ul style="margin-bottom:0;"> @@ -124,7 +124,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".pn <li> <b>Metadata:</b> <ul> - <?php foreach (parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json"), true)) as $name => $value): ?> + <?php foreach (parseMetadata(json_decode(file_get_contents_or_defaults($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json", $defaultMember), true)) as $name => $value): ?> <li> <b><?= $name ?></b>: <?php @@ -201,4 +201,4 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $memberID . ".pn <?php endif; ?> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/footer.inc'; ?> |