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 ... 3 4 5 6 [7] 8 9   Go Down

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

0 Members and 3 Guests are viewing this topic.

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Re: Download complete album als ZIP
« Reply #120 on: April 29, 2015, 08:33:48 pm »

You can try making this addition 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();

Where abouts do I add it? I just got an error when adding just before the ?> Thank you very much for the help!
Code: [Select]
Parse error: syntax error, unexpected end of file in /home/username/public_html/photos/plugins/albumdownload/codebase.php on line 24
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Download complete album als ZIP
« Reply #121 on: April 29, 2015, 10:30:45 pm »

More simple:

Open codebase.php file, find:

Code: [Select]
function downloadZip_header($html) {

and bellow (under it) add:

Code: [Select]
    if (!USER_ID) return $html;  // add this line to inhibit use by guests

That what ron4mac was trying to say when he added the comment: "// add this line to inhibit use by guests". To add to the code just that line under: "function downloadZip_header($html) {" .

I test it and it works.
« Last Edit: April 29, 2015, 10:36:04 pm by allvip »
Logged

fran86

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: Download complete album als ZIP
« Reply #122 on: April 30, 2015, 01:52:45 pm »

More simple:

Open codebase.php file, find:

Code: [Select]
function downloadZip_header($html) {

and bellow (under it) add:

Code: [Select]
    if (!USER_ID) return $html;  // add this line to inhibit use by guests

That what ron4mac was trying to say when he added the comment: "// add this line to inhibit use by guests". To add to the code just that line under: "function downloadZip_header($html) {" .

I test it and it works.

Thank you very much, works as you said. :) Sorry for not understanding the first time.
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Download complete album als ZIP
« Reply #123 on: April 20, 2016, 10:50:17 pm »

I have detected that this plugin does not work right with keyword based linked files.
When you download an album which "contains" linked files, some of them will be downloaded, but some other of them will not...  :-\
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #124 on: June 13, 2016, 12:08:19 pm »

I have detected that this plugin does not work right with keyword based linked files.
When you download an album which "contains" linked files, some of them will be downloaded, but some other of them will not...  :-\

Hello,
Your problem is that the selection of photos that does is only to 1 album, you should take the following restriction and try again:

Code: [Select]
[u]File: albumdownload/zip.php[/u]
(Original, Line 27):
$query = "SELECT filepath, filename FROM {$CONFIG['TABLE_PICTURES']} AS pictures , (SELECT keyword FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '" . $aid . "' ) AS keyword, {$CONFIG['TABLE_ALBUMS']} AS r $RESTRICTEDWHERE AND r.aid = pictures.aid AND (pictures.aid = '" . $aid . "' OR ( keyword.keyword <> '' AND CONCAT(';', keywords, ';') LIKE CONCAT('%;', keyword.keyword, ';%')))";

(Modified, Line 27):
$query = "SELECT filepath, filename FROM {$CONFIG['TABLE_PICTURES']} AS pictures , (SELECT keyword FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '" . $aid . "' ) AS keyword, {$CONFIG['TABLE_ALBUMS']} AS r $RESTRICTEDWHERE AND (pictures.aid = '" . $aid . "' OR ( keyword.keyword <> '' AND CONCAT(';', keywords, ';') LIKE CONCAT('%;', keyword.keyword, ';%')))";




That selection restricts the images are in the selected album , bearing the same AID files the album . In your case to have images from different albums, you must remove that restriction not to equate the AID photo album with AID.[/font][/size]

[/font][/size]

[/font][/size]
Please feel free to contact me (in Spanish) if my response [/font][/size]has not been clear.
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Download complete album als ZIP
« Reply #125 on: June 13, 2016, 01:01:07 pm »

Thanks
I have changed the line 27 in zip.php as you say, and it didn't work
Please, may you try in my gallery and see what happens?

Thanks also for the offer of writing you, but I tried and it says I'm not allowed to send personal messages. (I don't know the reason)
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #126 on: June 13, 2016, 02:54:16 pm »

Thanks
I have changed the line 27 in zip.php as you say, and it didn't work
Please, may you try in my gallery and see what happens?

Thanks also for the offer of writing you, but I tried and it says I'm not allowed to send personal messages. (I don't know the reason)

Ok, I can see your gallery. You use and "dynamic albums".
Can you try this query:
Code: [Select]
$query = "SELECT filepath,filename, (SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid = '" . $aid . "') FROM {$CONFIG['TABLE_PICTURES']}";
Or something similar, because you need to create the query link like a function search.
Search all images from table_pictures like AID (album identificator) as album_where_you_stay

Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Download complete album als ZIP
« Reply #127 on: June 13, 2016, 03:22:36 pm »

Thanks
Changed... I have checked and it started downloading more than 800 Mb
So, it seems it selects too many files now  ::)
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #128 on: June 13, 2016, 03:29:59 pm »

Thanks
Changed... I have checked and it started downloading more than 800 Mb
So, it seems it selects too many files now  ::)

Ok, this indicate that it works, but the query is selecting all photos because you don´t have a field that relationships both tables.

Try this code:
Code: [Select]
$query = "SELECT filepath,filename, (SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} as albums WHERE aid = '" . $aid . "') FROM {$CONFIG['TABLE_PICTURES']} as pictures and albums.aid = pictures.aid";
I'm trying to figure out the SQL statement but it is complicated without test directly on the bbdd.

Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Download complete album als ZIP
« Reply #129 on: June 13, 2016, 04:44:08 pm »

