summaryrefslogtreecommitdiff
path: root/includes/functions.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/functions.inc')
-rw-r--r--includes/functions.inc25
1 files changed, 7 insertions, 18 deletions
diff --git a/includes/functions.inc b/includes/functions.inc
index d0f8568..5effe5b 100644
--- a/includes/functions.inc
+++ b/includes/functions.inc
@@ -3,6 +3,13 @@
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
+if (!function_exists("peh_error")) {
+ function peh_error($message, $code = 500): void {
+ header("Location: /?em=" . urlencode(base64_encode($message)) . "&ec=" . $code);
+ die();
+ }
+}
+
if (!function_exists("getAsset")) {
function getAsset($systemID, $memberID = null, $type = "avatars") {
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
@@ -268,24 +275,6 @@ if (!function_exists("showMembersFromList")) {
}
}
-if (!function_exists("showSubsystem")) {
- function showSubsystem(array $data, string $parentSystem) {
- $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$parentSystem-$data[source].json"), true);
-
- echo('<!-- ' . $subsystemData["name"] . ' -->
-<div id="hpd-cloudburst" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px;display:grid;grid-template-columns: 1fr;margin-bottom:10px;">');
- echo(' <div style="display:grid;grid-template-columns:repeat(6, 1fr);grid-gap:10px;">');
-
- showMembersFromList(scoreOrder(array_map(function ($i) use ($parentSystem) {
- return getSystemMember($parentSystem, $i);
- }, $data["members"]), $parentSystem));
-
- echo('</div>
-
-</div>');
- }
-}
-
if (!function_exists("prettySize")) {
function prettySize($bytes) {
if ($bytes > 1024) {