Print DownloadLinkAlbumZip & JPlayer playlist

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

  • acrylian Administrator, Developer
    Yes, the link in that function had a bug sadly.

    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.
  • 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 <?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
  • acrylian Administrator, Developer
    1. 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.

    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
  • "printDownloadlist requires that you set the directory"

    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
  • acrylian Administrator, Developer
    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/<name of your album respectively path to the album if a subalbum>". 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 "../../<somefolder>" so no one can download the files directly.
  • OK, but what if I want to print the downloadlist of the current album (I got 18 albums in my website), I'd like the registered user to see the downloadlist of the album's items he is looking at !
    Thanks for your patience...
  • acrylian Administrator, Developer
    `$_zp_current_album->name` gets the name of the album (including the parents if a subalbum). Look at the object model tutorial, you will surely stumble upon that anyway if you like to add other things maybe.
  • Ok, I promise I'll take a look there.

    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...
  • acrylian Administrator, Developer
    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...;-)
Sign In or Register to comment.