From da0bfd73acda78120b1bcafd40be7992d028c01a Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 28 Jan 2024 09:42:26 +0000 Subject: [PATCH] Enhancement (ASP): Add configuration option to hide ranking of new players --- src/ASP/bf2statistics.php | 8 ++++++++ src/ASP/frontend/views/editconfig.tpl | 9 +++++++++ src/ASP/system/config/config.php | 1 + src/ASP/system/core/Config.php | 1 + 4 files changed, 19 insertions(+) diff --git a/src/ASP/bf2statistics.php b/src/ASP/bf2statistics.php index 5a13731..39b33c7 100644 --- a/src/ASP/bf2statistics.php +++ b/src/ASP/bf2statistics.php @@ -397,6 +397,13 @@ if(empty($country)) $country = 'xx'; + $hidden = ''; + if (Config::Get('stats_hide_new_players')) { + $hidden .= ', hidden = 1'; + }else { + $hidden .= ', hidden = 0'; + } + // Insert information $query = "INSERT INTO player SET id = " . $data["pID_$x"] . ", @@ -445,6 +452,7 @@ mode1 = " . $globals['mode1'] .", mode2 = " . $globals['mode2'] .", isbot = ". $data["ai_$x"] ." + $hidden "; $result = $DB->exec( $query ); checkQueryResult($result, $query, $DB); diff --git a/src/ASP/frontend/views/editconfig.tpl b/src/ASP/frontend/views/editconfig.tpl index b2e6f51..680590a 100644 --- a/src/ASP/frontend/views/editconfig.tpl +++ b/src/ASP/frontend/views/editconfig.tpl @@ -61,6 +61,15 @@ +
+ +
+ +
+
diff --git a/src/ASP/system/config/config.php b/src/ASP/system/config/config.php index 4db3d11..ea63e2a 100644 --- a/src/ASP/system/config/config.php +++ b/src/ASP/system/config/config.php @@ -18,6 +18,7 @@ $admin_backup_ext = '.bak'; $admin_ignore_ai = 0; $stats_ignore_ai = 0; +$stats_hide_new_players = false; $stats_min_game_time = 0; $stats_min_player_game_time = 0; $stats_players_min = 1; diff --git a/src/ASP/system/core/Config.php b/src/ASP/system/core/Config.php index 089ccec..28c1362 100644 --- a/src/ASP/system/core/Config.php +++ b/src/ASP/system/core/Config.php @@ -70,6 +70,7 @@ private static function getDefault() 'admin_backup_ext' => '.bak', 'admin_ignore_ai' => 0, 'stats_ignore_ai' => 0, + 'stats_hide_new_players' => false, 'stats_min_game_time' => 0, 'stats_min_player_game_time' => 0, 'stats_players_min' => 1,