From 8f5adf5d7f091873aebccb5f509f7ce5c7ff73d1 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Wed, 15 Nov 2023 14:10:50 +0100 Subject: [PATCH] test --- matchinfo.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/matchinfo.php b/matchinfo.php index 2f8565f..e92afbc 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -60,21 +60,21 @@ $lastMatches = array_slice($allMatches, 0, 8); $matchId = $_GET['matchid']; $filename = "data/matches/" . $matchId . ".json"; - $directory = 'data/killstats/'; - $prefix = $matchdata['id']; - $files = glob($directory . $prefix . '*'); - echo $prefix; - echo $directory; - echo $files; - foreach ($files as $file) { - echo $file . "\n"; - } + // Check if the JSON file for the given match ID exists if (file_exists($filename)) { // Read and decode the JSON file $jsonData = json_decode(file_get_contents($filename), true); $matchinfo = $jsonData['data']['attributes']; $matchdata = $jsonData['data']; + + $directory = 'data/killstats/'; + $prefix = $matchdata['id']; + $files = glob($directory . $prefix . '*'); + foreach ($files as $file) { + echo $file . "\n"; + } + echo ""; echo ""; echo "";
matchTypegameModedurationmapNamecreatedAtid
" . htmlspecialchars($matchinfo['matchType']) . "