I’m having some problems creating an automatic image gallery in flash.
I’ve searched the forums and I’m on my way, but I need a bit more help I’m afraid.
Here’s the situation. I have a flash site where I want the ‘images’ section to contain several galleries.
So in a directory ‘images’ I’ll have several subdirs, say ‘gallery1’ and ‘gallery2’.
Within each of these subdirs I’ll have the pictures and yet another subdir ‘thumbs’ that obviously will contain the thumbnails that will load into flash.
How would I go about with my PHP script, so that it returns the names of the different galleries and also the amount of thumbnails per gallery?
Would I have to get everything into an array in PHP and then return this array to Flash? But how exactly?
atm I have the following:
<?php
function getGalleries($path = "."){
if ($dir = @opendir($path)){
while(false !== ($file = readdir($dir))){
if(("." == $file) || (".." == $file))
continue;
if(is_dir($path."/".$file)) {
$gallery[] = $file;
}
}
}
closedir($dir);
echo print_r($gallery);
$numGalleries = count($gallery);
echo "<BR>Total number of galleries: ".$numGalleries."<BR>";
}
getGalleries('images');
?>
but from here I’m a bit stuck so any help is appreciated.
Cheers.