I'm making a photo gallery with folders and subfolders of images. I'd like to not have to put an HTML file in every folder. How can this be done? Here is my PHP:
<?php
$directory = "thumbs/";
$files = glob($directory."*");
$photoCount = 0;
buildStage();
function buildStage() {
global $directory, $files;
foreach($files as $file) {
if(is_dir($file)) showFolder($file);
else showPhotos($directory);
}
}
function showPhotos($imagePath) {
global $photoCount;
$imageFile = glob($imagePath."/*.*");
echo '<img src="'.$imageFile[$photoCount].'" id="thumbPic"
onmouseover="imageOver(this)"
onmouseout="imageOut(this)"
/>'."\n";
$photoCount++;
}
function showFolder($imagePath) {
$imageFile = glob($imagePath."/*.*");
echo '<a href="' .$imagePath. '<img src="'.$imageFile[1].'" id="folder"
onmouseover="imageOver(this)"
onmouseout="imageOut(this)"
onmousedown="imageDown(this)"
/>'."\n";
}
?>
And here is my HTML:
<body>
<div id="container">
<?php include 'jellybox.php'; ?>
</div>
</body>
Thanks for any help you can give.