diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/components/navigation.inc | 8 | ||||
-rw-r--r-- | includes/components/pleasure.inc | 10 | ||||
-rw-r--r-- | includes/flags.json | 2 | ||||
-rw-r--r-- | includes/fragments/member.inc | 2 | ||||
-rw-r--r-- | includes/fragments/metadata.inc | 20 | ||||
-rw-r--r-- | includes/fragments/system.inc | 2 | ||||
-rw-r--r-- | includes/util/banner.inc | 4 |
7 files changed, 20 insertions, 28 deletions
diff --git a/includes/components/navigation.inc b/includes/components/navigation.inc index 9a777ce..f08fca2 100644 --- a/includes/components/navigation.inc +++ b/includes/components/navigation.inc @@ -158,14 +158,6 @@ $navigation_admin = [ "private" => false ], [ - "name" => $pages["rules"]["name"][$lang["_name"]], - "icon" => "/assets/icons/rules.svg", - "invert" => true, - "link" => "/-/rules", - "stepped" => null, - "private" => true - ], - [ "name" => $pages["toys"]["name"][$lang["_name"]], "icon" => "/assets/icons/toys.svg", "invert" => true, diff --git a/includes/components/pleasure.inc b/includes/components/pleasure.inc index 40bf7fd..0939228 100644 --- a/includes/components/pleasure.inc +++ b/includes/components/pleasure.inc @@ -28,7 +28,7 @@ ?> However, if you wish, any of the ponies mentioned on this page can take control of the body for the amount of time required for sex. </div> - <?php elseif (!parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $front[0]["id"]), true))["other"]): ?> + <?php elseif (!parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $front[0]["id"] . ".json"), true))["other"]): ?> <div class="alert alert-warning"> <?php @@ -217,28 +217,28 @@ if (!isset($school[$day])) { <p><?= $_PROFILE["login"] === "raindrops" ? "These ponies will have sex with " . $app["other"]["name"] : "These ponies will have sex with you" ?>:</p> <ul> - <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === "gdapd" && $pony["_metadata"]["other"]): ?> + <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === "gdapd" && isset($pony["_metadata"]["other"]) && $pony["_metadata"]["other"]): ?> <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a> (<?= $pony["_metadata"]["sexually_active"] ? "no consent is required" : "consent is mandatory" ?>)</li> <?php endif; endforeach; ?> </ul> <p><?= $_PROFILE["login"] === "raindrops" ? "These ponies may have sex with " . $app["other"]["name"] . " but are unsure about it" : "These ponies may have sex with you but are unsure about it" ?>:</p> <ul> - <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === "gdapd" && $pony["_metadata"]["other2"]): ?> + <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === "gdapd" && isset($pony["_metadata"]["other2"]) && $pony["_metadata"]["other2"]): ?> <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li> <?php endif; endforeach; ?> </ul> <p><?= $_PROFILE["login"] === "raindrops" ? "These ponies will have sex with you" : "These ponies will have sex with Raindrops" ?>:</p> <ul> - <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === $app["other"]["id"] && $pony["_metadata"]["other3"]): ?> + <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === $app["other"]["id"] && isset($pony["_metadata"]["other3"]) && $pony["_metadata"]["other3"]): ?> <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li> <?php endif; endforeach; ?> </ul> <p><?= $_PROFILE["login"] === "raindrops" ? "These ponies may have sex with you but are unsure about it" : "These ponies may have sex with Raindrops but are unsure about it" ?>:</p> <ul> - <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === $app["other"]["id"] && $pony["_metadata"]["other4"]): ?> + <?php foreach (scoreOrderGlobal() as $pony): if ($pony["system"] === $app["other"]["id"] && isset($pony["_metadata"]["other4"]) && $pony["_metadata"]["other4"]): ?> <li><a href="/<?= $pony["name"] ?>"><?= $pony["display_name"] ?? $pony["name"] ?></a></li> <?php endif; endforeach; ?> </ul> diff --git a/includes/flags.json b/includes/flags.json index 9d21e1f..d11fd54 100644 --- a/includes/flags.json +++ b/includes/flags.json @@ -7,7 +7,7 @@ "protector": "!!Protector", "leader": "Leader", - "fictive": "!!Fictive (Equestria)", + "fictive": "!!Equestrian", "fictive2": "Fictive (Celeste)", "sexual_features": "Enable sexual features (for ponies below 16)", "sexually_active": "!!Preemptive sexual consent", diff --git a/includes/fragments/member.inc b/includes/fragments/member.inc index 1db0dd2..476b748 100644 --- a/includes/fragments/member.inc +++ b/includes/fragments/member.inc @@ -13,7 +13,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)); - if ($metadata["private"] && !$isLoggedIn && !$isLowerLoggedIn) { + if (isset($metadata["private"]) && $metadata["private"] && !$isLoggedIn && !$isLowerLoggedIn) { peh_error("Page not found: " . strip_tags($member), 404); } } diff --git a/includes/fragments/metadata.inc b/includes/fragments/metadata.inc index cd022df..38317ce 100644 --- a/includes/fragments/metadata.inc +++ b/includes/fragments/metadata.inc @@ -95,14 +95,14 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member </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='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%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> - <option <?= $metadata["species"][1] === "merpony" ? "selected" : "" ?> value="merpony">Merpony</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> + <option <?= ($metadata["species"][1] ?? "") === "merpony" ? "selected" : "" ?> value="merpony">Merpony</option> </select> </div> </div> @@ -292,7 +292,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member <b><?= $relations[1] ?></b><br> <input name="<?= $relations[0] ?>" type="hidden" value="<?= implode(", ", $metadata[$relations[0]] ?? []) ?>"> <span id="<?= $relations[0] ?>-list"></span> - <a style="margin-top: 4px;" class="btn btn-secondary" onclick="openAddDialog('<?= $relations[0] ?>', '<?= $relations[2] ?>')">+</a> + <a style="margin-top: 4px;" class="btn btn-secondary" onclick="openAddDialog('<?= $relations[0] ?>', '<?= $relations[2] ?? '' ?>')">+</a> <script> update('<?= $relations[0] ?>'); </script> @@ -331,7 +331,7 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member <input <?= $metadata[$id] ? "checked" : "" ?> class="form-check-input" type="checkbox" name="flags[<?= $id ?>]"> <?= str_replace("%other%", $app["other"]["name"], str_starts_with($name, "!!") ? substr($name, 2) : (str_starts_with($name, "#") ? substr($name, 1) : $name)) ?> </label><br> - <?php endif; else: foreach ($name as $id2 => $name2): if (!is_array($name2) && !is_null($name2)): if (($systemID === $app["other"]["id"] && str_starts_with($name2, "!!")) || ($systemID !== $app["other"]["id"] && !str_starts_with($name2, "#"))): ?> + <?php endif; else: foreach ($name ?? [] as $id2 => $name2): if (!is_array($name2) && !is_null($name2)): if (($systemID === $app["other"]["id"] && str_starts_with($name2, "!!")) || ($systemID !== $app["other"]["id"] && !str_starts_with($name2, "#"))): ?> <label style="margin-bottom:5px;"> <input <?= $metadata[$id][$id2] ? "checked" : "" ?> class="form-check-input" type="checkbox" name="flags[<?= $id ?>][<?= $id2 ?>]"> <?= str_replace("%other%", $app["other"]["name"], str_starts_with($name2, "!!") ? substr($name2, 2) : $name2) ?> diff --git a/includes/fragments/system.inc b/includes/fragments/system.inc index 030c743..ad7db76 100644 --- a/includes/fragments/system.inc +++ b/includes/fragments/system.inc @@ -20,7 +20,7 @@ <br> <div id="page-content"> - <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/content.html") ?> + <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/content.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/content.html") : "" ?> </div> <?php if ($system === "cloudburst") cloudburst(true); elseif ($system === "raindrops") raindrops(true); elseif ($isLoggedIn || $isLowerLoggedIn) other(true); ?> </div> diff --git a/includes/util/banner.inc b/includes/util/banner.inc index 388e4b1..6c6b128 100644 --- a/includes/util/banner.inc +++ b/includes/util/banner.inc @@ -292,7 +292,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $badges[] = [ "id" => "fictive", "color" => "info", - "html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Fictive</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' based on the personality, look and behavior of a character that is from Equestria." class="badge rounded-pill bg-info" style="height: 24px;"><img style="width: 16px;" src="/assets/logo/equestria.png"><span style="vertical-align: middle;"> Fictive</span></span>' + "html" => '<span data-bs-toggle="tooltip" data-bs-html="true" title="<b>Equestrian</b><br>' . ucfirst(getMemberPronouns($member['pronouns'])["subjective"]) . ' ' . (getMemberPronouns($member['pronouns'])["third"] ? "is" : "are") . ' based on the personality, look and behavior of a character that is from Equestria." class="badge rounded-pill bg-info" style="height: 24px;"><img style="width: 16px;" src="/assets/logo/equestria.png"><span style="vertical-align: middle;"> Equestrian</span></span>' ]; } @@ -368,7 +368,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { ]; } - if (($isLoggedIn || $isLowerLoggedIn) && $metadata["alcohol"] !== null && $metadata["alcohol"] !== false) { + if (($isLoggedIn || $isLowerLoggedIn) && isset($metadata["alcohol"]) && $metadata["alcohol"] !== false) { $badges[] = [ "id" => "alcohol", "color" => "secondary", |