Advanced search  

News:

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

Pages: 1 [2] 3 4 5 6 7   Go Down

Author Topic: Download complete album als ZIP  (Read 69443 times)

0 Members and 1 Guest are viewing this topic.

fersauce

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: Download complete album als ZIP
« Reply #20 on: February 09, 2012, 07:24:39 pm »

@Finswimmer

Hello.
Thank you for your contribution.

Its´s posible to show a message while script is creating the zip file? Something like " wait a moment please" 

Thank you
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #21 on: May 07, 2012, 10:35:02 am »

Hi,

not much seems to have happened on this one, lately.  In particular I don't find the plugin in the repo. 

I'd really appreciate the functionality, but I can't get it to work: first, when I install the last version in this thread, I get
Code: [Select]
Fatal error: require(): Failed opening required './plugins/albumdownload/lang/english.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/coppermine/plugins/albumdownload/initialize.inc.php on line 6 With an empty english.php in the lang directory, nothing happens at all---the thumbnail view is unchanged from without the plugin.

Does anyone have any ideas how to fix this?

Cheers,
Johannes

PS: Kudos for implementing it in the first place, Finswimmer!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Download complete album als ZIP
« Reply #22 on: May 07, 2012, 12:26:46 pm »

With an empty english.php in the lang directory, nothing happens at all---the thumbnail view is unchanged from without the plugin.
When I install the plugin with an empty english.php language file the word "zip" is appended to the album name. A short look at the code shows, that it will not added for meta albums:
Code: [Select]
if ($superCage->get->getInt('album') > 0) {

However, when I open the URL I just get an error like
Quote
Fatal error: Class 'zip_file' not found in C:\xampplite\htdocs\svn_cpg15x_trunk\plugins\albumdownload\albumZip.php on line 42

To fix that issue, open albumZip.php, find
Code: [Select]
include('../../include/archive.php');and replace with
Code: [Select]
include('include/archive.php');
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #23 on: May 07, 2012, 02:29:01 pm »

Thanks, Αndré.  At first, I didn't see any change, but after I actually put something meaningful into english.php:
Code: [Select]
<?php
if (!defined('IN_COPPERMINE')) { die('Not in Coppermine...'); }
$lang_plugin_albumdownload = array(
        
'albumDownload' => 'Download Album as ZIP file.'
    
);
?>
it seemed to work.  "seemed", because, when I clicked the link, I got a list of files (presumably the zip file preamble), and
Code: [Select]
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3230366 bytes) in /var/www/coppermine/include/archive.php on line 651
Presumably this is because the zip file is built in-memory.  So, nothing we can do about this save re-implement the whole thing?

Cheers,
Johannes
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Download complete album als ZIP
« Reply #24 on: May 07, 2012, 03:02:42 pm »

Presumably this is because the zip file is built in-memory.  So, nothing we can do about this save re-implement the whole thing?
You could try to apply that changes to the albumZip.php file.
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #25 on: May 07, 2012, 03:35:17 pm »

That would be a change to a file in the coppermine distribution as oppose to something in the plugin, right?

Thanks again, I'll check it out when I'm home.
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #26 on: May 07, 2012, 03:37:38 pm »

You could try to apply that changes to the albumZip.php file.

Never mind my last comment.

Wer lesen kann...
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #27 on: May 07, 2012, 03:44:39 pm »

That kind of worked.  I get a different error now:
Code: [Select]
Maximum execution time of 60 seconds exceeded in /var/www/coppermine/include/archive.php on line 65
This probably means I have to change my php settings.  I'll try it out when I get home.

Cheers,
Johannes
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Download complete album als ZIP
« Reply #28 on: May 07, 2012, 03:55:28 pm »

It should also be possible to distribute the zip file creation to bypass the execution limit, e.g. just add 5 files at a time to the archive and then start the script from the beginning.
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #29 on: May 07, 2012, 05:52:50 pm »

Interesting idea...

You mean like the bulk image update functions: the user would click for each batch of images being added to the archive? 

Or would it even be possible to keep the restart transparent to the user?

Cheers,
Johannes
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #30 on: May 08, 2012, 11:30:30 am »

Hi,

I fixed the code and it works in my installation.  I think I even improved it somewhat such that not only those images are included in the archive whose `home' album is the album in question, but also those included via the album tag.

Can I upload my version of the plugin?  How about the copyright?

Cheers,
Johannes
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Download complete album als ZIP
« Reply #31 on: May 08, 2012, 11:46:58 am »

Please share your version with the community.
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #32 on: May 08, 2012, 03:55:24 pm »

Oops, sorry, I made it sound like I was concerned about my copyright.  Of course I'll gladly share what little contribution I can make.

I was referring to the OP's copyright.  After all, it's still mostly his code.

Cheers,
Johannes
Logged

Finswimmer

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 14
Re: Download complete album als ZIP
« Reply #33 on: May 08, 2012, 09:18:38 pm »

Oops, sorry, I made it sound like I was concerned about my copyright.  Of course I'll gladly share what little contribution I can make.

I was referring to the OP's copyright.  After all, it's still mostly his code.

Cheers,
Johannes

It is ok as long as it remains "opensource". All changes must be contributed with this forum.

Thank you for your improvements!
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #34 on: May 09, 2012, 01:06:10 pm »

Here goes.

BTW: I don't think there's anything in this plugin that checks user permissions, is there?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Download complete album als ZIP
« Reply #35 on: May 09, 2012, 01:39:55 pm »

I don't think there's anything in this plugin that checks user permissions

Correct, but should be quite easy by replacing
Code: [Select]
$result = cpg_db_query("SELECT filepath, filename FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = " . $aid );with something like
Code: [Select]
$result = cpg_db_query("SELECT filepath, filename FROM {$CONFIG['TABLE_PICTURES']} $RESTRICTEDWHERE AND r.aid = " . $aid );in albumZip.php (not tested).
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #36 on: May 09, 2012, 02:04:23 pm »

Cool, thanks.  I'll check it out.

Of course that's only making it difficult to get the images, not impossible, for anyone who doesn't have access rights, as long as full size images are served directly.  But there's a plugin that serves images after checking access rights as well, right?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Download complete album als ZIP
« Reply #37 on: May 09, 2012, 02:15:37 pm »

I just added the plugin to our SVN repository and currently merging your contribution. So please don't improve your current code until I submitted the new version to the repository.
Logged

Tatome

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Download complete album als ZIP
« Reply #38 on: May 09, 2012, 02:17:14 pm »

"Don't improve your code..."
That's a tough request, you know  ;-)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Download complete album als ZIP
« Reply #39 on: May 09, 2012, 02:39:39 pm »

until
... ;) I just wanted to avoid unnecessary merging effort.


Latest plugin version can be downloaded here. Please use it for further improvements. I'll add any contributed improvements to the repository.
Logged
Pages: 1 [2] 3 4 5 6 7   Go Up
 

Page created in 0.023 seconds with 21 queries.