Hi,
I'm using ZP default theme with JPlayer playlist & DownloadList extensions active.
My playlists are displayed correctly (mp3), but now I'd like more !!!!!
I'm a music composer, and I have tracks in different albums. I'd like the registered users to be able to download the whole album, which contains mp3's (displayed in the playlist), and wav (not displayed). In each album there are some tracks I want to protect from downloading (even for registered users).
I put this line in album.php :
The link is not created correctly (I have to install a nightly build), but however :
I'd like to download in the zip also wav files (uploaded in the album, but not displayed in the playlist)
Exclude some files (those I want to protect from downloading. Maybe by naming it with certain letters: : - ; / § ???)
Print the download link only if user is registered and connected
Would it be possible to do that ?
thanks for the help
enjoy ZP !!!
Yes, the link in that function had a bug sadly.
Zenphoto's zip function only supports files Zenphoto recognizes. It has not support for wav files as that is no general webformat especially since they are "huge" (maybe consider to use FLAC instead which is smaller but lossless?). You would have to create a plugin first so that Zenphoto at least recognizes wave files even if the player cannot play them. See the text-object plugin for example.
Sorry, no facility for this.
That is quite easy. Just use if(zp_loggedin()) { printDownloadlinkAlbumZip; }.
Addition: The normal downloadlist function without zip has a parameter to explude files.
Thank you Acrylian.
About question 1 : "You would have to create a plugin first so that Zenphoto at least recognizes wave files"... I'm quite a newbie, forget about it ;-) But what if I created a zip file in my album, containing all wav ? Will it be downloaded with the mp3 files when clicking the link album zip ? And what about extension "class-any file" ?
As you answered "no" to my 2nd question I will not continue with DownloadlinkAlbumZip.
When you suggest to use the downloadlist function, you mean I can exclude certain file format, or certain file names ? Anyway I tried the downloadlist function but when I put the line in album.php, nothing displays
About question 3 :
I tried the code
and it works fine !
Thanks
Bye
I have not tried but that might work if the zip is exactly named as the zip function would do it. In any case you have to enable the persistent archive option on the backend. Otherwise the zip is created as a stream live.
printDownloadlist requires that you set the directory otherwise it will use the /uploaded folder by default which is surely empty.
You can exclude files specifially or by suffix. Please see the documentation:
http://www.zenphoto.org/documentation/plugins/_zp-extensions---downloadList.php.html#functionprintdownloadList
You need to enter the path from your site. Entering "album" would access a folder at www.domain.com/zenphoto/album (if you installed in the subfolder "zenphoto"). So to access an album you need to enter "albums/". In case you renamed the "albums" folder you can also use the constant ALBUMFOLDER for the first part.
You can also use a path outside the webroot by using "../../" so no one can download the files directly.
Ok, I promise I'll take a look there.
The line code is now
but it's still not working (nothing displays as I am connected)
The extension is working when I paste :
I can see the whole content of the website.
To go further I tried some codes to exclude some file formats (I'm willing to exclude some files too, but I'll take care of it later) :
You really should take the time to learn some php basics. The first does not work because you use the variable wrong ('albums/'.$_zp_current_album->name). The 2nd does not because you didn't close the brackets correctly. You have two nested.
Well, I didn't see (hear) yet if you are a better musician...;-)