I wound up doing this, but I don't trust the code:
function hasImages($album) { // BOOLEAN METHOD
// DETERMINE IF ALBUM HAS IMAGES OR NOT
global $imageLocationPath;
if (!is_dir("$imageLocationPath/$album") || !$album) return false;
$dirID = @opendir("$imageLocationPath/$album");
while (($fyl = @readdir($dirID))) {
if (is_file("$imageLocationPath/$album/$fyl") && !preg_match('/^\.+$/i', trim($fyl))) {
@closedir($dirID);
return true;
break;
}
}
return false;
}
I don't trust it unless someone can convince me that a while loop within a directory containing a potential 500 - 1000 50K - 100K of images won't be slow. 🙁
Phil