I was hoping someone could give me some pointers on improving this code, and also making one part of it possible - I'm stumped!
I am able to display the thumbnail images in directory "driveway/thumbs/images_thumbs.jpg" dynamically but what I'd also like is to 'a href' to the main images in the parent directory (driveway/images.jpg). These images also have a different name (do not have _thumbs appended). I have been struggling for the last few days, and I just can't get this to work....
Images are uploaded to the main "driveway" directory, and every 20 minutes, they are converted to thumbnails. The thumbnails are put in to the driveway/thumbs directory, and the originals are put in the driveway/thumbs directory. I have inserted a provision in here for the 20 minutes between conversions. In any case, when I click on a thumb, of course I'd like to see the full sized original....and that's where the coding issues come in.
Any help is much appreciated, even with helping tighten my hodgepodge code!!!! Thank you!!!
Code:
<?php
$dirdriveway = "./driveway/thumbs/";
$dirdriveway_preprocessed = "./driveway/";
$dirden = "./den/thumbs";
$dirden_preprocessed = "./den/";
$fddriveway = opendir("$dirdriveway");
$fddriveway_preprocessed = opendir("$dirdriveway_preprocessed");
$fdden = opendir("$dirden");
$fdden_preprocessed = opendir("$dirden_preprocessed");
echo "<hr><hr><b><u><h2>DRIVEWAY</h2></u></b>";
while($entry = readdir($fddriveway)) {
if(eregi(".(exe|zip|jpg)$", $entry)) {
echo "<a href=\"$dirdriveway$entry\"><img src=\"$dirdriveway$entry\" border=\"0\" alt=\"$entry\">" .
"</a>\n";
}
}
closedir($fddriveway);
echo "<br><br><b>Pre-processed</b><br>";
while($entry = readdir($fddriveway_preprocessed)) {
if(eregi(".(exe|zip|jpg)$", $entry)) {
echo "<a href=\"$dirdriveway_preprocessed$entry\"><img src=\"$dirdriveway_preprocessed$entry\" border=\"0\" width=\"232\" height=\"158\" alt=\"$entry\">" .
"</a>\n";
}
}
closedir($fddriveway_preprocessed);
echo "<br><br><hr><hr><b><u><h2>DEN</h2></u></b>";
while($entryden = readdir($fdden)) {
if(eregi(".(exe|zip|jpg)$", $entryden)) {
echo "<a href=\"$dirden$entryden\"><img src=\"$dirden$entryden\" border=\"0\" alt=\"$entryden\">" .
"</a>\n";
}
}
echo "<br><br><b>Pre-processed</b><br>";
while($entry = readdir($fdden_preprocessed)) {
if(eregi(".(exe|zip|jpg)$", $entry)) {
echo "<a href=\"$dirden_preprocessed$entry\"><img src=\"$dirden_preprocessed$entry\" border=\"0\" width=\"232\" height=\"158\" alt=\"$entry\">" .
"</a>\n";
}
}
closedir($fdden_preprocessed);
closedir($fdden);
?>