本文整理汇总了PHP中Album::setShow方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::setShow方法的具体用法?PHP Album::setShow怎么用?PHP Album::setShow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::setShow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unpublishSubalbums
function unpublishSubalbums($album)
{
global $gallery;
$albums = $album->getAlbums();
foreach ($albums as $albumname) {
$subalbum = new Album($gallery, $albumname);
$subalbum->setShow(false);
$subalbum->save();
unpublishSubalbums($subalbum);
}
}
示例2: Album
if (!empty($folder)) {
if ($new) {
$rightsalbum = new Album($gallery, dirname($folder));
} else {
$rightsalbum = new Album($gallery, $folder);
}
if (!$rightsalbum->isMyItem(UPLOAD_RIGHTS)) {
if (!zp_apply_filter('admin_managed_albums_access', false, $return)) {
header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php');
exit;
}
}
if ($new) {
mkdir_recursive($targetPath, CHMOD_VALUE);
$album = new Album($gallery, $folder);
$album->setShow($_POST['http_publishalbum']);
$album->setTitle(sanitize($_POST['http_albumtitle']));
$album->setOwner($_zp_current_admin_obj->getUser());
$album->save();
}
@chmod($targetPath, CHMOD_VALUE);
$error = zp_apply_filter('check_upload_quota', UPLOAD_ERR_OK, $tempFile);
if (!$error) {
if (is_valid_image($name) || is_valid_other_type($name)) {
$seoname = seoFriendly($name);
if (strrpos($seoname, '.') === 0) {
$seoname = sha1($name) . $seoname;
}
// soe stripped out all the name.
$targetFile = $targetPath . '/' . internalToFilesystem($seoname);
if (file_exists($targetFile)) {
示例3: isset
}
}
}
$newAlbum = $_POST['existingfolder'] == 'false' || isset($_POST['newalbum']);
// Make sure the folder exists. If not, create it.
if (isset($_POST['processed']) && !empty($_POST['folder']) && ($newAlbum || !$files_empty)) {
$folder = sanitize_path($_POST['folder']);
$uploaddir = $gallery->albumdir . UTF8ToFilesystem($folder);
if (!is_dir($uploaddir)) {
mkdir($uploaddir, CHMOD_VALUE);
}
@chmod($uploaddir, CHMOD_VALUE);
$album = new Album($gallery, $folder);
if ($album->exists) {
if (!isset($_POST['publishalbum'])) {
$album->setShow(false);
}
$title = sanitize($_POST['albumtitle'], 2);
if (!empty($title) && $newAlbum) {
$album->setTitle($title);
}
$album->save();
} else {
$AlbumDirName = str_replace(SERVERPATH, '', $gallery->albumdir);
zp_error(gettext("The album couldn't be created in the 'albums' folder. This is usually a permissions problem. Try setting the permissions on the albums and cache folders to be world-writable using a shell:") . " <code>chmod 777 " . $AlbumDirName . CACHEFOLDER . "</code>, " . gettext("or use your FTP program to give everyone write permissions to those folders."));
}
$error = false;
foreach ($_FILES['files']['error'] as $key => $error) {
if ($_FILES['files']['name'][$key] == "") {
continue;
}
示例4: header
$return = '';
} else {
$return = '&album=' . $return . '&tab=subalbuminfo';
}
}
header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $return);
exit;
break;
/** Publish album ************************************************************/
/******************************************************************************/
/** Publish album ************************************************************/
/******************************************************************************/
case "publish":
XSRFdefender('albumedit');
$album = new Album($gallery, $folder);
$album->setShow($_GET['value']);
$album->save();
$return = pathurlencode(dirname($folder));
if (!empty($return)) {
if ($return == '.' || $return == '/') {
$return = '';
} else {
$return = '&album=' . $return . '&tab=subalbuminfo';
}
}
header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $return);
exit;
break;
/** Reset hitcounters ***********************************************************/
/********************************************************************************/
/** Reset hitcounters ***********************************************************/
示例5: processAlbumBulkActions
/**
* Processes the check box bulk actions for albums
*
*/
function processAlbumBulkActions()
{
global $gallery;
$action = sanitize($_POST['checkallaction']);
$ids = $_POST['ids'];
$total = count($ids);
$message = NULL;
if ($action != 'noaction') {
if ($total > 0) {
if ($action == 'addtags' || $action == 'alltags') {
foreach ($_POST as $key => $value) {
$key = postIndexDecode($key);
if (substr($key, 0, 10) == 'mass_tags_') {
if ($value) {
$tags[] = substr($key, 10);
}
}
}
$tags = sanitize($tags, 3);
}
$n = 0;
foreach ($ids as $albumname) {
$n++;
$albumobj = new Album($gallery, $albumname);
switch ($action) {
case 'deleteall':
$albumobj->remove();
break;
case 'showall':
$albumobj->setShow(1);
break;
case 'hideall':
$albumobj->setShow(0);
break;
case 'commentson':
$albumobj->setCommentsAllowed(1);
break;
case 'commentsoff':
$albumobj->setCommentsAllowed(0);
break;
case 'resethitcounter':
$albumobj->set('hitcounter', 0);
break;
case 'addtags':
$mytags = array_unique(array_merge($tags, $albumobj->getTags()));
$albumobj->setTags($mytags);
break;
case 'cleartags':
$albumobj->setTags(array());
break;
case 'alltags':
$images = $albumobj->getImages();
foreach ($images as $imagename) {
$imageobj = newImage($albumobj, $imagename);
$mytags = array_unique(array_merge($tags, $imageobj->getTags()));
$imageobj->setTags($mytags);
$imageobj->save();
}
break;
case 'clearalltags':
$images = $albumobj->getImages();
foreach ($images as $imagename) {
$imageobj = newImage($albumobj, $imagename);
$imageobj->setTags(array());
$imageobj->save();
}
break;
}
$albumobj->save();
}
}
return $action;
}
}