hello,
i have a image gallery script.. and i seem to be having some problems with it.
Quote:
echo "<br>";
$dir_list = Dir_List($base_serverpath);
for ($i = 2; $i < count ($dir_list); $i++)
{
$dirname = $dir_list[$i];
echo "<center><b>Photographs of ";
echo "<a href=\"$PHP_SELF?gallery_name=$dirname\"><font size=3 face=verdana>$dirname</font></a></center>";
}
/*** if there's not a Gallery chosen - chose the first ***/
if (!$gallery_name)
{
$gallery_name = $dirname(2);
}
|
as seen above the script searches for images/directories in its folder and if any image is found in the root directory, it displayes it else it displays the first gallery/folder photos.
this is ok.
but in my scenario, i will not have any photos in the root, all the photos will be in folders.. so i do not want the script to display any/or the 1st folder's photos..
rather i just want it to display the folder names when there is no photos in the root.
i know the it is in the last 4 lines, but i do not know the syntax to do it.
i tried commenting the line where it says galleryname=dirname(2)
but i get a script warning.
can anyone tell me how to do this??
thanks
|