Landing page shuffles all people who have taken the pledge and uploaded a picture.

This commit is contained in:
Kim Taylor
2024-09-25 14:58:52 +10:00
parent 8543bc1c53
commit decc12f381
2 changed files with 6 additions and 5 deletions

View File

@@ -11,11 +11,11 @@ if (isset($options['candidates-files'])) {
exit(1);
}
$candidate_data = parse_pledge_data(explode(" ", $candidates_files));
$candidate_data = parse_pledge_data(explode(" ", $candidates_files), null);
/* Select people who have taken the pledge */
/* Select people who have taken the pledge (and have an image) */
$pledgeCandidates = array_filter($candidate_data, function ($candidate) {
return $candidate['Pledge'] === 'y';
return $candidate['Pledge'] === 'y' && $candidate['Picture'] !== "";
});
/* Select 9 random candidates */