本文整理汇总了PHP中zipfile::addfiles方法的典型用法代码示例。如果您正苦于以下问题:PHP zipfile::addfiles方法的具体用法?PHP zipfile::addfiles怎么用?PHP zipfile::addfiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zipfile
的用法示例。
在下文中一共展示了zipfile::addfiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$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);
}
}
示例2: pageheader
//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 = db_query("SELECT {$select_columns} FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'AND pid IN ({$favs})");
$rowset = db_fetch_rowset($result);
foreach ($rowset as $key => $row) {
$filelist[] = $rowset[$key]['filepath'] . $rowset[$key]['filename'];
}
}
$flags['storepath'] = 0;
$cwd = './albums';
$zip = new zipfile($cwd, $flags);
$zip->addfiles($filelist);
$zip->filedownload('pictures.zip');
}