Disable $excl_dirs[] from generating thumbs

Qdig Help
t_j
2009-01-02
2013-04-15
  • t_j
    t_j
    2009-01-02

    Hi,

    I have some directories listed in $excl_dirs[], and Qdig hides them in the gallery list, however if someone goes straight to the gallery by typing in something like "http://domain.com/index.php?Qwd=./images" (where "images" is the directory I excluded), the thumbnails/captions still get generated.  Is there any way I can disable creation of thumbnails if the directory is in the excluded list?  I'm using 1.2.9.4. 

    Thanks.

     
    • Hagan Fox
      Hagan Fox
      2009-01-05

      It's certainly possible ("somehow") but I think you'd need to hack Qdig to do it.  I can't test any code right now, but my first try might be to add two lines in the "Establish working directory" section of the script:

      Before:

      if (! is_dir($pwd)
          || ! ($is_readable_disa == TRUE || is_readable($pwd)))
      {
          $pwd = $rootdir;
      }

      After:

      $foo = basename($pwd);
      if (! is_dir($pwd)
          || @in_array($foo, $excl_dirs)
          || ! ($is_readable_disa == TRUE || is_readable($pwd)))
      {
          $pwd = $rootdir;
      }

      This would send the visitor to the root directory of the gallery if the requested directory name matches one of the names in the excluded list.

      Hagan

       
      • t_j
        t_j
        2009-01-05

        Many thanks Hagan, that seems to work great!