Download complete album als ZIP - Page 7 Download complete album als ZIP - Page 7
 

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 2 Guests are viewing this topic.

fran86

Quote from: ron4mac on April 29, 2015, 05:01:58 PM
You can try making this addition 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();


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

allvip

#121
More simple:

Open codebase.php file, find:


function downloadZip_header($html) {


and bellow (under it) add:


    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.

fran86

Quote from: allvip on April 29, 2015, 10:30:45 PM
More simple:

Open codebase.php file, find:


function downloadZip_header($html) {


and bellow (under it) add:


    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.

nambroque

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...  :-\
My gallery:
Galería Fotometeo

FrA1l3

Quote from: nambroque 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...  :-\

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:

[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.

nambroque

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)
My gallery:
Galería Fotometeo

FrA1l3

Quote from: nambroque 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)

Ok, I can see your gallery. You use and "dynamic albums".
Can you try this query:
$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


nambroque

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

FrA1l3

Quote from: nambroque 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  ::)

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:
$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.


nambroque

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
My gallery:
Galería Fotometeo

FrA1l3

Quote from: nambroque 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

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.


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

nambroque

Now appears this:

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:

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
My gallery:
Galería Fotometeo

FrA1l3

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

$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"

FrA1l3

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

nambroque

Currently (lines 23 to 33):

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...  :-[
My gallery:
Galería Fotometeo

FrA1l3

Ok, simplify the code:

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...

FrA1l3

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

FrA1l3

Hello again,

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

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)

alainlizotte

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/

bigdrago

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 :/