Zip only for certain subalbums

Is there a way to use the printAlbumZip function only for certain albums?
My gallery structure:
gallery
\_folder
\_subfolder
\_subsubfolder 01 (need a zip file only of the pics in these albums: 01, 02, 03, etc...)
- subsubfolder 02
- subsubfolder 03

Comments

  • You would have to include code in your theme to only show the link when you want it shown. That is do not call the `printAlbumZip()` functions on albums you don't want to be zipped.
  • acrylian Administrator, Developer
    Use an if/else check to do that.
  • Could you provide an example?
  • `if ($_zp_current_album->name=='xyzzy') printAlbumZip();`
  • Thanks. Do the spaces in the album name need to be converted to something? Cause I c/p the album title as it appears and it's not working.
    ex: <?php if ($_zp_current_album->name=='test album') printAlbumZip(); ?>

    Or maybe should I put the full path to the album?
  • The album title is different from its name (folder). So you have to make the test check for whatever you are going to use as the criteria. If it is the album title then the test is `if ($_zp_current_album->getTitle() == 'This is the xyzzy album') printAlbumZip();`

    The album `name` is the full folder path from the albums folder. So if you have a subalbum named `xyzzy` in an album named `plover` then the name would be `plover/xyzzy`
  • Actually, it might be more convenient for you to make use of the custom data field for this. In admin, set the custom data field to 1 for those albums you want to allow to be zipped. Then use `if ($_zp_current_album->getCustomData() == 1) printAlbumZip();`
  • Awesome! Thanks.
Sign In or Register to comment.