Album Download Plugin :D

0
Since MC lacks the ability to automatically generate zip files for album download, I've taken the challenge and wrote my own "plugin" of sort to enable the function!

Function:
Adds a "Download Album" link to album view which dynamically zips all songs in an album and allow authorized users to download.

Installation:
Simply unzip the file in the component directory and it should be good. Basically it creates a cache directory, a file called zipdownload.php in the helpers directory and replaces default.php in the views/album/tmpl/ directory. Be sure to back up your default.php before proceeding. Also make sure that the cache directory is writeable by web server.

Requirements:
The "plugin" assumes UNIX/Apache type environment for your server and gzip is installed at /usr/bin/zip.

Compatibility:
The "plugin" has only been tested on my Mac server and is not guaranteed to work for other platform. Feel free to test it out and let us know!

P.S.
Germi please consider adding this to 2.1 if you deem it's good enough :D [file name=album_download.zip size=4891]http://www.joomlamusicsolutions.com/images/fbfiles/files/album_download.zip[/file]
Attachments:
Responses (31)
  • Accepted Answer

    Saturday, March 06 2010, 06:51 AM - #Permalink
    0
    Submitted to Downloads -> Extensions section just now :)

    BTW please visit my website at http://maestroilluminist.com to show some support B)
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Sunday, March 07 2010, 12:15 PM - #Permalink
    0
    GREAT plugin, thank you!

    But I always get file xxx, not xxx.zip

    so i must rename the file afterwards.
    Can still change?

    THANK YOU!
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, March 07 2010, 08:46 PM - #Permalink
    0
    Go to line 107 in default.php under views/album/tmpl/ and change to the following:

    send_file($destination,$this->album->name.'.zip');

    See if that works
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Monday, March 08 2010, 09:31 AM - #Permalink
    0
    Works GREAT, THANKS!!!
    The reply is currently minimized Show
  • Accepted Answer

    EJ
    EJ
    Offline
    Monday, March 08 2010, 10:18 AM - #Permalink
    0
    I'll give it a try once my site is fully up, and if i need it.
    The reply is currently minimized Show
  • Accepted Answer

    Soulless
    Soulless
    Offline
    Monday, March 08 2010, 01:37 PM - #Permalink
    0
    I get this when i try to install---->"Error! "Could not find an XML setup file in the package." ???
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Monday, March 08 2010, 01:49 PM - #Permalink
    0
    Hi Vandetta!

    read the first post:
    Installation:
    Simply unzip the file in the component directory and it should be good. Basically it creates a cache directory, a file called zipdownload.php in the helpers directory and replaces default.php in the views/album/tmpl/ directory. Be sure to back up your default.php before proceeding. Also make sure that the cache directory is writeable by web server.


    Unzip the File and then upload everything via ftp-programm.
    The reply is currently minimized Show
  • Accepted Answer

    Soulless
    Soulless
    Offline
    Monday, March 08 2010, 03:08 PM - #Permalink
    0
    Hey! thanks! I just uploaded through ftp and changed line 107... i dont see anything..what should i look for..

    im pretty new to this... :( thanks
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Monday, March 08 2010, 05:58 PM - #Permalink
    0
    did you copy all three folders from the zip file to components/com_muscol ???
    The reply is currently minimized Show
  • Accepted Answer

    Soulless
    Soulless
    Offline
    Monday, March 08 2010, 06:09 PM - #Permalink
    0
    Sorry, my mistake i put in the wrong folder. I just put it in there, i get the music note icon, but when i click it , its downloading in a different file type? not a zip..

    Thanks
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Monday, March 08 2010, 06:14 PM - #Permalink
    0
    you've changed line 107 again?

    Go to line 107 in default.php under views/album/tmpl/ and change to the following:
    send_file($destination,$this->album->name.'.zip');
    The reply is currently minimized Show
  • Accepted Answer

    Soulless
    Soulless
    Offline
    Monday, March 08 2010, 06:28 PM - #Permalink
    0
    opps! works perfect! Thanks lukass2000! im learning slowly but surely! Lovin this software and this forum great help from everyone! I appreciate it! B)

    Could you tell me where i could find my php varibles by any chance...? Could you.... :unsure:
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Monday, March 08 2010, 06:38 PM - #Permalink
    0
    Work with Music Collection also only a week ;)

    Not quite understand your question?
    Come from Austria and my English is not good :(
    So I do not knows exactly what you mean.

    A different question:
    Which license has the music on your homepage Creative Commons,...
    Is the commercial music or free?
    The reply is currently minimized Show
  • Accepted Answer

    Soulless
    Soulless
    Offline
    Monday, March 08 2010, 06:43 PM - #Permalink
    0
    Its free music, our djs post the mixtapes/albums... for free download.

    The issue im having is that they (djs) can only upload one song/track at a time... its very time consuming doing it that way... :(

    Im trying to figure out how to make it where they can upload more than one song at a time..
    The reply is currently minimized Show
  • Accepted Answer

    Soulless
    Soulless
    Offline
    Monday, March 08 2010, 07:11 PM - #Permalink
    0
    I found it thanks for all your help! :)
    The reply is currently minimized Show
  • Accepted Answer

    P
    P
    Offline
    Tuesday, March 09 2010, 12:29 AM - #Permalink
    0
    Great job!

    I just wish you could control who gets to download beside registered users.
    The reply is currently minimized Show
  • Accepted Answer

    Lilgeo
    Lilgeo
    Offline
    Tuesday, March 09 2010, 12:23 PM - #Permalink
    0
    Thanks for great plugin
    Tested and works
    I only needed to make album download for registered users not for guests and to show album review
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 10 2010, 08:06 AM - #Permalink
    0
    The plugin obeys the setting of you MusCol. Namely if you allow users to download songs in MusCol then they'll be able to download the album as zip as well (just saves their time from downloading files one by one). If that's not the behavior you observer, please let me know.

    If you want more fine-grained control, you'd have to bug germi for that :)
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 10 2010, 10:13 AM - #Permalink
    0
    Vendetta wrote:
    I found it thanks for all your help! :)


    what is the solution ?
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Thursday, March 11 2010, 07:42 PM - #Permalink
    0
    Hi!

    I've found a little little problem :)

    If I am in the backend a zip file entries at "Album Details / Album File", will display the download button twice.

    Can do that, if in "Album Details / Album File" a zip file is entered, the plugin does not appear???

    Thank you!
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, March 11 2010, 09:45 PM - #Permalink
    0
    @lukass2000

    Change line 95 to the following:

    if($download && $this->album->album_file == "" && ($user->id || $this->params->get('allowsongdownload')))
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Thursday, March 11 2010, 10:20 PM - #Permalink
    0
    Hi gomakeit!

    I did not mean that.

    Under the cover is the player and beside will be shown twice the download icons.
    One for your plugin, and once the original by MC.

    Can you also do something there?

    Thank you!
    The reply is currently minimized Show
  • Accepted Answer

    Friday, March 12 2010, 12:51 AM - #Permalink
    0
    I see what the problem is. Try change line 111 to the following:

    if(!$download && $this->album->album_file == "" && ($user->id || $this->params->get('allowsongdownload')))
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Sunday, March 28 2010, 11:32 AM - #Permalink
    0
    Hello!

    The plugin creates a zip-file of the individual tracks and stores on the server then.

    There is it possibility to delete the zip-file after the download automatically???

    I think much memory needed on the server if everything is stored twice (single tracks and zip file), or?

    Thank You :)
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, March 28 2010, 06:33 PM - #Permalink
    0
    The zip file in cache should be deleted after successful transfer. If the user cancels during download, the temp zip might not be deleted. I suggest you set up a cron job to check the cache folder periodically and remove outdated files.
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Wednesday, April 28 2010, 01:53 PM - #Permalink
    0
    Hi!

    Can you say me,how is the Cron command,
    that automatically each day the CACHE folder is deleted?

    THANK YOU!
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Friday, May 21 2010, 01:59 PM - #Permalink
    0
    hi!

    Can anyone say me how can i delete the cache-folder with cronjob?

    thanks!
    The reply is currently minimized Show
  • Accepted Answer

    fachrezzi
    fachrezzi
    Offline
    Friday, July 23 2010, 03:32 AM - #Permalink
    0
    How to download plug-in?
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Friday, July 23 2010, 09:38 AM - #Permalink
    0
    Hi fachrezzi!

    Look at first Post of this Thread ;)
    The reply is currently minimized Show
  • Accepted Answer

    J. Lukass
    J. Lukass
    Offline
    Thursday, July 29 2010, 09:57 PM - #Permalink
    0
    Hi!

    Who can tell me how I can create the CronJob to delete automaticly the folder???

    My cache file is now bigger 10GB large.
    There would need help :(

    Thank you :)
    The reply is currently minimized Show
Your Reply