| @@ 101-113 (lines=13) @@ | ||
| 98 | * @return mixed |
|
| 99 | */ |
|
| 100 | ////Char ID to name via CCP |
|
| 101 | function characterName($characterID) |
|
| 102 | { |
|
| 103 | $character = characterDetails($characterID); |
|
| 104 | $name = (string)$character['name']; |
|
| 105 | if (null === $name || '' === $name) { // Make sure it's always set. |
|
| 106 | $url = "https://api.eveonline.com/eve/CharacterName.xml.aspx?ids={$characterID}"; |
|
| 107 | $xml = makeApiRequest($url); |
|
| 108 | foreach ($xml->result->rowset->row as $entity) { |
|
| 109 | $name = $entity->attributes()->name; |
|
| 110 | } |
|
| 111 | } |
|
| 112 | return $name; |
|
| 113 | } |
|
| 114 | ||
| 115 | /** |
|
| 116 | * @param string $characterName |
|
| @@ 230-243 (lines=14) @@ | ||
| 227 | * @return mixed |
|
| 228 | */ |
|
| 229 | ////Corp ID to name via CCP |
|
| 230 | function corpName($corpID) |
|
| 231 | { |
|
| 232 | $corporation = corpDetails($corpID); |
|
| 233 | $name = (string)$corporation['corporation_name']; |
|
| 234 | if (null === $name || '' === $name) { // Make sure it's always set. |
|
| 235 | $url = "https://api.eveonline.com/eve/CharacterName.xml.aspx?ids={$corpID}"; |
|
| 236 | $xml = makeApiRequest($url); |
|
| 237 | foreach ($xml->result->rowset->row as $entity) { |
|
| 238 | $name = $entity->attributes()->name; |
|
| 239 | } |
|
| 240 | } |
|
| 241 | ||
| 242 | return $name; |
|
| 243 | } |
|
| 244 | ||
| 245 | /** |
|
| 246 | * @param string $corpID |
|