From ea00d48be8e7853a51faa9e8f5aec17d459049b1 Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 16 Nov 2023 13:46:42 +0100 Subject: [PATCH 1/7] clanmember page --- clan_stats.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clan_stats.php b/clan_stats.php index 15729b3..2299d13 100644 --- a/clan_stats.php +++ b/clan_stats.php @@ -21,6 +21,8 @@ error_reporting(E_ALL); // Load clan data from claninfo.json $clanInfoPath = './data/claninfo.json'; + $clanmembersfile = './config/clanmembers.json'; + $clanmembers = json_decode(file_get_contents($clanmembersfile), true); if (file_exists($clanInfoPath)) { $clan = json_decode(file_get_contents($clanInfoPath), true); if (isset($clan) && !empty($clan)) { @@ -29,6 +31,10 @@ error_reporting(E_ALL); foreach ($clan as $key => $value) { echo "" . htmlspecialchars($key) . "" . htmlspecialchars($value) . ""; } + foreach ($clanmembers as $value) { + echo "name" . htmlspecialchars($value) . ""; + } + echo ""; } else { echo "

No clan attributes available

"; From 36b11820b7dbd1e1e20e9ff2e19dbd429d8baf2c Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 16 Nov 2023 13:47:03 +0100 Subject: [PATCH 2/7] cleanup --- clan_stats.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/clan_stats.php b/clan_stats.php index 2299d13..4d2e2e8 100644 --- a/clan_stats.php +++ b/clan_stats.php @@ -1,9 +1,3 @@ - - From 5ee4e092e9c5e0bfddb91538c232de90ee0db138 Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 16 Nov 2023 13:49:37 +0100 Subject: [PATCH 3/7] debug --- clan_stats.php | 1 + 1 file changed, 1 insertion(+) diff --git a/clan_stats.php b/clan_stats.php index 4d2e2e8..e473692 100644 --- a/clan_stats.php +++ b/clan_stats.php @@ -17,6 +17,7 @@ $clanInfoPath = './data/claninfo.json'; $clanmembersfile = './config/clanmembers.json'; $clanmembers = json_decode(file_get_contents($clanmembersfile), true); + print_r($clanmembers); if (file_exists($clanInfoPath)) { $clan = json_decode(file_get_contents($clanInfoPath), true); if (isset($clan) && !empty($clan)) { From e393b6e557c24965285f50e980e6cef6b2430dde Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 16 Nov 2023 13:50:09 +0100 Subject: [PATCH 4/7] clanMembers --- clan_stats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clan_stats.php b/clan_stats.php index e473692..ca86c8c 100644 --- a/clan_stats.php +++ b/clan_stats.php @@ -26,7 +26,7 @@ foreach ($clan as $key => $value) { echo "" . htmlspecialchars($key) . "" . htmlspecialchars($value) . ""; } - foreach ($clanmembers as $value) { + foreach ($clanmembers['clanMembers'] as $value) { echo "name" . htmlspecialchars($value) . ""; } From ab5d2bbe7118736b8a47264f962c3f5b17eba62a Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 16 Nov 2023 13:52:36 +0100 Subject: [PATCH 5/7] stats --- config/clanmembers.json | 3 +-- user_stats.php | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config/clanmembers.json b/config/clanmembers.json index 9dfb03b..0b22e50 100644 --- a/config/clanmembers.json +++ b/config/clanmembers.json @@ -10,7 +10,6 @@ "SquadKiller101", "Pettie1972", "HeteKip", - "Shepherders", - "WackyJacky101" + "Shepherders" ] } diff --git a/user_stats.php b/user_stats.php index b9f5406..d2835cc 100644 --- a/user_stats.php +++ b/user_stats.php @@ -21,10 +21,10 @@ error_reporting(E_ALL); $players_data = json_decode(file_get_contents('./data/player_lifetime_data.json'), true); - $selected_mode = isset($_POST['game_mode']) ? $_POST['game_mode'] : 'squad'; + $selected_mode = isset($_GET['game_mode']) ? $_GET['game_mode'] : 'squad'; // Form to select game mode - echo "
+ echo " @@ -35,7 +35,7 @@ error_reporting(E_ALL);

"; // Buttons for each player - echo "
"; + echo ""; foreach ($players_data[$selected_mode] as $player_name => $player_details) { echo ""; @@ -43,7 +43,7 @@ error_reporting(E_ALL); echo ""; echo "

"; - $selected_player = $_POST['selected_player'] ?? array_key_first($players_data[$selected_mode]); + $selected_player = $_GET['selected_player'] ?? array_key_first($players_data[$selected_mode]); // Fetch the player stats based on game mode and selected player if (isset($players_data[$selected_mode][$selected_player])) { From 9e70ea11f8299dcbad9ad1f25488ad304513ad4c Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 16 Nov 2023 13:52:47 +0100 Subject: [PATCH 6/7] printr cleanup --- clan_stats.php | 1 - 1 file changed, 1 deletion(-) diff --git a/clan_stats.php b/clan_stats.php index ca86c8c..5c5a10c 100644 --- a/clan_stats.php +++ b/clan_stats.php @@ -17,7 +17,6 @@ $clanInfoPath = './data/claninfo.json'; $clanmembersfile = './config/clanmembers.json'; $clanmembers = json_decode(file_get_contents($clanmembersfile), true); - print_r($clanmembers); if (file_exists($clanInfoPath)) { $clan = json_decode(file_get_contents($clanInfoPath), true); if (isset($clan) && !empty($clan)) { From ee824a42678481fd1e8482c7a31aa67da7ed978e Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 16 Nov 2023 13:55:12 +0100 Subject: [PATCH 7/7] link --- clan_stats.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/clan_stats.php b/clan_stats.php index 5c5a10c..3e3add7 100644 --- a/clan_stats.php +++ b/clan_stats.php @@ -1,16 +1,17 @@ + - -
- + +
+
-
-
-

Clan Stats

- +
+

Clan Stats

+ " . htmlspecialchars($key) . "" . htmlspecialchars($value) . ""; } foreach ($clanmembers['clanMembers'] as $value) { - echo "name" . htmlspecialchars($value) . ""; + echo "name" . htmlspecialchars($value) . ""; } echo ""; @@ -36,11 +37,12 @@ } else { echo "

Clan info file missing

"; } - ?> -
-
+ ?> + + - + - + + \ No newline at end of file