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 : <?php printDownloadLinkAlbumZip(); ?>
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 !!!
Comments
1. 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.
2. Sorry, no facility for this.
3. That is quite easy. Just use `if(zp_loggedin()) { printDownloadlinkAlbumZip; }`.
Addition: The normal downloadlist function without zip has a parameter to explude files.
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 <?php printdownloadList() ?> in album.php, nothing displays
About question 3 :
I tried the code <?php if(zp_loggedin()) { printDownloadlinkAlbumZip(); } ?>
and it works fine !
Thanks
Bye
2. 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
I get it. But what is the code for a directory corresponding to the current album ?
I tried <?php printdownloadList('album') ?>
But this doesn't work.
Thanks again
You can also use a path outside the webroot by using "../../<somefolder>" so no one can download the files directly.
Thanks for your patience...
The line code is now <?php if(zp_loggedin()) { printdownloadList('albums/$_zp_current_album->name'); } ?>
but it's still not working (nothing displays as I am connected)
The extension is working when I paste :
<?php if(zp_loggedin()) { printdownloadList(''); } ?> 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) :
<?php if(zp_loggedin()) { printdownloadList('', array ('php'); } ?> but I get a blank page
As you can see I'm good as musician but not as php coder ;-) I have to look at a complete php tutorial !!! Anyway I thank you to give me those advices, and maybe a line code working...
Well, I didn't see (hear) yet if you are a better musician...;-)