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 67422 times)

0 Members and 1 Guest are viewing this topic.

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4454
    • Windsurf.me
Re: Download complete album als ZIP
« Reply #100 on: March 26, 2013, 04:57:55 pm »

Coppermine version 1.5.9

Please update to the latest release asap.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

philg_27

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Re: Re: Download complete album als ZIP
« Reply #101 on: March 26, 2013, 06:13:04 pm »

I haven't created that plugin, I just ported that plugin to cpg1.5.x ;)


To hide the button for guests, open codebase.php, find
Code: [Select]
if ($superCage->get->getInt('album') > 0) {and replace with
Code: [Select]
if (USER_ID && $superCage->get->getInt('album') > 0) {
open zip.php, find
Code: [Select]
<?phpand below, add
Code: [Select]
if (!USER_ID) {
    cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}

This works brillliantly, thanks Andre. Thanks also to the others for their suggestions.
Logged

N2GetherNow

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Download complete album als ZIP
« Reply #102 on: July 20, 2013, 09:16:02 pm »

Hello there,
i've installed this plug-in but seem to not work. When i hit "zip" button it returns this error:
Quote
Critical error
There was an error while processing a database query
I'm running cpg 1.5.24 revision 8570 on Win7, Apache 1.3.7 (PHP v.4.3.2, MySQL v.3.23.49).
Favorites zip download works perfect. Ideas?:(
Logged

N2GetherNow

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Download complete album als ZIP
« Reply #103 on: July 20, 2013, 09:25:04 pm »

I can't edit previous post so...
I found this in cpg database logs
Quote
    Юли 20, 2013 at 09:21 PM - While executing query 'SELECT filepath, filename FROM cpg_fairs_pictures AS pictures , (SELECT keyword FROM cpg_fairs_albums WHERE aid = '5' ) AS keyword, cpg_fairs_albums AS r WHERE (1) AND r.aid = pictures.aid AND (pictures.aid = '5' OR ( keyword.keyword <> '' AND CONCAT(';', keywords, ';') LIKE CONCAT('%;', keyword.keyword, ';%')))' in plugins\albumdownload\zip.php on line 28 the following error was encountered:
    You have an error in your SQL syntax near '(SELECT keyword FROM cpg_fairs_albums WHERE aid = '5' ) AS keyword, cpg_fairs_al' at line 1
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Download complete album als ZIP
« Reply #104 on: August 19, 2013, 05:02:14 pm »

Please enable debug mode and post the extended Coppermine error message (including file and line).
Logged

Vorms

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Download complete album als ZIP
« Reply #105 on: January 19, 2014, 05:16:56 pm »

Hello,
to avoid a timeout in php, I modify the script:

function create_zip()
  {
    $files = 0;
    $offset = 0;
    $central = "";

    if (!empty ($this->options['sfx']))
      if ($fp = @fopen($this->options['sfx'], "rb"))
      {
        $temp = fread($fp, filesize($this->options['sfx']));
        fclose($fp);
        $this->add_data($temp);
        $offset += strlen($temp);
        unset ($temp);
      }
      else
        $this->error[] = "Could not open sfx module from {$this->options['sfx']}.";

    $pwd = getcwd();
    chdir($this->options['basedir']);

    foreach ($this->files as $current)
    {
      if ($current['name'] == $this->options['name'])
        continue;
        ......


just after the foreach add the following line:
 set_time_limit(60); // modified by Thierry

This line solve timeout problemes.

Thierry



Logged

MarioLaul

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Download complete album als ZIP
« Reply #106 on: February 02, 2014, 02:54:29 pm »

i don't see zip logo anywhere. What can i wrong?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Download complete album als ZIP
« Reply #107 on: February 03, 2014, 12:40:31 pm »

Please post a link to your gallery. Is the plugin still installed?
Logged

FrA1l3

  • Translator
  • Coppermine novice
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 20
Re: Download complete album als ZIP
« Reply #108 on: May 16, 2014, 06:39:00 pm »

Hi!

Does anyone know how to change the file name  to take the name of the album?
thank you
Logged

FrA1l3

  • Translator
  • Coppermine novice
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 20
Re: Download complete album als ZIP
« Reply #109 on: June 09, 2014, 08:59:01 pm »

Hello, if anybody is interested in my solution, i will put a very simple solution for my problem:  :)

Code: [Select]
//Add this query to discover the name(title) of the current album
$resultado = cpg_db_query("SELECT title, aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '" . $aid . "'" );
if (mysql_num_rows($resultado) > 0) {
$CURRENT_ALBUM_DATA = mysql_fetch_assoc($resultado);
}
mysql_free_result($resultado);
$album = $CURRENT_ALBUM_DATA['title'];
echo '<p>Creating zip file...</p>';
$filename = 'edit/' . $album . '.zip';
$zip = new zip_file($filename);
Logged

FrA1l3

  • Translator
  • Coppermine novice
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 20
Re: Download complete album als ZIP
« Reply #110 on: June 09, 2014, 09:01:03 pm »

sorry, the above code must be set in the albumdownload/zip.php file.
Logged

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 240
Re: Download complete album als ZIP
« Reply #111 on: December 31, 2014, 06:05:48 am »

Should we use the plugin from the first post, or from the SVN? 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Download complete album als ZIP
« Reply #112 on: December 31, 2014, 10:13:24 am »

Feel free to check yourself which is the more recent version or if they differ at all.
Logged

pols1337

  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 240
Re: Download complete album als ZIP
« Reply #113 on: December 31, 2014, 08:49:10 pm »

Feel free to check yourself which is the more recent version or if they differ at all.

The SVN respository shows v1.0, which is the same as the first post here.  However ... there have also been quite a lot of small updates and code tweaks in the six pages of forum posts here, and I'm wondering if any of that was ever updated into the original file. 

Logged

MarioLaul

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Download all the images included in every album in zip format
« Reply #114 on: January 09, 2015, 02:38:25 pm »

Hi,

I installed that plugin, but i don't see download link logo.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Download complete album als ZIP
« Reply #115 on: January 09, 2015, 02:57:00 pm »

Please post a link to your gallery.
Logged

MarioLaul

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Download complete album als ZIP
« Reply #116 on: January 09, 2015, 03:04:31 pm »

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Download complete album als ZIP
« Reply #117 on: January 09, 2015, 05:04:49 pm »

Please try if it works with a default theme, like curve or water_drop.
Logged

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 57
Re: Download complete album als ZIP
« Reply #118 on: April 29, 2015, 04:45:53 am »

This works beautifully! Thank you :) Question: Is there a way to make it only available for logged in/registered users only? Otherwise spam or guests may use this too much and crash my bandwidth.
Logged

ron4mac

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Posts: 667
Re: Download complete album als ZIP
« Reply #119 on: April 29, 2015, 05:01:58 pm »

This works beautifully! Thank you :) Question: Is there a way to make it only available for logged in/registered users only? Otherwise spam or guests may use this too much and crash my bandwidth.

You can try making this change to the codebase.php file:
Code: [Select]
function downloadZip_header($html) {
    if (!USER_ID) return $html;  // add this line to inhibit use by guests
    $lang_plugin_albumdownload = albumdownload_language();
« Last Edit: April 30, 2015, 03:03:32 pm by ron4mac »
Logged
Pages: 1 2 3 4 5 [6] 7   Go Up
 

Page created in 0.053 seconds with 21 queries.