本文整理汇总了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