Only trouble is it links through albums. I want to merely echo out the contents of album with the thumbnails to work with lightbox. Basically echo out the contents of a folder as images. It is just a question of removing a few bits of this code as it works as I want it more or less, just don't want the first bit 'if (!$get_album) has not been selected with a bit more that I can't figure out. Any help appreciated, been on it all week and just can't get it to work. Others in other forums have tried to do it anoher 'better' way that doesn't work at all
. Thanks- Code: Select all
<?php
$page = $_SERVER ['PHP_SELF'];
//settings
$column = 5;
//directories
$base = "data";
$thumbs = "thumbs";
//get album
$get_album = $_GET['album'];
if (!$get_album)
{
echo "<p>select an album<p/>";
$handle = opendir($base);
while (($file = readdir($handle)) !==FALSE)
{
if (is_dir($base."/".$file) && $file != "." && $file != ".." && $file != $thumbs)
{
echo "<a href='$page?album=$file'>$file</a></br>";
}
}
}
else
{
if (!is_dir($base."/".$get_album) || strstr($get_album,".") !=NULL || strstr($get_album,"/")!=NULL || strstr($get_album,"\\")!=NULL)
{
echo "Album does not exist";
}
else
{
echo "<b>$get_album</b></p>";
$handle = opendir($base."/".$get_album);
while (($file = readdir($handle)) !== FALSE)
{
if ($file != "." && $file != ".." && $file != ".DS_Store")
{
echo "<img src='$base/$thumbs/$file'></br>";
}
}
}
}
?>

