| @@ 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 |
|
| @@ 350-363 (lines=14) @@ | ||
| 347 | * @return mixed |
|
| 348 | */ |
|
| 349 | ////Corp ID to name via CCP |
|
| 350 | function corpName($corpID) |
|
| 351 | { |
|
| 352 | $corporation = corpDetails($corpID); |
|
| 353 | $name = (string) $corporation['corporation_name']; |
|
| 354 | if (null === $name || '' === $name) { // Make sure it's always set. |
|
| 355 | $url = "https://api.eveonline.com/eve/CharacterName.xml.aspx?ids={$corpID}"; |
|
| 356 | $xml = makeApiRequest($url); |
|
| 357 | foreach ($xml->result->rowset->row as $entity) { |
|
| 358 | $name = $entity->attributes()->name; |
|
| 359 | } |
|
| 360 | } |
|
| 361 | ||
| 362 | return $name; |
|
| 363 | } |
|
| 364 | ||
| 365 | /** |
|
| 366 | * @param string $corpID |
|