Alright, after some recoding, I've solved the issue:
PHP Code:
$dirpath = 'imgs/gallery/t/';
$dh = opendir($dirpath);
while ($f = readdir($dh)) {
if ($f == '.' || $f == '..') {}
else {
if (@getimagesize($dirpath.$f)) {
$imgs[] = $f;}
else {}
}
}
for($i=0; $i<15; $i++) {
shuffle($imgs);
$this_img = array_pop($imgs);
echo '<a href="gal.php?file='.$this_img.'"><img src="'.$dirpath.$this_img.'" /></a>';}
The only thing I could improve would be the while statement...I could probably clean it up a bit. If anyone has any ideas, let me know. If not, it's at least working now. Thanks.
Thou com'st in such a questionable shape
Hamlet, Act 1, Scene 4
Bookmarks