- This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi everyone! New to the forums, been visiting the site for a while though. Little new to php, and was wondering if there was a way to get the imgbrowz0r php script to write all the img-directory names to an unordered list in a separate file, and attach the appropriate links to them?
I figured out how to make a ul from the directory names and links onto the page with jQuery, but as soon as you click to view a subdirectory of images, the list goes away.
The program is light weighted and not that flexible, I’m sorry that you might have to hack the code or ask the author for help.
Sorry for the late response, I just joined the forum
Anyway, I use the following to do what you ask
just put it in your gallery.php (example.php ect…) where you want the list to be.
// Add on to list directorys as a menu
function galleries($directory)
{
$gallery = array();
if ($handle = opendir($directory))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
if (is_dir($directory. "/" . $file))
{
$gallery = array_merge($gallery, galleries($directory. "/" . $file, true));
$file = $file;
$gallery[] = $file;
}
}
}
closedir($handle);
}
return $gallery;
}
$x = explode("/", $config);
$name_of_gallery = galleries(end($x));
echo'';
echo '- Main Gallery
';
foreach ($name_of_gallery as $file)
{
$z=str_replace("%PATH%",$file, $config).'/1';
echo '- '.$file.'
';
}
echo '
';