public function getProfileUrl($bLang = true) { // load config $oGpcConfig = GpcConfig::getInstance('get'); // get selected id $sID = $oGpcConfig->getString('id', null); if ($sID == null) { throw new Exception('No profile ID assigned'); } $oSteamID = new SteamID($sID); $sXmlUrl = 'http://steamcommunity.com/'; // choose if we got a numeric id or an alias if (!$oSteamID->isValid()) { // complain about invalid characters, if found if (!preg_match('/^[a-zA-Z0-9-_]+$/', $sID)) { throw new Exception("Invalid profile alias: {$sID}"); } $sXmlUrl .= 'id/' . $sID; } else { $sXmlUrl .= 'profiles/' . $oSteamID->getSteamComID(); } // add xml parameter so we get xml data (hopefully) $sXmlUrl .= '?xml=1'; // get language setting $sLang = $oGpcConfig->getString('lang', null); if (!$bLang || $sLang == null) { // we're done here return $sXmlUrl; } $sLang = strtolower($sLang); if (in_array($sLang, self::$aValidLang)) { // add language parameter $sXmlUrl .= '&l=' . $sLang; } return $sXmlUrl; }