Member
Member
rhoulian   09-12-2012, 17:25
#1

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 !!!

Administrator
Administrator
acrylian   09-12-2012, 17:32
#2

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.

Member
Member
rhoulian   09-12-2012, 18:32
#3

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

Administrator
Administrator
acrylian   09-12-2012, 18:46
#4
  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

Member
Member
rhoulian   09-12-2012, 19:40
#5

"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
But this doesn't work.

Thanks again

Administrator
Administrator
acrylian   09-12-2012, 20:10
#6

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.

Member
Member
rhoulian   09-12-2012, 20:16
#7

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...

Administrator
Administrator
acrylian   09-12-2012, 20:53
#8

$_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.

Member
Member
rhoulian   09-12-2012, 21:19
#9

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) :

Administrator
Administrator
acrylian   09-12-2012, 22:16
#10

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

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.