function getDirectoryTree($dir=".") { if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if(is_dir($file) && ($file != "." && $file != ".." && $file != "cgi-bin")) {$returnarray[] = $file;} } closedir($dh); } } return $returnarray; } function getFileTree($dir=".") { if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if(!is_dir($file)) {$returnarray[] = $file;} } closedir($dh); } } return $returnarray; } function photoDirSelector() { $photoDirSelector .= ''; return $photoDirSelector; } function photoPageSelector($album,$page) { $photoPageSelector = ''; $files = getFileTree("./picture/".$album."/"); for($i=0;$i < round(count($files)/18);$i++) { if(($i+1) == $page) {$photoPageSelector .= '';} else {$photoPageSelector .= '';} } $photoPageSelector .= ''; return $photoPageSelector; } function photoAlbum($album,$page=1) { $photoAlbum = null; $files = getFileTree("./picture/".$album); if($files == null) {exit;} $c = 0; if($page == 0) {$page++;} if((round(count($files)/18)) < $page) {$page = 1;} $start = (18 * $page) - 18; $stop = (18 * $page); $i = 0; $photoAlbum .= "
|
';
$c++;
}
$i++;
}
$photoAlbum .= "