Hi there - is it possible to change a setting so the images are displayed with the most recent image (by creation date of file) showing first?
Many thanks,
Gwilym
Many thanks,
Gwilym
$images[] = array('filename' => $f);$images[] = array('filename' => $f, 'filemtime' => filemtime($mosConfig_absolute_path.$rootfolder.$_images_dir_."/".$f));foreach ($images as $key => $value) {
$filemtime[$key] = $value['filemtime'];
}
array_multisort($filemtime, SORT_DESC, $images);// read directory
if ($dh = opendir($mosConfig_absolute_path.$rootfolder.$_images_dir_)) {
while (($f = readdir($dh)) !== false) {
if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'gif') || (substr(strtolower($f),-3) == 'png')) {
$noimage++;
$images[] = array('filename' => $f, 'filemtime' => filemtime($mosConfig_absolute_path.$rootfolder.$_images_dir_."/".$f));
}
}
closedir($dh);
}
foreach ($images as $key => $value) {
$filemtime[$key] = $value['filemtime'];
}
array_multisort($filemtime, SORT_DESC, $images);Log in or create an account to reply.