Folders ";
echo "These are the current folders in my photo album. Each folder here contains photos all seperated by groups. For example in the Animal folder you will find 2
folders, one with my cat Lily's photos and another with my sisters cat Pup's photos ";
while ($f = readdir($dir)) {
$file_list[] = $f;
}
natcasesort($file_list);
$sidecount = 0;
echo "";
foreach ($file_list as $filename) {
if (!eregi(".jpg",$filename) && $filename!=='.' && $filename!=='..' && $filename!=='photoWindow.php' && $filename!=='PhotoAlbum.php' && $filename!=='Thumbnails' && $filename!=='test.php'){ #if does not match .jpg . and ..
$filepath = $filename . "/" . $filename . ".txt";
$handle = fopen($filepath, "r");
$contents = fread($handle, filesize($filepath));
fclose($handle);
// This displays the images in a table of 5 images in a row
if ($sidecount == "0"){
echo "";
echo "|
| ";
$sidecount = 1;
}elseif ($sidecount == "1"){
echo "
| ";
$sidecount = 2;
}elseif ($sidecount == "2"){
echo "
| ";
$sidecount = 3;
}else{
echo "
| ";
echo " ";
$sidecount = 0;
}
}
}
echo " ";
}
if ($subcatagory <> "") {
$file_list = array();
//$d="photo_album/" . $subcatagory;
$d = $subcatagory;
$files=array();
$dir = opendir($d);
echo "";
echo "";
echo "";
while ($f = readdir($dir)) {
$file_list[] = $f;
}
natcasesort($file_list);
echo " ";
echo "";
foreach ($file_list as $filename) {
if (!eregi("\.jpg",$filename) && $filename!=='.' && $filename!=='..' && $filename!=='explain.txt' && !eregi("\.txt",$filename)) {
echo "
|
$filename | ";
}
}
echo " ";
echo " | ";
if ($folder <> "") {
if ($page == "") {
$page = "Page_1";
}
$file_list = array();
//$d = dir($catagory . "/" . $subcatagory . "/" . $folder . "/" . $page);
$d = dir($subcatagory . "/" . $folder . "/" . $page);
$total =-2;
$sidecount = 0;
$totalsize = 0;
$pageSplit = explode("_",$page);
echo "
|
-Your Viewing Page $pageSplit[1] -
|
";
echo "";
while($entry=$d->read()) {
$file_list[] = $entry;
}
natcasesort($file_list);
foreach ($file_list as $entry) {
$total += 1;
//$size = filesize($catagory . "/" . $subcatagory . "/" . $folder . "/" . $page . "/" . $entry);
//$size = filesize( $subcatagory . "/" . $folder . "/" . $page . "/" . $entry);
//$totalsize += $size;
$pieces = explode(".", $entry);
// This line will make the program only display the JPEG files in the folder
if ($pieces[1] == "jpg") {
// This line will make sure only the images for the catagory asked for are showm
$fullname = explode("-", $pieces[0]);
$splitTitle = explode("_", $fullname[0]);
// This displays the images in a table of 5 images in a row
if ($sidecount == "0"){
echo "";
echo "
$splitTitle[0]
$splitTitle[1]
$splitTitle[2]
New Window
| ";
$sidecount = 1;
}elseif ($sidecount == "1"){
echo "$splitTitle[0] $splitTitle[1] $splitTitle[2] | ";
$sidecount = 2;
}elseif ($sidecount == "2"){
echo "$splitTitle[0] $splitTitle[1] $splitTitle[2] | ";
$sidecount = 3;
}elseif ($sidecount == "3"){
echo "$splitTitle[0] $splitTitle[1] $splitTitle[2] | ";
$sidecount = 4;
}else{
echo "$splitTitle[0] $splitTitle[1] $splitTitle[2] | ";
echo " ";
$sidecount = 0;
}
}
}
$total -= 2;
echo " ";
if ($page <> "") {
$file_list1 = array();
$d= $subcatagory . "/" . $folder;
$files=array();
$dir = opendir($d);
echo "
|
";
while ($g = readdir($dir)) {
$file_list1[] = $g;
}
$counttemp = 0;
natcasesort($file_list1);
foreach ($file_list1 as $filename1) {
if (!eregi("\.jpg",$filename1) && $filename1!=='.' && $filename1!=='..' && $filename1!=='include_file.php'){ #if does not match .jpg . and ..
$counttemp = $counttemp + 1;
$pageTemp = explode("_",$filename1);
echo "" . $pageTemp[1] . "";
if ($counttemp <> count($file_list1) - 2) {
echo " | ";
}
}
}
echo " | ";
}
echo " | ";
//$d->close();
}else
$filename = $subcatagory . "/Explain.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo "$contents |