No luck... when trying to download it says:
Critical error
There was an error while processing a database query

In case you want me to check/do anything in the database please let me know
Thank you very much
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #130 on: June 13, 2016, 05:38:05 pm »

No luck... when trying to download it says:
Critical error
There was an error while processing a database query

In case you want me to check/do anything in the database please let me know
Thank you very much

Ok, I will try to reproduce your situation in my gallery and I found this query to this function, in my case its works, please try on your gallery.

Code: [Select]
SELECT pictures.aid,filepath,filename,keywords
FROM {$CONFIG['TABLE_PICTURES']} as pictures
LEFT JOIN {$CONFIG['TABLE_ALBUMS']} as albums ON pictures.aid=albums.aid
WHERE aid = '" . $aid . "'
AND pictures.keywords=albums.keyword
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Download complete album als ZIP
« Reply #131 on: June 13, 2016, 05:54:23 pm »

Now appears this:

Code: [Select]
Parse error: syntax error, unexpected T_STRING in /var/www/vhosts/ame-web.org/fotometeo/plugins/albumdownload/zip.php on line 27
In zip.php (lines 23 to 33) currently there is this:

Code: [Select]
echo '<p>Creating file list...</p>';
$filelist = array();
$aid = $superCage->get->getInt('aid');
get_meta_album_set(0);
SELECT pictures.aid,filepath,filename,keywords
FROM {$CONFIG['TABLE_PICTURES']} as pictures
LEFT JOIN {$CONFIG['TABLE_ALBUMS']} as albums ON pictures.aid=albums.aid
WHERE aid = '" . $aid . "'
AND pictures.keywords=albums.keyword
$result = cpg_db_query($query);
$rowset = cpg_db_fetch_rowset($result);

Thanks again
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #132 on: June 13, 2016, 05:59:21 pm »

oh sorry, you need to put the query in the right sintax:

Code: [Select]
$query = "SELECT pictures.aid,filepath,filename,keywords
FROM {$CONFIG['TABLE_PICTURES']} as pictures
LEFT JOIN {$CONFIG['TABLE_ALBUMS']} as albums ON pictures.aid=albums.aid
WHERE aid = '" . $aid . "'
AND pictures.keywords=albums.keyword"
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #133 on: June 13, 2016, 06:24:18 pm »

I can't know you implement the "meta albums" but this thread can help you to define the albums and looks more "oem" to solve the issue

http://forum.coppermine-gallery.net/index.php/topic,63706.40.html
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Download complete album als ZIP
« Reply #134 on: June 13, 2016, 09:14:43 pm »

Currently (lines 23 to 33):

Code: [Select]
echo '<p>Creating file list...</p>';
$filelist = array();
$aid = $superCage->get->getInt('aid');
get_meta_album_set(0);
$query = "SELECT pictures.aid,filepath,filename,keywords
FROM {$CONFIG['TABLE_PICTURES']} as pictures
LEFT JOIN {$CONFIG['TABLE_ALBUMS']} as albums ON pictures.aid=albums.aid
WHERE aid = '" . $aid . "'
AND pictures.keywords=albums.keyword"
$result = cpg_db_query($query);
$rowset = cpg_db_fetch_rowset($result)

But doesn´t work...  :-[
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #135 on: June 14, 2016, 06:35:21 pm »

Ok, simplify the code:

Code: [Select]
echo '<p>Creating file list...</p>';
$filelist = array();
$aid = $superCage->get->getInt('aid');
get_meta_album_set(0);
[b]$query = "SELECT pictures.aid,filepath,filename
FROM {$CONFIG['TABLE_PICTURES']} as pictures
LEFT JOIN {$CONFIG['TABLE_ALBUMS']} as albums ON pictures.aid=albums.aid
WHERE aid = '" . $aid . "'"[/b]
$result = cpg_db_query($query);
$rowset = cpg_db_fetch_rowset($result)

with this select, you select all pictures where the AID=AID album, and this is the unique identification number...
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #136 on: June 14, 2016, 06:36:42 pm »

sorry, put name any of the albums that not download all the photos to see if it gives me a clue, thank you
Logged

FrA1l3

  • Translator
  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Posts: 78
    • ACMSB
Re: Download complete album als ZIP
« Reply #137 on: June 14, 2016, 06:41:59 pm »

Hello again,

in the code, you have the aid before the query, use it.
Try this simply query:

Code: [Select]
echo '<p>Creating file list...</p>';
$filelist = array();
$aid = $superCage->get->getInt('aid');
get_meta_album_set(0);
$query = "SELECT aid,filepath,filename FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '" . $aid . "'"
$result = cpg_db_query($query);
$rowset = cpg_db_fetch_rowset($result)
Logged

alainlizotte

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Download complete album als ZIP
« Reply #138 on: September 14, 2016, 11:26:34 pm »

Would it be possible to add a cache feature ?

My albums are quite big and the process to build the file takes a long time.
I would like this delay to only happen once.

Thank you !


My Album:
http://www.lemordudurc.com/photos/
Logged

bigdrago

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Download complete album als ZIP
« Reply #139 on: September 25, 2017, 05:45:20 pm »

I would also like a cache function.

Some of the albums is too big and cannot be downloaded due to resource scaling with my provider. The site locks down when it gets too heavy loaded :/
Logged
Pages: 1 ... 3 4 5 6 [7] 8 9   Go Up
 

Page created in 0.025 seconds with 19 queries.