Image fetch and resize working.
This commit is contained in:
@@ -61,7 +61,9 @@ foreach ($lga_list as $lga) {
|
||||
|
||||
if (count($lga_candidates) === 0) continue;
|
||||
|
||||
$output_file = dirname($lga['config-file'])."/candidates-generic.csv";
|
||||
$dir = dirname($lga['config-file']);
|
||||
$dir_files = scandir($dir);
|
||||
$output_file = $dir."/candidates-generic.csv";
|
||||
|
||||
if (($handle = fopen($output_file, "w")) === FALSE) {
|
||||
error_log('Error opening output file');
|
||||
@@ -74,10 +76,18 @@ foreach ($lga_list as $lga) {
|
||||
}
|
||||
|
||||
foreach ($lga_candidates as $candidate) {
|
||||
/* Add extension to photo hash */
|
||||
foreach ($dir_files as $file) {
|
||||
if (strstr($file, $candidate['Photo'])) {
|
||||
$candidate['Photo'] = $file;
|
||||
}
|
||||
}
|
||||
|
||||
$fields = [
|
||||
$candidate['match_ward'],
|
||||
$candidate['Name'],
|
||||
$candidate['Score'],
|
||||
$candidate['Pledge'],
|
||||
$candidate['Photo'],
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user