本文整理匯總了PHP中Gallery::getAlbums方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::getAlbums方法的具體用法?PHP Gallery::getAlbums怎麽用?PHP Gallery::getAlbums使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gallery
的用法示例。
在下文中一共展示了Gallery::getAlbums方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: forceAlbum
function forceAlbum($success)
{
// we presume that the site only serves the one album.
$gallery = new Gallery();
$albums = $gallery->getAlbums();
$_GET['album'] = array_shift($albums);
return $success;
}
示例2: printFullAlbumsList
/**
* Prints all albums of the Zenphoto gallery as a partial drop down menu (<option></option> parts).
*
* @return string
*/
function printFullAlbumsList()
{
global $_zp_gallery;
if (is_null($_zp_gallery)) {
$_zp_gallery = new Gallery();
}
$albumlist = $_zp_gallery->getAlbums();
foreach ($albumlist as $album) {
$albumobj = new Album($_zp_gallery, $album);
if ($albumobj->isMyItem(LIST_RIGHTS)) {
echo "<option value='" . pathurlencode($albumobj->name) . "'>" . html_encode($albumobj->getTitle()) . unpublishedZenphotoItemCheck($albumobj) . " (" . $albumobj->getNumImages() . ")</option>";
if (!$albumobj->isDynamic()) {
printSubLevelAlbums($albumobj);
}
}
}
}
示例3: gettext
gettext("database connected");
?>
</h3>
<br />
<?php
$albpublish = getOption('album_publish');
$imgpublish = getOption('image_publish');
if (isset($_POST['publish_date'])) {
$requestdate = dateTimeConvert(sanitize($_POST['publish_date']));
} else {
$requestdate = date('Y-m-d H:i:s');
}
$albumidlist = '';
$albumids = '';
if (zp_loggedin(ADMIN_RIGHTS)) {
$albumlist = $gallery->getAlbums();
} else {
$albumlist = getManagedAlbumList();
$albumIDs = array();
foreach ($albumlist as $albumname) {
$subalbums = getAllSubAlbumIDs($albumname);
foreach ($subalbums as $ID) {
$albumIDs[] = $ID['id'];
}
}
$i = 0;
foreach ($albumIDs as $ID) {
if ($i > 0) {
$albumidlist .= ' OR ';
$albumids .= ' OR ';
}
示例4: gettext
}
}
}
}
printAdminHeader(gettext('utilities'), gettext('SEO cleaner'));
if (isset($_GET['todo'])) {
$count = sanitize_numeric($_GET['imagecount']);
$albumcount = sanitize_numeric($_GET['albumcount']);
$albums = array();
foreach (explode(',', sanitize(sanitize($_GET['todo']))) as $album) {
$albums[] = sanitize($album);
}
} else {
$count = 0;
$albumcount = 0;
$albums = $gallery->getAlbums();
}
?>
<script type="text/javascript">
<!--
var albumcount = 0;
var imagecount = 0;
var albumspending = [<?php
$c = 0;
foreach ($albums as $key => $album) {
if (hasDynamicAlbumSuffix($album)) {
unset($albums[$key]);
} else {
if ($c) {
echo ',';
}
示例5: addalbumsToDatabase
/**
* Adds albums to the menu set. Returns the next sort order base
* @param string $menuset current menu set
* @param string $base starting "sort order"
* @return int
*/
function addalbumsToDatabase($menuset, $base = NULL)
{
if (is_null($base)) {
$sql = "SELECT COUNT(id) FROM " . prefix('menu') . ' WHERE menuset=' . db_quote($menuset);
$result = query($sql);
$albumbase = db_result($result, 0);
$sortbase = '';
} else {
$albumbase = array_pop($base);
$sortbase = '';
for ($i = 0; $i < count($base); $i++) {
$sortbase .= sprintf('%03u', $base[$i]) . '-';
}
}
$result = $albumbase;
$gallery = new Gallery();
$albums = $gallery->getAlbums();
foreach ($albums as $key => $link) {
addSubalbumMenus($menuset, $gallery, 0, $link, $sortbase . sprintf('%03u', $result = $key + $albumbase));
}
return $result;
}
示例6: array
zp_apply_filter('admin_note', 'users', $subtab);
switch ($subtab) {
case 'groups':
$adminlist = $adminordered;
$users = array();
$groups = array();
foreach ($adminlist as $user) {
if ($user['valid']) {
$users[] = $user['user'];
} else {
$groups[] = $user;
}
}
$gallery = new Gallery();
$albumlist = array();
foreach ($gallery->getAlbums() as $folder) {
if (hasDynamicAlbumSuffix($folder)) {
$name = substr($folder, 0, -4);
// Strip the .'.alb' suffix
} else {
$name = $folder;
}
$albumlist[$name] = $folder;
}
?>
<p>
<?php
echo gettext("Set group rights and select one or more albums for the users in the group to manage. Users with <em>User admin</em> or <em>Manage all albums</em> rights can manage all albums. All others may manage only those that are selected.");
?>
</p>
<form action="?action=savegroups&tab=groups" method="post" autocomplete="off" onsubmit="return checkSubmit()" >
示例7: Album
echo "\n</div>";
}
}
$albumdir = "";
if (isset($_GET['album'])) {
$folder = sanitize_path($_GET['album']);
$album = new Album($gallery, $folder);
if ($album->isMyItem(ALBUM_RIGHTS)) {
$albums = $album->getAlbums();
$pieces = explode('/', $folder);
$albumdir = "&album=" . pathurlencode($folder) . '&tab=subalbuminfo';
} else {
$albums = array();
}
} else {
$albumsprime = $gallery->getAlbums();
$albums = array();
foreach ($albumsprime as $folder) {
// check for rights
$album = new Album($gallery, $folder);
if ($album->isMyItem(ALBUM_RIGHTS)) {
$albums[] = $folder;
}
}
}
?>
<h1><?php
echo gettext("Edit All Albums in");
?>
<?php
if (!isset($_GET['album'])) {
示例8: array
echo "\n</head>";
echo "\n<body>";
printLogoAndLinks();
echo "\n" . '<div id="main">';
printTabs();
echo "\n" . '<div id="content">';
$galleryTheme = $_zp_gallery->getCurrentTheme();
$themelist = array();
if (zp_loggedin(ADMIN_RIGHTS)) {
$gallery_title = $_zp_gallery->getTitle();
if ($gallery_title != gettext("Gallery")) {
$gallery_title .= ' (' . gettext("Gallery") . ')';
}
$themelist[$gallery_title] = '';
}
$albums = $_zp_gallery->getAlbums(0);
foreach ($albums as $alb) {
$album = newAlbum($alb);
if ($album->isMyItem(THEMES_RIGHTS)) {
$key = $album->getTitle();
if ($key != $alb) {
$key .= " ({$alb})";
}
$themelist[$key] = $alb;
}
}
if (!empty($_REQUEST['themealbum'])) {
$alb = sanitize_path($_REQUEST['themealbum']);
$album = newAlbum($alb);
$albumtitle = $album->getTitle();
$themename = $album->getAlbumTheme();
示例9: genAlbumUploadList
function genAlbumUploadList(&$list, $curAlbum = NULL)
{
$gallery = new Gallery();
$albums = array();
if (is_null($curAlbum)) {
$albumsprime = $gallery->getAlbums(0);
foreach ($albumsprime as $album) {
// check for rights
$albumobj = new Album($gallery, $album);
if ($albumobj->isMyItem(UPLOAD_RIGHTS)) {
$albums[] = $album;
}
}
} else {
$albums = $curAlbum->getAlbums(0);
}
if (is_array($albums)) {
foreach ($albums as $folder) {
$album = new Album($gallery, $folder);
if (!$album->isDynamic()) {
$list[$album->getFolder()] = $album->getTitle();
genAlbumUploadList($list, $album);
/* generate for subalbums */
}
}
}
}