本文整理匯總了PHP中Gallery::getPersistentArchive方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::getPersistentArchive方法的具體用法?PHP Gallery::getPersistentArchive怎麽用?PHP Gallery::getPersistentArchive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gallery
的用法示例。
在下文中一共展示了Gallery::getPersistentArchive方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createAlbumZip
/**
* Creates a zip file of the album
*
* @param string $albumname album folder
*/
function createAlbumZip($albumname)
{
global $_zp_zip_list, $zip_gallery;
$zip_gallery = new Gallery();
$album = new Album($zip_gallery, $albumname);
if (!$album->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumname)) {
pageError(403, gettext("Forbidden"));
exit;
}
if (!$album->exists) {
pageError(404, gettext('Album not found'));
exit;
}
$persist = $zip_gallery->getPersistentArchive();
$dest = $album->localpath . '.zip';
if (!$persist || !file_exists($dest)) {
include_once 'archive.php';
$curdir = getcwd();
chdir($album->localpath);
$_zp_zip_list = array();
$z = new zip_file($dest);
$z->set_options(array('basedir' => realpath($album->localpath . '/'), 'inmemory' => 0, 'recurse' => 0, 'storepaths' => 1));
zipAddAlbum($album, strlen($albumname), $z);
$z->add_files($_zp_zip_list);
$z->create_archive();
unset($_zp_zip_list);
chdir($curdir);
}
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename="' . pathurlencode($albumname) . '.zip"');
header("Content-Length: " . filesize($dest));
printLargeFileContents($dest);
if (!$persist) {
unlink($dest);
}
unset($zip_gallery);
unset($album);
unset($persist);
unset($dest);
}
示例2: checked
<label>
<input type="checkbox" name="thumb_select_images" id="thumb_select_images"
value="1" <?php
echo checked('1', $gallery->getThumbSelectImages());
?>
/>
<?php
echo gettext("visual thumb selection");
?>
</label>
</p>
<p>
<label>
<input type="checkbox" name="persistent_archive" id="persistent_archive"
value="1" <?php
echo checked('1', $gallery->getPersistentArchive());
?>
/>
<?php
echo gettext("enable persistent archives");
?>
</label>
</p>
<p>
<label>
<input type="checkbox" name="album_session" id="album_session"
value="1" <?php
echo checked('1', GALLERY_SESSION);
?>
/>
<?php