diff options
author | Minteck <contact@minteck.org> | 2023-02-22 22:06:58 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-22 22:06:58 +0100 |
commit | 6563d542af0930ebb6b2f9b71f2b7538d7467665 (patch) | |
tree | 2d0c1f34382ab3c1fc4a7422cc87be2a5714356e /includes | |
parent | 737f5008f8a4a011c832e83f6b2019d3dc27dbd0 (diff) | |
download | pluralconnect-6563d542af0930ebb6b2f9b71f2b7538d7467665.tar.gz pluralconnect-6563d542af0930ebb6b2f9b71f2b7538d7467665.tar.bz2 pluralconnect-6563d542af0930ebb6b2f9b71f2b7538d7467665.zip |
Updated 8 files (automated)
Diffstat (limited to 'includes')
-rw-r--r-- | includes/functions.inc | 2 | ||||
-rw-r--r-- | includes/search.inc | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/includes/functions.inc b/includes/functions.inc index 1345db1..9bc9ba6 100644 --- a/includes/functions.inc +++ b/includes/functions.inc @@ -303,7 +303,7 @@ if (!function_exists("showSystem")) { $i["system"] = $id; $i["equestria"] = $travelling[$i['id']]['travelling'] && $travelling[$i['id']]['equestria']; return $i; - }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/members.json"), true), function ($i) use ($travelling) { + }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . (isset($app["other"]) && $id === $app["other"]["id"] ? "other" : $id) . "/members.json"), true), function ($i) use ($travelling) { return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria'])); })), ...array_map(function ($i) use ($id) { $i["travelling"] = true; diff --git a/includes/search.inc b/includes/search.inc index 0f0a868..ab9d32f 100644 --- a/includes/search.inc +++ b/includes/search.inc @@ -29,10 +29,11 @@ $list = array_values(array_filter(array_map(function ($i) use ($lang) { global $pages; global $isLoggedIn; + global $isLowerLoggedIn; - if (in_array(substr($i, 0, strlen($i) - 4), array_keys($pages)) && $pages[substr($i, 0, strlen($i) - 4)]["admin"] && !$isLoggedIn) { + if (in_array(substr($i, 0, strlen($i) - 4), array_keys($pages)) && $pages[substr($i, 0, strlen($i) - 4)]["admin"] && !((!$pages[substr($i, 0, strlen($i) - 4)]["limited"] && $isLoggedIn) || ($pages[substr($i, 0, strlen($i) - 4)]["limited"] && $isLowerLoggedIn))) { return null; - } else { + } else if (in_array(substr($i, 0, strlen($i) - 4), array_keys($pages))) { return [ 'name' => in_array(substr($i, 0, strlen($i) - 4), array_keys($pages)) ? $pages[substr($i, 0, strlen($i) - 4)]["name"][$lang["_name"]] : substr($i, 0, strlen($i) - 4), 'description' => in_array(substr($i, 0, strlen($i) - 4), array_keys($pages)) ? ($pages[substr($i, 0, strlen($i) - 4)]["short"] ?? $pages[substr($i, 0, strlen($i) - 4)]["name"][$lang["_name"]]) : substr($i, 0, strlen($i) - 4), @@ -40,6 +41,8 @@ 'icon' => "/assets/icons/" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/icons/" . substr($i, 0, strlen($i) - 4) . ".svg") ? substr($i, 0, strlen($i) - 4) : "") . ".svg", 'invert' => true ]; + } else { + return null; } }, $base), function ($i) { return isset($i); @@ -104,7 +107,7 @@ global $isLoggedIn; - if ($isLoggedIn) { + if (false && $isLoggedIn) { $base = array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true)); $list = array_map(function ($i) { return [ @@ -144,7 +147,7 @@ global $isLoggedIn; - if ($isLoggedIn) { + if (false && $isLoggedIn) { $base = array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true)); $list = array_map(function ($i) { return [ |