function getPilotData($pilotID, $scoutID = 0) { if (!isset($pilotID) || !is_numeric($pilotID)) { return; } $pilot = new Pilot($pilotID); $pilot->exists(); //required for r604 to r1027 edk code (also including up to 3.1.5 releases) $corp = $pilot->getCorp(); $corpID = $corp->getID(); $alliance = $corp->getAlliance(); $allianceID = $alliance->getID(); $pilotName = $pilot->getName(); $corpName = $corp->getName(); $allianceName = $alliance->getName(); $img = $pilot->getPortraitURL(64); return array('pilotid' => $pilotID, 'scoutid' => $scoutID, 'pilotname' => $pilotName, 'corp' => $corpName, 'corpid' => $corpID, 'alliance' => $allianceName, 'allianceid' => $allianceID, 'pilotimg' => $img, 'killid' => $this->killID_); }
$plt_id = $pilot->getID(); } } } } if (!$plt_ext_id) { $plt_ext_id = $pilot->getExternalID(); } // If we still don't have an external ID then just use the internal for names. if (!$plt_ext_id) { $plt_ext_id = $plt_id; } if (!$pilot->exists()) { errorPic('That pilot doesnt exist.'); } $corp = $pilot->getCorp(); $alliance = $corp->getAlliance(); // we dont generate pictures for non-members if (array_search($alliance->getID(), config::get('cfg_allianceid')) === false && !array_search($corp->getID(), config::get('cfg_corpid')) === false && !array_search($pilot->getID(), config::get('cfg_pilotid')) === false) { errorPic('Invalid pilot'); } $id = abs(crc32($sig_name)); // check for cached version if (file_exists(CacheHandler::exists("{$plt_ext_id}_sig_{$id}.jpg", 'img'))) { // cache files for 120 minutes if (time() - CacheHandler::age("{$plt_ext_id}_sig_{$id}.jpg", 'img') < 120 * 60 || lastKill($plt_id) > 120 * 60) { if (isset($_SERVER['HTTP_IF_NONE_MATCH']) || isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { header($_SERVER["SERVER_PROTOCOL"] . " 304 Not Modified"); die; } else { header('Content-Type: image/jpeg');