diff options
Diffstat (limited to 'includes/search.inc')
-rw-r--r-- | includes/search.inc | 11 |
1 files changed, 7 insertions, 4 deletions
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 [ |