Galleries

"; #Show the random thumbnail. Make a text link. # End the link. End the cell. Do it again. echo "\"random
$file
"; } } else { #If thumbnails don't exist for this gallery yet display the nothumb image. #Start cell. Link to the gallery directory. echo ""; #Don't like the no thumbnail image displaying until you visit a gallery? #Comment out the 2 above echos and uncomment the one below to just show a text #link to the gallery. #If thumbnails don't exist for this gallery yet. Just display a text link. #Start cell. Link to the gallery directory. Close link. Close cell. //echo ""; } #Increase the known amount of sub-folders. This is needed so we can build the #table correctly. $dircount +=1; #If the number of folders is now divisible by the number of columns you want #in the table (without leaving a remainder) end the table row and start a new #one. The final remainders will also be shown, the row just won't be full. if ( $dircount % $cols == 0 ) { echo ""; } #End the processing of just folders. } #End the while. We've looked at all the files. } #End the table and the page #NOTE: #We need to create one extra empty cell in order to meet XHTML spec. If the #number of table columns and the amount of images divide evenly there will be #one extra row containing just one empty cell after all the even rows of #images. If the last row is not full of images (there should be at least one #empty column) an additional empty cell will be added. Note: We need to do #this because XHTML spec does not allow empty table rows () and #otherwise the even divides would create this situation. echo "
"; #Show the nothumb image. Make a text link. End the link. End the cell. echo "\"no
$file
$file
"; #If we couldn't open the directory complain. Note: This should never be #displayed since this file is in the directory as well. #If you were unable to open the directory at all you would likely see a web #server Forbidden message. } else { echo " Simple Gallery: Error

Simple Gallery: Error

I was unable to open the directory that holds the galleries. Permissions??

"; } #Close directory closedir ($currentdir); ?>