function labelBOD($entry) { if ($entry->getCustomByName('bodindustryprivatesector') == 'Y' || $entry->getCustomByName('bodacademicresearcheducationsector') == 'Y' || $entry->getCustomByName('bodpublicagenciesnonprofitothersector') == 'Y' || $entry->getCustomByName('bodatlarge') == 'Y' || $entry->getCustomByName('bodpublicseat') == 'Y' || $entry->getCustomByName('bodaffiliateseat') == 'Y' || $entry->getCustomByName('bodsustainingseat') == 'Y') { return ' (B)'; } else { return ''; } } // print order $posts = array('Chair', 'Co-Chair', 'Board Liaison', 'Member', 'Staff'); $a = array(); foreach ($posts as $p) { $a[$p] = array(); } $query->setSpreadsheetQuery($post_col . ' <> ""'); $listFeed = $service->getListFeed($query); foreach ($listFeed->entries as $entry) { $board = labelBOD($entry); array_push($a[(string) $entry->getCustomByName($post_col)], '<a href="mailto:' . $entry->getCustomByName('email') . '">' . $entry->getCustomByName('name') . '</a>' . $board . ', ' . $entry->getCustomByName('institutionorganization')); } foreach ($posts as $p) { if (count($a[$p]) > 0) { $s = ''; if (count($a[$p]) > 1 && $p != 'Staff') { $s = 's'; } echo "<p><em><strong>{$p}{$s}</strong></em><br />"; foreach ($a[$p] as $person) { echo $person . "<br />"; } }