$value) { $path = realpath($dir . DIRECTORY_SEPARATOR . $value); if (is_dir($path) && $value != "." && $value != "..") { $folderTitle = $value; $folderLink = "?folder=" . getActiveFolder() . $value; $folderClass = ""; include("includes/photos/folder_template.php"); $displayedItems++; } } if ($displayedItems == 0) { $placeHolder = "Pas d'autres albums !"; include("includes/photos/place_holder.php"); } } // Get all photos in the specified path function getPhotos($dir) { $dir = "photos/".$dir; $files = scandir($dir); $displayedItems = 0; foreach ($files as $key => $value) { $path = realpath($dir . DIRECTORY_SEPARATOR . $value); if (!is_dir($path)) { $ext = pathinfo($path, PATHINFO_EXTENSION); if ($ext == "bmp" || $ext == "jpg" || $ext == "jpeg" || $ext == "png") { $imageSrc = $dir . $value; $imageId = "photo-" . $displayedItems; include("includes/photos/photo_template.php"); $displayedItems++; } } } if ($displayedItems == 0) { $placeHolder = "Pas de photos ici !"; include("includes/photos/place_holder.php"); } } // Creates buttons representing the actual path for easier navigation function generatePath($dir) { $folders = explode(DIRECTORY_SEPARATOR, $dir); $currentPath = ""; $pathTitle = "Menu"; $pathLink = "?folder="; include("includes/photos/path_template.php"); foreach ($folders as $value) { if ($value != "") { $pathTitle = $value; $currentPath .= $value . DIRECTORY_SEPARATOR; $pathLink = "?folder=" . $currentPath; include("includes/photos/path_template.php"); } } } ?>
Cliquez sur le dossier de votre choix pour afficher les photos
Chemin :
Télécharger l'album