• sokol99

    (@sokol99)


    Hi. I was wondering whether it is possible to scan recursively in the gallery home directory when checking for new photos in NextGEN gallery.

    I already have a lot of photos on my server and just want to point to the right directory to share them via the web. I tried soft linking, then I put in a simple sub directory but neither ended up getting scanned..

    Is there a smarter way to do this?

    Thanks!

    https://www.ads-software.com/extend/plugins/nextgen-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • any word on this? I am in search of a similar function.

    Afaik WP doesn’t have this kind of functionality, but you can try this:

    function getDirectory($path = '.', $level = 0)
    {
        $ignore = array('cgi-bin', '.', '..');
        $dh = @opendir($path);
    
        while (false !== ($file = readdir($dh))) {
            if (!in_array($file, $ignore)) {
                $spaces = str_repeat(' ', ($level * 4));
                if (is_dir("$path/$file")) {
                    //it's a dir
                    getDirectory("$path/$file", ($level + 1));
                } else {
                    // it's a file
                }
            }
        }
        closedir($dh);
    }
    call: getDirectory("."); // where . is your path

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘NextGEN Gallery – recursive directory scan?’ is closed to new replies.