$files[] = create_fullsize_read($rowset[$key]['filepath'], $rowset[$key]['filename']); //$files[] = $rowset[$key]['filepath'].$rowset[$key]['filename']; } } } else { foreach ($superCage->get->_source as $key => $val) { if (strpos($key, "pic") !== false) { $favs .= "{$val},"; } } $favs .= "-1"; $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']; $files[] = create_fullsize_read($rowset[$key]['filepath'], $rowset[$key]['filename']); //add_to_history($USER_DATA['user_id'],$rowset[$key]['filename']); } } $flags['storepath'] = 0; // $cwd = './albums'; //$cwd = "./{$CONFIG['fullpath']}"; $cwd = substr($cwd, 0, -1); $zip = new zipfile($cwd, $flags); $zip->addfiles($files); $zip->filedownload('pictures.zip'); foreach ($files as $fn) { secure_fullsize($fn); } }