There is a very basic way of making a page to display images inside of a folder. You can setup individual folders to contain a set number of images or a set category of images.
Adding the following code will seek all images stored in the selected folder and and list the in order of last modified date. No method of ordering them otherwise with the following code.
Create a page and call it "Gallery_Images.php".
Add the following code to this page.
<?php
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n";
$rowcnt = 0;
$dirpath = opendir($directory_name);
while (false !== ($file = readdir($dirpath))) {
if ($file != "." && $file != "..") {
$path = "$directory_name/$file";
$file = basename($path);
if ($rowcnt == 0) { echo "<tr>\n"; }
if ($rowcnt == 4) { echo "<tr>\n"; }
if ($rowcnt == 8) { echo "<tr>\n"; }
if ($rowcnt == 12) { echo "<tr>\n"; }
if ($rowcnt == 16) { echo "<tr>\n"; }
if ($rowcnt == 20) { echo "<tr>\n"; }
if ($rowcnt == 14) { echo "<tr>\n"; }
if ($rowcnt == 28) { echo "<tr>\n"; }
if ($rowcnt == 32) { echo "<tr>\n"; }
if ($rowcnt == 36) { echo "<tr>\n"; }
if ($rowcnt == 40) { echo "<tr>\n"; }
echo "<td valign=\"top\"><a href=\"#\" onclick=\"window.open('$directory_name/$file','','width=750,height=550,scrollbars=yes,resizable')\"><img src=\"$directory_name/$file\" width=\"150\" border=\"0\"></a></td>\n";
echo "<td width=\"10\"></td>\n";
$rowcnt = $rowcnt + 1;
}
}
closedir($dirpath);
echo "<table>\n";
?>
For your gallery links, use the following URL.
Gallery_Images.php?directory_name=NameOfFolder
The word NameOfFolder is the accual name of the directory where you have your images stored. You can create as many URLs as you need using this method such as:
<a href="Gallery_Images.php?directory_name=Family">Family</a>
<a href="Gallery_Images.php?directory_name=Video_Games">Video Games</a>
<a href="Gallery_Images.php?directory_name=Vacations">Vacations</a>
View link to see this code in action:
http://206.124.138.203/st/Image.php?directory_name=Images