Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: How to add a file inside the zip favourite download?  (Read 1904 times)

0 Members and 1 Guest are viewing this topic.

Fabricio Ferrero

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
How to add a file inside the zip favourite download?
« on: September 27, 2008, 03:50:03 am »

Hi,

I set "allow favourites zip downloading" and work perfect.
I was wondering if there is any way to add a file (as a txt) to the zip so when the users download his favourites pictures, he also get a txt inside that zip file. Has anybody did this before and would like to share?

P.S: I don't know if this is already requested but would be an excelent feature for 1.5 imo.
Logged
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to add a file inside the zip favourite download?
« Reply #1 on: September 27, 2008, 08:47:59 am »

As far as I know this has not been coded yet. I'm not sure if it should go into a release, as zip download is a feature that is bound to break for larger downloads anyway, since zip-creation on the server is a resources intensive process that fails easily.
To come up with this, you need to review zipdownload.php (in the coppermine root): before the start of the loop, you need to add the text file to the list. To keep things easy and avoid dynamic creation of the text files, create the text file in advance. Let's assume that you have already created the textfile named "readme.txt" within your albums folder. Find
Code: [Select]
if (count($FAVPICS)>0){and add after it (in a line of it's own)
Code: [Select]
        $filelist[] = $CONFIG['fullpath'].'readme.txt';Please keep in mind that I have coded this out of the back of my head without testing it, so please report back.
Logged

Nibbler

  • Guest
Re: How to add a file inside the zip favourite download?
« Reply #2 on: September 27, 2008, 12:24:53 pm »

Should be just:

Code: [Select]
$filelist[] = 'readme.txt';
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How to add a file inside the zip favourite download?
« Reply #3 on: September 27, 2008, 01:18:09 pm »

I stand corrected. I have added this feature to cpg1.5.x, as it was easily accomplished.
Logged

Fabricio Ferrero

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
Re: How to add a file inside the zip favourite download?
« Reply #4 on: September 28, 2008, 04:52:30 am »

Reporting back...

Both solutions works as expected. I choose Nibbler's one because it's shorter and works as well too.

Adding this to 1.5 it's great. I think almost all users that allow zip downloading would love this feature, don't you think? So thanks to considering this. I will not create a topic in feature request, it's sensless. But, maybe you should consider moving this to mod sub-forum.

Ok, once again, thank both of you very much to come up with a solution in no time. I would love have coding skills but I don't.  :'(

Thanks,
Logged
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.