Update homepage pledge image rotation for federal.

This commit is contained in:
Kim Taylor
2025-04-13 13:36:50 +10:00
parent 1735d52781
commit d8684760e5
2 changed files with 3 additions and 3 deletions

View File

@@ -15,11 +15,11 @@ $candidate_data = parse_pledge_data(explode(" ", $candidates_files), null);
/* Select people who have taken the pledge (and have an image) */
$pledgeCandidates = array_filter($candidate_data, function ($candidate) {
return $candidate['Pledge'] === 'y' && $candidate['Picture'] !== "";
return $candidate['Pledge'] === 'Yes' && $candidate['Picture'] !== "";
});
/* Select 9 random candidates */
$pledgeKeys = array_rand($pledgeCandidates, 9);
$pledgeKeys = array_rand($pledgeCandidates, min(count($pledgeCandidates), 9));
shuffle($pledgeKeys);
$i = 0;