From 0f8e8737c0ad492e72236ec89222500773b088a6 Mon Sep 17 00:00:00 2001 From: Jacob Grahn Date: Tue, 10 Sep 2024 17:00:39 -0400 Subject: [PATCH] lint --- common/queries/campaigns.php | 3 +-- functions/http_fns/output_fns.php | 3 --- functions/http_fns/pages/player_search_fns.php | 1 - functions/http_fns/query_fns.php | 2 +- http_server/delete_level.php | 2 +- http_server/upload_level.php | 2 +- 6 files changed, 4 insertions(+), 9 deletions(-) diff --git a/common/queries/campaigns.php b/common/queries/campaigns.php index dd844eaab..2f7f0d86c 100644 --- a/common/queries/campaigns.php +++ b/common/queries/campaigns.php @@ -62,9 +62,8 @@ function campaign_update($pdo, $campaign_id, $levels) throw new Exception('Nine levels must be specified.'); } - foreach ($levels as $key => $data) { + foreach ($levels as $key => $level) { $level_num = $key + 1; - $level = $levels[$key]; // sanity: all info present? if (empty($level->level_id) || empty($level->prize_type) || empty($level->prize_id)) { diff --git a/functions/http_fns/output_fns.php b/functions/http_fns/output_fns.php index 11f02c803..ef3b90e80 100644 --- a/functions/http_fns/output_fns.php +++ b/functions/http_fns/output_fns.php @@ -152,7 +152,4 @@ function output_error_page($message, $staff = null, $page_title = 'Error') output_header($page_title, $mod, $admin); $error = htmlspecialchars($message, ENT_QUOTES); echo !empty($error) ? "Error: $error

<- Go Back" : ''; - if ($footer) { - output_footer(); - } } diff --git a/functions/http_fns/pages/player_search_fns.php b/functions/http_fns/pages/player_search_fns.php index fddd960cb..008703d15 100644 --- a/functions/http_fns/pages/player_search_fns.php +++ b/functions/http_fns/pages/player_search_fns.php @@ -65,7 +65,6 @@ function output_page($pdo, $user) // make some variables $group = get_group_info($user); - $name_color = $group->color; $guild_id = (int) $user->guild; // guild id $rank = $user->rank + $user->used_tokens; // rank $hats = count(explode(',', $user->hat_array)) - 1; // hats diff --git a/functions/http_fns/query_fns.php b/functions/http_fns/query_fns.php index c2b076bfc..badbf80c2 100644 --- a/functions/http_fns/query_fns.php +++ b/functions/http_fns/query_fns.php @@ -655,7 +655,7 @@ function moderate_level($pdo, $mod, $level_id, $action = 'unpublish') } -function is_arti_level($pdo, $levels, $level_id) +function is_arti_level($levels, $level_id) { foreach ($levels as $level) { if ($level->level_id == $level_id) { diff --git a/http_server/delete_level.php b/http_server/delete_level.php index 3e2cbec3e..6c775dd42 100644 --- a/http_server/delete_level.php +++ b/http_server/delete_level.php @@ -54,7 +54,7 @@ } // check if this is currently (or will be) the level of the week - if (is_arti_level($pdo, artifact_locations_select($pdo), $level_id)) { + if (is_arti_level(artifact_locations_select($pdo), $level_id)) { $msg = 'Your level could not be deleted because it is or will be the Level of the Week. ' .'Please contact a member of the PR2 Staff Team for more information.'; throw new Exception($msg); diff --git a/http_server/upload_level.php b/http_server/upload_level.php index 9096bf7f5..87f71e1cd 100755 --- a/http_server/upload_level.php +++ b/http_server/upload_level.php @@ -191,7 +191,7 @@ } // check if this is currently (or will be) the level of the week - if (is_arti_level($pdo, artifact_locations_select($pdo), $level->level_id)) { + if (is_arti_level(artifact_locations_select($pdo), $level->level_id)) { $msg = 'Your level could not be modified because it is or will be the Level of the Week. ' .'To save your progress, save this level under a different name. ' .'Please contact a member of the PR2 Staff Team for more information.';