Member
Member
Barbara   2009-01-25, 21:45
#1
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
Member
Member
sbillard   2009-01-26, 03:25
#2
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.
Administrator
Administrator
acrylian   2009-01-26, 10:58
#3
Use an if/else check to do that.
Member
Member
Barbara   2009-01-26, 21:45
#4
Could you provide an example?
Member
Member
sbillard   2009-01-26, 22:23
#5
`if ($_zp_current_album->name=='xyzzy') printAlbumZip();`
Member
Member
Barbara   2009-01-27, 23:08
#6
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?
Member
Member
sbillard   2009-01-27, 23:55
#7
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`
Member
Member
sbillard   2009-01-27, 23:59
#8
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();`
Member
Member
Barbara   2009-01-28, 00:09
#9
Awesome! Thanks.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.