ZenphotoCMS Forum
Zip only for certain subalbums - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Zip only for certain subalbums (/thread-4529.html)



Zip only for certain subalbums - Barbara - 2009-01-25

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



Zip only for certain subalbums - sbillard - 2009-01-26

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.




Zip only for certain subalbums - acrylian - 2009-01-26

Use an if/else check to do that.




Zip only for certain subalbums - Barbara - 2009-01-26

Could you provide an example?




Zip only for certain subalbums - sbillard - 2009-01-26

if ($_zp_current_album->name=='xyzzy') printAlbumZip();




Zip only for certain subalbums - Barbara - 2009-01-27

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:

Or maybe should I put the full path to the album?




Zip only for certain subalbums - sbillard - 2009-01-27

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




Zip only for certain subalbums - sbillard - 2009-01-27

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();




Zip only for certain subalbums - Barbara - 2009-01-28

Awesome! Thanks.