1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
<?php /************************* Coppermine Photo Gallery ************************ Copyright (c) 2003-2008 Dev Team v1.1 originally written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. ******************************************** Coppermine version: 1.4.19 $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/zipdownload.php $ $Revision: 4392 $ $Author: gaugau $ $Date: 2008-04-16 09:25:35 +0200 (Mi, 16 Apr 2008) $ **********************************************/
define('IN_COPPERMINE', true); define('THUMBNAILS_PHP', true); define('INDEX_PHP', true); require('include/init.inc.php'); include ( 'include/archive.php');
if ($CONFIG['enable_zipdownload'] != 1) { //someone has entered the url manually, while the admin has disabled zipdownload pageheader($lang_error); starttable('-2', $lang_error); print <<<EOT <tr> <td align="center" class="tableb"> {$lang_errors['perm_denied']} </td> </tr> EOT; endtable(); pagefooter(); ob_end_flush(); } else { // zipdownload allowed, go ahead... $filelist= array();
if (count($FAVPICS)>0){ $favs = implode(",",$FAVPICS);
$select_columns = 'filepath,filename';
$result = cpg_db_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND pid IN ($favs)"); $rowset = cpg_db_fetch_rowset($result); foreach ($rowset as $key => $row){
$filelist[] = $rowset[$key]['filepath'].$rowset[$key]['filename'];
} }
$cwd = "./{$CONFIG['fullpath']}"; $zip = new zip_file('pictures.zip'); $zip->set_options(array('basedir' => $cwd, 'inmemory' => 1, 'recurse' => 0, 'storepaths' => 0)); $zip->add_files($filelist); $zip->create_archive(); ob_end_clean(); $zip->download_file(); } ?>
|