| @@ 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 |
|
| @@ 274-287 (lines=14) @@ | ||
| 271 | * @return mixed |
|
| 272 | */ |
|
| 273 | ////Corp ID to name via CCP |
|
| 274 | function corpName($corpID) |
|
| 275 | { |
|
| 276 | $corporation = corpDetails($corpID); |
|
| 277 | $name = (string)$corporation['corporation_name']; |
|
| 278 | if (null === $name || '' === $name) { // Make sure it's always set. |
|
| 279 | $url = "https://api.eveonline.com/eve/CharacterName.xml.aspx?ids={$corpID}"; |
|
| 280 | $xml = makeApiRequest($url); |
|
| 281 | foreach ($xml->result->rowset->row as $entity) { |
|
| 282 | $name = $entity->attributes()->name; |
|
| 283 | } |
|
| 284 | } |
|
| 285 | ||
| 286 | return $name; |
|
| 287 | } |
|
| 288 | ||
| 289 | /** |
|
| 290 | * @param string $corpID |
|