本文整理汇总了PHP中Album::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::get方法的具体用法?PHP Album::get怎么用?PHP Album::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAlbum
private function getAlbum()
{
Module::dependencies(isset($_POST['albumID'], $_POST['password']));
$album = new Album($this->database, $this->plugins, $this->settings, $_POST['albumID']);
if ($album->getPublic()) {
# Album public
if ($album->checkPassword($_POST['password'])) {
echo json_encode($album->get());
} else {
echo 'Warning: Wrong password!';
}
} else {
# Album private
echo 'Warning: Album private!';
}
}
示例2: checkAlbumParentid
function checkAlbumParentid($albumname, $id)
{
global $gallery;
$album = new Album($gallery, $albumname);
$oldid = $album->get('parentid');
if ($oldid !== $id) {
$album->set('parentid', $id);
$album->save();
if (is_null($oldid)) {
$oldid = '<em>NULL</em>';
}
if (is_null($id)) {
$id = '<em>NULL</em>';
}
printf('Fixed album <strong>%1$s</strong>: parentid was %2$s should have been %3$s<br />', $albumname, $oldid, $id);
}
$id = $album->id;
$albums = $album->getSubalbums();
foreach ($albums as $albumname) {
checkAlbumParentid($albumname, $id);
}
}
示例3: substr
mysql_query("SET NAMES 'UTF8'");
$r = json_decode(trim(file_get_contents('php://input')), 1);
$url = substr($_SERVER['REQUEST_URI'], strrpos($_SERVER['SCRIPT_NAME'], '/') + 1);
list($url, $params) = explode('?', $url, 2);
$method = $_SERVER['REQUEST_METHOD'];
list($script, $section, $id, $action) = explode('/', $url, 4);
//Находим объект и тип действия
try {
switch ($section) {
case 'files':
//Создаем и инициализируем экземпляр класса для работы с файлами
$sql = new Sql('fotorama');
$album = new Album($_REQUEST, array('tableName' => 'fotorama', 'files' => array(array('field' => 'full', 'dir' => 'files_original/', 'fit' => true, 'width' => 1200, 'height' => 1200, 'ext' => 'jpg'), array('field' => 'img', 'dir' => 'files_image/', 'fit' => 'contain', 'width' => 800, 'height' => 800, 'ext' => 'jpg'), array('field' => 'thumb', 'dir' => 'files_thumb/', 'fit' => 'cover', 'width' => 160, 'height' => 160, 'ext' => 'png')), 'maxSize' => '4M', 'maxSpace' => '100M', 'maxNumberOfFiles' => 100, 'allowedType' => array('jpeg', 'jpg', 'png', 'gif', 'bmp', 'psd', 'psp', 'ai', 'eps', 'cdr', 'mp3', 'mp4', 'wav', 'aac', 'aiff', 'midi', 'avi', 'mov', 'mpg', 'flv', 'mpa', 'pdf', 'txt', 'rtf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'djvu', 'djv', 'bat', 'cmd', 'dll', 'inf', 'ini', 'ocx', 'sys', 'htm', 'html', 'write', 'none', 'zip', 'rar', 'dmg', 'sitx')));
switch ($method) {
case 'GET':
$res = isset($id) ? $album->getOne($id) : $album->get();
break;
case 'PUT':
$res = $album->add();
break;
case 'POST':
$res = isset($id) ? $album->update($id, $r) : $sql->savesort($r['sort']);
break;
case 'DELETE':
$res = $album->delete($id);
break;
}
break;
default:
throw new Exception('Не получен тип действия', 15);
}
示例4: getAlbum
private function getAlbum()
{
Module::dependencies(isset($_POST['albumID']));
$album = new Album($this->database, $this->plugins, $this->settings, $_POST['albumID']);
echo json_encode($album->get());
}
示例5: foreach
function build_autos($items, $data, $user)
{
foreach ($items as $index => &$item) {
if (isset($item['auto'])) {
if (isset($data['urls'][$item['auto']])) {
$item['path'] = $data['urls'][$item['auto']];
} else {
if ($item['auto'] === 'set') {
$item['path'] = '';
}
}
if ($item['auto'] === 'profile') {
switch ($item['id']) {
case 'twitter':
$item['path'] = 'https://twitter.com/' . $user->twitter;
break;
default:
$item['path'] = $user->{$item['id']};
if (empty($item['path'])) {
unset($items[$index]);
continue;
}
break;
}
if (!isset($item['label']) || empty($item['label'])) {
$item['label'] = ucwords($item['id']) . ($item['id'] === 'google' ? '+' : '');
}
} else {
if ($item['auto'] === 'rss') {
$item['path'] = '/feed/' . $item['id'] . ($item['id'] === 'essay' ? 's' : '') . '/recent.rss';
if (!isset($item['label'])) {
$item['label'] = $data['url_data'][$item['id']]['plural'] . ' RSS';
}
} else {
if (preg_match('/s$/', $item['auto']) || $item['auto'] === 'timeline') {
if ($item['auto'] === 'timeline' && isset($item['year'])) {
$item['path'] .= $item['year'] . '/';
if (isset($item['month']) && $item['month'] !== false && $item['month'] !== 'any') {
$m = str_pad($item['month'], 2, '0', STR_PAD_LEFT);
$item['path'] .= $m . '/';
}
}
if (strpos($item['auto'], '_') !== false) {
foreach (array('id', 'slug', 'month', 'year', 'day') as $id) {
if ($id === 'month') {
if (!isset($item['month']) || $item['month'] === 'any' || $item['month'] === false) {
$item['month'] = '';
} else {
$item['month'] = str_pad($item['month'], 2, '0', STR_PAD_LEFT);
}
}
if ($id === 'day' && !isset($item['day'])) {
$item['day'] = '';
}
if ($id === 'slug' && !isset($item['slug']) && isset($item['id'])) {
if (strpos($item['auto'], 'tag_') === 0) {
$item['slug'] = $item['id'];
} else {
$c = new Category();
if (is_numeric($item['id'])) {
$c->select('slug')->get_by_id($item['id']);
$item['slug'] = $c->slug;
} else {
$item['slug'] = $item['id'];
}
}
}
if (isset($item[$id])) {
$item['path'] = str_replace(":{$id}", $item[$id], $item['path']);
}
}
} else {
if (!isset($item['label'])) {
$item['label'] = $data['url_data'][$item['auto'] === 'categories' ? 'category' : rtrim($item['auto'], 's')]['plural'];
}
}
} else {
if ($item['auto'] === 'home') {
if (!isset($item['label'])) {
$item['label'] = $data['url_data']['home'];
}
$item['path'] = '/home/';
} else {
if ($item['auto'] === 'album' || $item['auto'] === 'set') {
$a = new Album();
$a->select('id,slug,created_on,title');
if (is_numeric($item['id'])) {
$a->where('id', $item['id']);
} else {
$a->where('slug', $item['id'])->or_where('internal_id', $item['id']);
}
$a->get();
if (!$a->exists()) {
unset($items[$index]);
continue;
}
$item['path'] = str_replace(':id', $a->id, $item['path']);
$item['path'] = str_replace(':slug', $a->slug, $item['path']);
$item['path'] = str_replace(':year', date('Y', $a->created_on), $item['path']);
$item['path'] = str_replace(':month', date('m', $a->created_on), $item['path']);
//.........这里部分代码省略.........
示例6: getCombiNews
/**
* Gets news articles and images of a gallery to show them together on the news section
*
* NOTE: This function does not exclude articles that are password protected via a category
*
* @param int $articles_per_page The number of articles to get
* @param string $mode "latestimages-thumbnail"
* "latestimages-thumbnail-customcrop"
* "latestimages-sizedimage"
* "latestalbums-thumbnail"
* "latestalbums-thumbnail-customcrop"
* "latestalbums-sizedimage"
* "latestimagesbyalbum-thumbnail"
* "latestimagesbyalbum-thumbnail-customcrop"
* "latestimagesbyalbum-sizedimage"
* "latestupdatedalbums-thumbnail" (for RSS and getLatestNews() used only)
* "latestupdatedalbums-thumbnail-customcrop" (for RSS and getLatestNews() used only)
* "latestupdatedalbums-sizedimage" (for RSS and getLatestNews() used only)
* NOTE: The "latestupdatedalbums" variants do NOT support pagination as required on the news loop!
*
* @param string $published "published" for published articles,
* "unpublished" for un-published articles,
* "all" for all articles
* @param string $sortorder id, date or mtime, only for latestimages-... modes
* @param bool $sticky set to true to place "sticky" articles at the front of the list.
* @return array
*/
function getCombiNews($articles_per_page = '', $mode = '', $published = NULL, $sortorder = '', $sticky = true)
{
deprecated_function_notify(gettext('Use the Zenpage class method instead.'));
global $_zp_gallery, $_zp_flash_player;
processExpired('news');
if (is_null($published)) {
if (zp_loggedin(ZENPAGE_NEWS_RIGHTS)) {
$published = "all";
} else {
$published = "published";
}
}
if (empty($mode)) {
$mode = getOption("zenpage_combinews_mode");
}
if ($published == "published") {
$show = " WHERE `show` = 1 AND date <= '" . date('Y-m-d H:i:s') . "'";
$imagesshow = " AND images.show = 1 ";
} else {
$show = "";
$imagesshow = "";
}
$passwordcheck = "";
if (zp_loggedin(ZENPAGE_NEWS_RIGHTS)) {
$albumWhere = "";
$passwordcheck = "";
} else {
$albumscheck = query_full_array("SELECT * FROM " . prefix('albums') . " ORDER BY title");
foreach ($albumscheck as $albumcheck) {
if (!checkAlbumPassword($albumcheck['folder'])) {
$albumpasswordcheck = " AND albums.id != " . $albumcheck['id'];
$passwordcheck = $passwordcheck . $albumpasswordcheck;
}
}
$albumWhere = "AND albums.show=1" . $passwordcheck;
}
$limit = getLimitAndOffset($articles_per_page);
if (empty($sortorder)) {
$combinews_sortorder = getOption("zenpage_combinews_sortorder");
} else {
$combinews_sortorder = $sortorder;
}
$stickyorder = '';
if ($sticky) {
$stickyorder = 'sticky DESC,';
}
$type3 = query("SET @type3:='0'");
switch ($mode) {
case "latestimages-thumbnail":
case "latestimages-thumbnail-customcrop":
case "latestimages-sizedimage":
$sortorder = "images." . $combinews_sortorder;
$type1 = query("SET @type1:='news'");
$type2 = query("SET @type2:='images'");
switch ($combinews_sortorder) {
case 'id':
case 'date':
$imagequery = "(SELECT albums.folder, images.filename, images.date, @type2, @type3 as sticky FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums\n\t\t\t\t\t\t\tWHERE albums.id = images.albumid " . $imagesshow . $albumWhere . ")";
break;
case 'mtime':
$imagequery = "(SELECT albums.folder, images.filename, FROM_UNIXTIME(images.mtime), @type2, @type3 as sticky FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums\n\t\t\t\t\t\t\tWHERE albums.id = images.albumid " . $imagesshow . $albumWhere . ")";
break;
}
$result = query_full_array("(SELECT title as albumname, titlelink, date, @type1 as type, sticky FROM " . prefix('news') . " " . $show . ")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUNION\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . $imagequery . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY {$stickyorder} date DESC {$limit}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
break;
case "latestalbums-thumbnail":
case "latestalbums-thumbnail-customcrop":
case "latestalbums-sizedimage":
$sortorder = $combinews_sortorder;
$type1 = query("SET @type1:='news'");
$type2 = query("SET @type2:='albums'");
switch ($combinews_sortorder) {
case 'id':
//.........这里部分代码省略.........
示例7: printBarGraph
/**
* Prints a table with a bar graph of the values.
*
* @param string $sortorder "popular", "mostrated","toprated","mostcommented" or - only if $type = "albums"! - "mostimages"
* @param string_type $type "albums", "images", "pages", "news", "tags"
* @param int $limit Number of entries to show
*/
function printBarGraph($sortorder = "mostimages", $type = "albums", $from_number = 0, $to_number = 10)
{
global $gallery, $webpath;
$limit = $from_number . "," . $to_number;
$bargraphmaxsize = 400;
switch ($type) {
case "albums":
$typename = gettext("Albums");
$dbquery = "SELECT * FROM " . prefix('albums');
break;
case "images":
$typename = gettext("Images");
$dbquery = "SELECT * FROM " . prefix('images');
break;
case "pages":
$typename = gettext("Pages");
$dbquery = "SELECT * FROM " . prefix('pages');
break;
case "news":
$typename = gettext("News Articles");
$dbquery = "SELECT * FROM " . prefix('news');
break;
case "newscategories":
$typename = gettext("News Categories");
$dbquery = "SELECT * FROM " . prefix('news_categories');
break;
case "tags":
$typename = gettext("Tags");
break;
case "rss":
$typename = gettext("rss");
break;
}
switch ($sortorder) {
case "mostused":
switch ($type) {
case "tags":
$itemssorted = query_full_array("SELECT tagobj.tagid, count(*) as tagcount, tags.* FROM " . prefix('obj_to_tag') . " AS tagobj, " . prefix('tags') . " AS tags WHERE tags.id=tagobj.tagid GROUP BY tags.id ORDER BY tagcount DESC LIMIT " . $limit);
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['tagcount'];
}
break;
case "newscategories":
$itemssorted = query_full_array("SELECT news2cat.cat_id, count(*) as catcount, cats.* FROM " . prefix('news2cat') . " AS news2cat, " . prefix('news_categories') . " AS cats WHERE cats.id=news2cat.cat_id GROUP BY news2cat.cat_id ORDER BY catcount DESC LIMIT " . $limit);
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['catcount'];
}
break;
}
$headline = $typename . " - " . gettext("most used");
break;
case "popular":
switch ($type) {
case 'rss':
$itemssorted = query_full_array("SELECT `type`,`aux`, `data` FROM " . prefix('plugin_storage') . " WHERE `type` = 'rsshitcounter' ORDER BY CONVERT(data,UNSIGNED) DESC LIMIT " . $limit);
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['data'];
}
break;
default:
$itemssorted = query_full_array($dbquery . " ORDER BY hitcounter DESC LIMIT " . $limit);
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['hitcounter'];
}
break;
}
$headline = $typename . " - " . gettext("most viewed");
break;
case "mostrated":
$itemssorted = query_full_array($dbquery . " ORDER BY total_votes DESC LIMIT " . $limit);
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['total_votes'];
}
$headline = $typename . " - " . gettext("most rated");
break;
case "toprated":
$itemssorted = query_full_array($dbquery . " ORDER BY (total_value/total_votes) DESC LIMIT {$limit}");
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
if ($itemssorted[0]['total_votes'] != 0) {
$maxvalue = $itemssorted[0]['total_value'] / $itemssorted[0]['total_votes'];
} else {
//.........这里部分代码省略.........
示例8: gettext
$('.album_'+id+'_'+what).attr('checked','checked');
}
// ]]> -->
</script>
<form name="publish" action="" method="post"><?php
echo gettext('Images:');
?>
<?php
XSRFToken('schedule_content');
?>
<input type="hidden" name="publish_images" value="true" />
<ul class="scheduleimagechecklist">
<?php
foreach ($publish_images_list as $key => $imagelist) {
$album = new Album($gallery, $key);
$albumid = $album->get('id');
$imagelist = array_flip($imagelist);
natcasesort($imagelist);
$imagelist = array_flip($imagelist);
?>
<li>
<p class="scheduleimagechecklisthead">
<a href="javascript:publishAll(<?php
echo $albumid;
?>
,'p');" title="<?php
echo gettext('Set all to be published');
?>
">
<img src="../images/pass.png" style="border: 0px;" alt="publish all" />
</a>
示例9: addSubalbumMenus
/**
* adds (sub)albums to menu base with their gallery sorting order intact
*
* @param string $menuset chosen menu set
* @param object $gallery a gallery object
* @param int $id table id of the parent.
* @param string $link folder name of the album
* @param string $sort xxx-xxx-xxx style sort order for album
*/
function addSubalbumMenus($menuset, $gallery, $id, $link, $sort)
{
$album = new Album($gallery, $link);
$show = $album->get('show');
$title = $album->getTitle();
$sql = "INSERT INTO " . prefix('menu') . " (`link`,`type`,`title`,`show`,`menuset`,`sort_order`, `parentid`) " . 'VALUES (' . db_quote($link) . ', "album",' . db_quote($album->name) . ', ' . $show . ',' . db_quote($menuset) . ',' . db_quote($sort) . ',' . $id . ')';
$result = query($sql, false);
if ($result) {
$id = db_insert_id();
} else {
$result = query_single_row('SELECT `id` FROM' . prefix('menu') . ' WHERE `type`="album" AND `link`=' . db_quote($link));
$id = $result['id'];
}
if (!$album->isDynamic()) {
$albums = $album->getAlbums();
foreach ($albums as $key => $link) {
addSubalbumMenus($menuset, $gallery, $id, $link, $sort . '-' . sprintf('%03u', $key));
}
}
}
示例10: printBarGraph
/**
* Prints a table with a bar graph of the values.
*
* @param string $sortorder "popular", "mostrated","toprated","mostcommented" or - only if $type = "albums"! - "mostimages"
* @param string_type $type "albums" or "images"
* @param int $limit Number of entries to show
*/
function printBarGraph($sortorder = "mostimages", $type = "albums", $from_number = 0, $to_number = 10)
{
global $gallery, $webpath;
$limit = $from_number . "," . $to_number;
$bargraphmaxsize = 400;
switch ($type) {
case "albums":
$typename = gettext("Albums");
$dbquery = "SELECT id, title, folder, hitcounter, total_votes, total_value, `show` FROM " . prefix('albums');
break;
case "images":
$typename = gettext("Images");
$dbquery = "SELECT id, title, filename, albumid, hitcounter, total_votes, total_value, `show` FROM " . prefix('images');
break;
}
switch ($sortorder) {
case "popular":
$itemssorted = query_full_array($dbquery . " ORDER BY hitcounter DESC LIMIT " . $limit);
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['hitcounter'];
}
$headline = $typename . " - " . gettext("most viewed");
break;
case "mostrated":
$itemssorted = query_full_array($dbquery . " ORDER BY total_votes DESC LIMIT " . $limit);
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['total_votes'];
}
$headline = $typename . " - " . gettext("most rated");
break;
case "toprated":
switch ($type) {
case "albums":
$itemssorted = query_full_array("SELECT * FROM " . prefix('albums') . " ORDER BY (total_value/total_votes) DESC LIMIT {$limit}");
break;
case "images":
$itemssorted = query_full_array("SELECT * FROM " . prefix('images') . " ORDER BY (total_value/total_votes) DESC LIMIT {$limit}");
break;
}
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
if ($itemssorted[0]['total_votes'] != 0) {
$maxvalue = $itemssorted[0]['total_value'] / $itemssorted[0]['total_votes'];
} else {
$maxvalue = 0;
}
}
$headline = $typename . " - " . gettext("top rated");
break;
case "mostcommented":
switch ($type) {
case "albums":
$itemssorted = query_full_array("SELECT comments.ownerid, count(*) as commentcount, albums.* FROM " . prefix('comments') . " AS comments, " . prefix('albums') . " AS albums WHERE albums.id=comments.ownerid AND type = 'albums' GROUP BY comments.ownerid ORDER BY commentcount DESC LIMIT " . $limit);
break;
case "images":
$itemssorted = query_full_array("SELECT comments.ownerid, count(*) as commentcount, images.* FROM " . prefix('comments') . " AS comments, " . prefix('images') . " AS images WHERE images.id=comments.ownerid AND type = 'images' GROUP BY comments.ownerid ORDER BY commentcount DESC LIMIT " . $limit);
break;
}
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['commentcount'];
}
$headline = $typename . " - " . gettext("most commented");
break;
case "mostimages":
$itemssorted = query_full_array("SELECT images.albumid, count(*) as imagenumber, albums.* FROM " . prefix('images') . " AS images, " . prefix('albums') . " AS albums WHERE albums.id=images.albumid GROUP BY images.albumid ORDER BY imagenumber DESC LIMIT " . $limit);
if (empty($itemssorted)) {
$maxvalue = 0;
} else {
$maxvalue = $itemssorted[0]['imagenumber'];
}
$headline = $typename . " - " . gettext("most images");
break;
case "latest":
switch ($type) {
case "albums":
$allalbums = query_full_array($dbquery . " ORDER BY id DESC LIMIT " . $limit);
$albums = array();
foreach ($allalbums as $album) {
$albumobj = new Album($gallery, $album['folder']);
$albumentry = array("id" => $albumobj->get('id'), "title" => $albumobj->getTitle(), "folder" => $albumobj->name, "imagenumber" => $albumobj->getNumImages(), "show" => $albumobj->get("show"));
array_unshift($albums, $albumentry);
}
$maxvalue = 0;
if (empty($albums)) {
$itemssorted = array();
} else {
//.........这里部分代码省略.........
示例11: processAlbumBulkActions
if (isset($_POST['ids'])) {
$action = processAlbumBulkActions();
if (!empty($action)) {
$action = '&bulkmessage=' . $action;
}
}
header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $action . '&saved' . $notify);
exit;
break;
case 'savesubalbumorder':
XSRFdefender('savealbumorder');
$album = new Album($gallery, $folder);
$album->setSubalbumSortType('manual');
$album->setSortDirection('album', 0);
$album->save();
$notify = postAlbumSort($album->get('id'));
if (isset($_POST['ids'])) {
$action = processAlbumBulkActions();
if (!empty($action)) {
$action = '&bulkmessage=' . $action;
}
}
header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $action . '&album=' . $folder . '&tab=subalbuminfo&saved' . $notify);
exit;
break;
case 'sorttags':
if (isset($_GET['subpage'])) {
$pg = '&subpage=' . $_GET['subpage'];
$tab = '&tab=imageinfo';
} else {
$pg = '';
示例12: strtolower
$ext = strtolower(strrchr($item->filename, "."));
$albumobj = $item->getAlbum();
$itemlink = $host . WEBPATH . $albumpath . pathurlencode($albumobj->name) . $imagepath . pathurlencode($item->filename) . $modrewritesuffix;
$fullimagelink = $host . WEBPATH . "/albums/" . pathurlencode($albumobj->name) . "/" . $item->filename;
$imagefile = "albums/" . $albumobj->name . "/" . $item->filename;
$thumburl = '<img border="0" src="' . $protocol . '://' . $host . $item->getCustomImage($size, NULL, NULL, NULL, NULL, NULL, NULL, TRUE) . '" alt="' . get_language_string(get_language_string($item->get("title"), $locale)) . '" />';
$itemcontent = '<![CDATA[<a title="' . html_encode(get_language_string($item->get("title"), $locale)) . ' in ' . html_encode(get_language_string($albumobj->get("title"), $locale)) . '" href="' . $protocol . '://' . $itemlink . '">' . $thumburl . '</a>' . get_language_string(get_language_string($item->get("desc"), $locale)) . ']]>';
$videocontent = '<![CDATA[<a title="' . html_encode(get_language_string($item->get("title"), $locale)) . ' in ' . html_encode(get_language_string($albumobj->getTitle(), $locale)) . '" href="' . $protocol . '://' . $itemlink . '"><img src="' . $protocol . '://' . $host . $item->getThumb() . '" alt="' . get_language_string(get_language_string($item->get("title"), $locale)) . '" /></a>' . get_language_string(get_language_string($item->get("desc"), $locale)) . ']]>';
$datecontent = '<![CDATA[Date: ' . zpFormattedDate(DATE_FORMAT, $item->get('mtime')) . ']]>';
} else {
$galleryobj = new Gallery();
$albumitem = new Album($galleryobj, $item['folder']);
$totalimages = $albumitem->getNumImages();
$itemlink = $host . WEBPATH . $albumpath . pathurlencode($albumitem->name);
$thumb = $albumitem->getAlbumThumbImage();
$thumburl = '<img border="0" src="' . $thumb->getCustomImage($size, NULL, NULL, NULL, NULL, NULL, NULL, TRUE) . '" alt="' . html_encode(get_language_string($albumitem->get("title"), $locale)) . '" />';
$title = get_language_string($albumitem->get("title"), $locale);
if (true || getOption("feed_sortorder_albums") == "latestupdated") {
$filechangedate = filectime(ALBUM_FOLDER_SERVERPATH . internalToFilesystem($albumitem->name));
$latestimage = query_single_row("SELECT mtime FROM " . prefix('images') . " WHERE albumid = " . $albumitem->getAlbumID() . " AND `show` = 1 ORDER BY id DESC");
$lastuploaded = query("SELECT COUNT(*) FROM " . prefix('images') . " WHERE albumid = " . $albumitem->getAlbumID() . " AND mtime = " . $latestimage['mtime']);
$row = db_fetch_row($lastuploaded);
$count = $row[0];
if ($count == 1) {
$imagenumber = sprintf(gettext('%s (1 new image)'), $title);
} else {
$imagenumber = sprintf(gettext('%1$s (%2$s new images)'), $title, $count);
}
$itemcontent = '<![CDATA[<a title="' . $title . '" href="' . $protocol . '://' . $itemlink . '">' . $thumburl . '</a>' . '<p>' . html_encode($imagenumber) . '</p>' . html_encode(get_language_string($albumitem->get("desc"), $locale)) . ']]>';
$videocontent = '';
$datecontent = '<![CDATA[' . sprintf(gettext("Last update: %s"), zpFormattedDate(DATE_FORMAT, $filechangedate)) . ']]>';
示例13: Gallery
exit;
}
$_zp_gallery = new Gallery();
$albumobj = new Album($_zp_gallery, $album8);
if (!$albumobj->checkAccess() && !zp_loggedin(VIEW_FULLIMAGE_RIGHTS)) {
// handle password form if posted
zp_handle_password('zp_image_auth', getOption('protected_image_password'), getOption('protected_image_user'));
//check for passwords
$hash = getOption('protected_image_password');
$authType = 'zp_image_auth';
$hint = get_language_string(getOption('protected_image_hint'));
$show = getOption('protected_image_user');
if (empty($hash)) {
// check for album password
$hash = $albumobj->getPassword();
$authType = "zp_album_auth_" . $albumobj->get('id');
$hint = $albumobj->getPasswordHint();
$show = $albumobj->getUser();
if (empty($hash)) {
$albumobj = $albumobj->getParent();
while (!is_null($albumobj)) {
$hash = $albumobj->getPassword();
$authType = "zp_album_auth_" . $albumobj->get('id');
$hint = $albumobj->getPasswordHint();
$show = $albumobj->getUser();
if (!empty($hash)) {
break;
}
$albumobj = $albumobj->getParent();
}
}
示例14: printNestedAlbumsList
/**
* Prints the sortable nested albums list
* returns true if nesting levels exceede the database container
*
* @param array $pages The array containing all pages
* @param bool $show_thumb set false to use thumb standin image.
*
* @return bool
*/
function printNestedAlbumsList($albums, $show_thumb)
{
global $gallery;
$indent = 1;
$open = array(1 => 0);
$rslt = false;
foreach ($albums as $album) {
$order = $album['sort_order'];
$level = max(1, count($order));
if ($toodeep = $level > 1 && $order[$level - 1] === '') {
$rslt = true;
}
if ($level > $indent) {
echo "\n" . str_pad("\t", $indent, "\t") . "<ul class=\"page-list\">\n";
$indent++;
$open[$indent] = 0;
} else {
if ($level < $indent) {
while ($indent > $level) {
$open[$indent]--;
$indent--;
echo "</li>\n" . str_pad("\t", $indent, "\t") . "</ul>\n";
}
} else {
// indent == level
if ($open[$indent]) {
echo str_pad("\t", $indent, "\t") . "</li>\n";
$open[$indent]--;
} else {
echo "\n";
}
}
}
if ($open[$indent]) {
echo str_pad("\t", $indent, "\t") . "</li>\n";
$open[$indent]--;
}
$albumobj = new Album($gallery, $album['name']);
if ($albumobj->isDynamic()) {
$nonest = ' class="no-nest"';
} else {
$nonest = '';
}
echo str_pad("\t", $indent - 1, "\t") . "<li id=\"id_" . $albumobj->get('id') . "\"{$nonest} >";
printAlbumEditRow($albumobj, $show_thumb);
$open[$indent]++;
}
while ($indent > 1) {
echo "</li>\n";
$open[$indent]--;
$indent--;
echo str_pad("\t", $indent, "\t") . "</ul>";
}
if ($open[$indent]) {
echo "</li>\n";
} else {
echo "\n";
}
return $rslt;
}
示例15: flowplayerPlaylist
/**
* Show the content of an media album with .flv/.mp4/.mp3 movie/audio files only as a playlist or as separate players with Flowplayer 3
* Important: The Flowplayer 3 plugin needs to be activated to use this plugin. This plugin shares all settings with this plugin, too.
*
* You can either show a 'one player window' playlist or show all items as separate players paginated. See the examples below.
* (set in the settings for thumbs per page) on one page (like on a audio or podcast blog).
*
* There are two usage modes:
*
* a) 'playlist'
* The playlist is meant to replace the 'next_image()' loop on a theme's album.php.
* It can be used with a special 'album theme' that can be assigned to media albums with with .flv/.mp4/.mp3s, although Flowplayer 3 also supports images
* Replace the entire 'next_image()' loop on album.php with this:
* <?php flowplayerPlaylist("playlist"); ?>
*
* This produces the following html:
* <div class="wrapper">
* <a class="up" title="Up"></a>
* <div class="playlist">
* <div class="clips">
* <!-- single playlist entry as an "template" -->
* <a href="${url}">${title}</a>
* </div>
* </div>
* <a class="down" title="Down"></a>
* </div>
* </div>
* This is styled by the css file 'playlist.css" that is located within the 'zp-core/plugins/flowplayer3_playlist/flowplayer3_playlist.css' by default.
* Alternatively you can style it specifically for your theme. Just place a css file named "flowplayer3_playlist.css" in your theme's folder.
*
* b) 'players'
* This displays each audio/movie file as a separate player on album.php.
* If there is no videothumb image for an mp3 file existing only the player control bar is shown.
* Modify the 'next_image()' loop on album.php like this:
* <?php
* while (next_image()):
* flowplayerPlaylist("players");
* endwhile;
* ?>
* Of course you can add further functions to b) like printImageTitle() etc., too.
*
* @param string $option The mode to use "players", "playlist" or "playlist-mp3". "playlist-mp3" is the same as "playlist" except that only the controlbar is shown (if you are too lazy for custom video thumbs and don't like the empty screen)
* @param string $albumfolder For "playlist" mode only: To show a playlist of an specific album directly on another page (for example on index.php). Note: Currently it is not possible to have several playlists on one page
*/
function flowplayerPlaylist($option = "playlist", $albumfolder = "")
{
global $_zp_current_image, $_zp_current_album, $_zp_flash_player;
$curdir = getcwd();
chdir(SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/flowplayer3');
$filelist = safe_glob('flowplayer-*.swf');
$swf = array_shift($filelist);
$filelist = safe_glob('flowplayer.audio-*.swf');
$audio = array_shift($filelist);
$filelist = safe_glob('flowplayer.controls-*.swf');
$controls = array_shift($filelist);
chdir($curdir);
$playlistwidth = getOption('flow_player3_playlistwidth');
$playlistheight = getOption('flow_player3_playlistheight');
switch ($option) {
case 'playlist':
case 'playlist-mp3':
$splashimage = getOption('flow_player3_playlistsplashimage');
if ($option == 'playlist-mp3') {
$playlistheight = FLOW_PLAYER_MP3_HEIGHT;
$splashimage = 'none';
}
if (empty($albumfolder)) {
$albumname = $_zp_current_album->name;
} else {
$albumname = $albumfolder;
}
$album = new Album(new Gallery(), $albumname);
if (getOption("flow_player3_playlistautoplay") == 1) {
$autoplay = 'true';
} else {
$autoplay = 'false';
}
$playlist = $album->getImages();
// slash image fetching
$videoobj = new Video($album, $playlist[0]);
$albumfolder = $album->name;
$splashimagerwidth = $playlistwidth;
$splashimageheight = $playlistheight;
$videoThumbImg = '';
if ($splashimage != 'none') {
switch ($splashimage) {
case 'albumthumb':
$albumthumbobj = $album->getAlbumThumbImage();
getMaxSpaceContainer($splashimagerwidth, $splashimageheight, $albumthumbobj, true);
$albumthumb = $albumthumbobj->getCustomImage(null, $splashimagerwidth, $splashimageheight, null, null, null, null, true);
$videoThumbImg = '<img src="' . pathurlencode($albumthumb) . '" alt="" />';
break;
case 'firstentry':
getMaxSpaceContainer($splashimagerwidth, $splashimageheight, $videoobj, true);
$videoThumb = $videoobj->getCustomImage(null, $splashimagerwidth, $splashimageheight, null, null, null, null, true);
$videoThumbImg = '<img src="' . pathurlencode($videoThumb) . '" alt="" />';
break;
}
}
if ($album->getNumImages() != 0) {
//.........这里部分代码省略.........