SELECT AN ALBUM
$val)
{
if (chr($i)=='/')
{
$root_dir = substr($local['path'],1);
for ($j=1;$j<$val;$j++)
$root_dir='../'.$root_dir;
}
}
if (strpos($root_dir,$local['path'])===0)
{
$root_dir = ".";
}
}
// scanning directory for folders and check if they contain image files
if (!is_dir($root_dir))
{
printError("Couldn't find a root directory. Please specify a valid directory in EasyGallery.php.");
}
$root_handle = opendir($root_dir);
while ($dirname = readdir($root_handle))
{
$var1 = strcmp($dirname,'.');
$var2 = strcmp($dirname,'..');
$var3 = is_dir($root_dir.'/'.$dirname);
if (($var1!=0) && ($var2!=0) && ($var3==1))
{
$dir_handle = opendir($root_dir.'/'.$dirname);
$postmp = 0;
while ($filename = readdir($dir_handle))
{
for ($i=0;$i0)
{
$folders[] = $root_dir.'/'.$dirname;
break 2;
}
}
}
closedir($dir_handle);
}
}
if (!$folders)
{
printError("Searched folders don't contain any image! Please change the \$root_dir.");
}
// !!! if you don't want your folders in reverse order change rsort() to sort()
rsort($folders);
// set initial variable $ordner
if (!isset($ordner))
$ordner = $folders[0];
// scanning directories for image files
if (is_dir($ordner)){
$dir_handle = opendir($ordner);
while ($filename = readdir($dir_handle))
{
for ($i=0; $i 0))
{
$files[] = $filename;
}
if ($filename=="thumbnails")
{
$thumbs = 1;
}
}
}
sort($files);
$size = sizeof($files);
closedir($dir_handle);
closedir($root_handle);
}
else
{
printError("No Folders found. Please copy your image folders to the location specified in the \$root_dir in EasyGallery.php.");
}
// --end preprocessing
?>
\n";
echo "\n";
echo "
\n";
// --end form
// --begin print images
echo "
\n";
?>