getCommandPositions

(/rs/public/functions.php)

getCommandPositions -- Array containing three arrays of command positions.

Description

array getCommandPositions ($pin)

This function will return an array containing three arrays, named "Fleet", "Wing", and "Squadron".

The array "Fleet" will contain any fleet id's that the member is in the command staff for.

The array "Wing" will contain any wing id's that the member is in the command staff for.

The array "Squadron" will contain any squadron id's that the member is in the command staff for.

It should be noted that command does not filter down for this function. This means that if a member is only in the command staff for one fleet, no values will appear in the wing or squadron arrays, even if the particular wing or squadrons are in the returned fleet.

This function returns an array containing the three aforementioned arrays on failure, but the three arrays will be empty, as if the member has no command positions at all.

Examples

print_r (getCommandPositions (1)) ; /* This yields:

array (
[Fleet] => Array
(
[0] => A
[1] => B
)
[Wing] => Array
(
[0] => C
)
[Squadron] => Array
(
[0] => D
[1] => E
)
)

In the above return array, A through E are integers of the various unit id's the member is in the command staff of.

To get, say, all the squadrons a member commands:

$allPositions = getMemberPositions ($pin) ;
$squadPositions = $allPositions ["Squadron"] ;
foreach ($squadPositions as $squadID)
{
...
}

Related Functions

returnMemberFleets

Dependencies

None.

Function Index