Download complete album als ZIP - Page 6 Download complete album als ZIP - Page 6
 

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]

Main Menu

Download complete album als ZIP

Started by Finswimmer, January 18, 2012, 09:33:00 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

phill104

It is a mistake to think you can solve any major problems just with potatoes.

philg_27

Quote from: Αndré on March 25, 2013, 11:59:56 AM
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
if ($superCage->get->getInt('album') > 0) {
and replace with
if (USER_ID && $superCage->get->getInt('album') > 0) {

open zip.php, find
<?php
and below, add
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.

N2GetherNow

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?:(

N2GetherNow

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

Αndré

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

Vorms

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




MarioLaul

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

Αndré

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

FrA1l3

Hi!

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

FrA1l3

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


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

FrA1l3

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

pols1337

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

Αndré

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

pols1337

Quote from: Αndré 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.

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. 


MarioLaul

Hi,

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

Αndré



Αndré

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

fran86

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.

ron4mac

#119
Quote from: fran86 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.

You can try making this change to the codebase.php file:
function downloadZip_header($html) {
    if (!USER_ID) return $html;  // add this line to inhibit use by guests
    $lang_plugin_albumdownload = albumdownload_language();