public function getAvailableGames($fetchOptions) { $rVal = array(); $db = XenForo_Application::get('db'); $limitOptions = $this->prepareLimitFetchOptions($fetchOptions); $results = $db->fetchAll($this->limitQueryResults('SELECT game_id, game_name, game_link, game_logo FROM xf_steam_games ORDER BY game_name ASC', $limitOptions['limit'], $limitOptions['offset'])); foreach ($results as $row) { $sHelper = new Steam_Helper_Steam(); $logoFixed = $sHelper->getSteamCDNDomain($row['game_logo']); $rVal[] = array('id' => $row['game_id'], 'name' => $row['game_name'], 'link' => $row['game_link'], 'logo' => $logoFixed); } return $rVal; }
if (!empty($_GET['steamids'])) { /* * Fetch profile data */ $sHelper = new Steam_Helper_Steam(); $steamProfileAPI = $sHelper->getSteamProfileAPI($_GET['steamids']); $fullProfile = $_GET['fullprofile']; $contentJson = $sHelper->getJsonData($steamProfileAPI); $contentDecoded = json_decode($contentJson); if (isset($contentDecoded->response->players)) { foreach ($contentDecoded->response->players as $rows) { /* * Setup CDN on avatar URLs */ $avatarPath = parse_url($rows->avatar); $rows->avatar = $sHelper->getSteamCDNDomain($avatarPath["path"]); /* * Apply game image to SteamProfile and use HTTPS if enabled */ if ($fullProfile == 1 && isset($rows->gameid) && $STEAM_GAMEBANNER > 0) { $appid = $rows->gameid; $steamid64 = $rows->steamid; $steamGamesAPI = $sHelper->getSteamGameAPI($steamid64); $gameInfo = $sHelper->getJsonData($steamGamesAPI); $games_decoded = json_decode($gameInfo); if ($games_decoded !== null) { foreach ($games_decoded->response->games as $rowsgames) { if ($rowsgames->appid == $appid) { if (isset($rowsgames->img_logo_url)) { $logo = $rowsgames->img_logo_url; }