From 4540543d8099ce2ef31a7c4fc394fe555fc5d505 Mon Sep 17 00:00:00 2001 From: Rick Date: Sun, 19 Jul 2020 01:42:11 +0200 Subject: [PATCH] =?UTF-8?q?Patch=20bug=20compte=20priv=C3=A9=20&=20modific?= =?UTF-8?q?ations=20affichage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modification de l’affichage avec Aucun compte chargé Modification de l’appuie de la touche entrée dans le champ d’instertion (#3) --- getAchievements.php | 7 ++++--- getinformations.js | 2 +- index.html | 14 ++++++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/getAchievements.php b/getAchievements.php index cadcd26..659b935 100644 --- a/getAchievements.php +++ b/getAchievements.php @@ -5,7 +5,7 @@ Application web pour voir la durée pour finir à 100% des jeux de son compte st author: rick@gnous.eu git: https://git.gnous.eu/Rick/triAchievements -version: 1.0.1 +version: 1.0.2 */ // ~ 4 minutes pour ~ 350 jeux @@ -117,10 +117,11 @@ if (isset($_POST['steamid'])) { $steamid = $_POST['steamid']; $url = "http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=".API_KEY."&steamid=".$steamid; $listGames = file_get_contents($url); + $responseListGames = json_decode($listGames, true)["response"]; if ($listGames == NULL) { $ret = array('error' => 'User not found.', 'response' => $http_response_header); - } elseif (empty($listGames["response"])) { - $ret = array('error' => 'Private Account.', 'response' => $http_response_header); + } elseif (empty($responseListGames)) { + $ret = array('error' => 'Private Account.', 'response' => $http_response_header, 'test' => $listGames); } else { $url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".API_KEY."&steamids=".$steamid; $userInformations = getJson($url); diff --git a/getinformations.js b/getinformations.js index 2c53b06..b38d2a1 100644 --- a/getinformations.js +++ b/getinformations.js @@ -26,7 +26,7 @@ function makeArray(jsonData) { error.appendChild(text); bigbox.appendChild(error); } else { - document.getElementById("username").innerHTML = jsonData["username"]; + document.getElementById("username").innerHTML = "Compte de " + jsonData["username"]; jsonData["gameWithTime"].sort((a, b) => parseFloat(a.hours) - parseFloat(b.hours)); makeHtml(jsonData["gameWithTime"]); makeHtml(jsonData["gameWithoutTime"]); diff --git a/index.html b/index.html index 8c1121c..48504df 100644 --- a/index.html +++ b/index.html @@ -13,10 +13,10 @@
- +
-

Compte de

+

Aucun compte chargé

@@ -31,5 +31,15 @@ + \ No newline at end of file