Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Get imgbrowz0r to create an unordered list

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33049
    digitalbrush
    Member

    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.

    #73617
    ddliu
    Member

    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.

    #91325
    tomslick
    Member

    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 '
    ';
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.