本文整理汇总了PHP中zpFormattedDate函数的典型用法代码示例。如果您正苦于以下问题:PHP zpFormattedDate函数的具体用法?PHP zpFormattedDate怎么用?PHP zpFormattedDate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zpFormattedDate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sitemap_printAvailableSitemaps
function sitemap_printAvailableSitemaps()
{
$cachefolder = SERVERPATH . '/cache_html/sitemap/';
$dirs = array_diff(scandir($cachefolder), array('.', '..', '.DS_Store', 'Thumbs.db', '.htaccess', '.svn'));
echo '<h2>' . gettext('Available sitemap files:') . '</h2>';
if (!$dirs) {
echo '<p>' . gettext('No sitemap files available.') . '</p>';
} else {
echo '<ol>';
foreach ($dirs as $dir) {
$filemtime = filemtime($cachefolder . $dir);
$lastchange = zpFormattedDate(DATE_FORMAT, $filemtime);
echo '<li>' . $dir . ' (<small>' . $lastchange . ')</small>';
//<a class="colorbox" href="'.FULLWEBPATH.'/cache_html/sitemap/'.$dir.'">Preview</a></li>';
}
echo '</ol>';
}
}
示例2: printNewsTitle
<div class="news-preview">
<div class="news-preview-title">
<span><?php
printNewsTitle();
?>
</span>
</div>
<div class="news-preview-content">
<?php
echo ThemeUtil::clean(getNewsContent(), FALSE, 120, FALSE);
?>
</div>
</div>
</div>
<?php
ThemeUtil::$script .= 'news.push({' . ' "titleLink": \'' . $_zp_current_zenpage_news->getTitleLink() . '\',' . ' "title": \'' . ThemeUtil::clean(getNewsTitle(), FALSE) . '\',' . ' "content": \'' . ThemeUtil::clean(getNewsContent()) . '\',' . ' "date": ' . zpFormattedDate("{day: %d, month: '%b', year: %Y}", strtotime($_zp_current_zenpage_news->getDateTime())) . ', ' . ' "categories": \'' . ThemeUtil::clean(NewsUtil::printNewsCategories(',', false, false), FALSE) . '\', ' . ' "commentson": ' . (NewsUtil::commentsAllowed() ? "true" : "false") . "," . ' "commentCount": ' . $_zp_current_zenpage_news->getCommentCount() . '}); ';
$u++;
}
ThemeUtil::$script .= $sel;
?>
</div>
<?php
echo isset($prevNext['next']) ? $prevNext['next'] : "<div id='news-nav-next' class='proxy'></div>";
?>
<div id="page-filler" class="opa20"> </div>
</div>
<div id="workaround-non-xml-comment-crap" style="display: none;"></div>
示例3: zpFormattedDate
?>
<?php
if (function_exists('getCommentCount')) {
if ($obj->getCommentsAllowed() && $obj->getCommentCount() > 0) {
?>
<div class="album-com-count"><i class="fa fa-comments"></i><span> <?php
echo $obj->getCommentCount();
?>
</span></div>
<?php
}
}
?>
</div>
<div class="album-date"><?php
echo zpFormattedDate(DATE_FORMAT, strtotime($obj->getDateTime()));
?>
</div>
<h3 class="album-title"><?php
echo html_encode($obj->getTitle());
?>
</h3>
</div>
</a>
<?php
$count++;
}
?>
</div>
</div>
</div>
示例4: getItemGallery
/**
* Gets the feed item data in a gallery feed
*
* @param object $item Object of an image or album
* @return array
*/
protected function getItemGallery($item)
{
if ($this->mode == "albums") {
$albumobj = newAlbum($item['folder']);
$totalimages = $albumobj->getNumImages();
$itemlink = $this->host . $albumobj->getLink();
$thumb = $albumobj->getAlbumThumbImage();
$thumburl = '<img border="0" src="' . PROTOCOL . '://' . $this->host . html_encode(pathurlencode($thumb->getCustomImage($this->imagesize, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . '" alt="' . html_encode($albumobj->getTitle($this->locale)) . '" />';
$title = $albumobj->getTitle($this->locale);
if (true || $this->sortorder == "latestupdated") {
$filechangedate = filectime(ALBUM_FOLDER_SERVERPATH . internalToFilesystem($albumobj->name));
$latestimage = query_single_row("SELECT mtime FROM " . prefix('images') . " WHERE albumid = " . $albumobj->getID() . " AND `show` = 1 ORDER BY id DESC");
if ($latestimage && $this->sortorder == 'latestupdated') {
$count = db_count('images', "WHERE albumid = " . $albumobj->getID() . " AND mtime = " . $latestimage['mtime']);
} else {
$count = $totalimages;
}
if ($count != 0) {
$imagenumber = sprintf(ngettext('%s (%u image)', '%s (%u images)', $count), $title, $count);
} else {
$imagenumber = $title;
}
$feeditem['desc'] = '<a title="' . $title . '" href="' . PROTOCOL . '://' . $itemlink . '">' . $thumburl . '</a>' . '<p>' . html_encode($imagenumber) . '</p>' . $albumobj->getDesc($this->locale) . '<br />' . sprintf(gettext("Last update: %s"), zpFormattedDate(DATE_FORMAT, $filechangedate));
} else {
if ($totalimages != 0) {
$imagenumber = sprintf(ngettext('%s (%u image)', '%s (%u images)', $totalimages), $title, $totalimages);
}
$feeditem['desc'] = '<a title="' . html_encode($title) . '" href="' . PROTOCOL . '://' . $itemlink . '">' . $thumburl . '</a>' . $item->getDesc($this->locale) . '<br />' . sprintf(gettext("Date: %s"), zpFormattedDate(DATE_FORMAT, $item->get('mtime')));
}
$ext = getSuffix($thumb->localpath);
} else {
$ext = getSuffix($item->localpath);
$albumobj = $item->getAlbum();
$itemlink = $this->host . $item->getLink();
$fullimagelink = $this->host . html_encode(pathurlencode($item->getFullImageURL()));
$thumburl = '<img border="0" src="' . PROTOCOL . '://' . $this->host . html_encode(pathurlencode($item->getCustomImage($this->imagesize, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . '" alt="' . $item->getTitle($this->locale) . '" /><br />';
$title = $item->getTitle($this->locale);
$albumtitle = $albumobj->getTitle($this->locale);
$datecontent = '<br />Date: ' . zpFormattedDate(DATE_FORMAT, $item->get('mtime'));
if ($ext == "flv" || $ext == "mp3" || $ext == "mp4" || $ext == "3gp" || $ext == "mov" and $this->mode != "album") {
$feeditem['desc'] = '<a title="' . html_encode($title) . ' in ' . html_encode($albumobj->getTitle($this->locale)) . '" href="' . PROTOCOL . '://' . $itemlink . '">' . $thumburl . '</a>' . $item->getDesc($this->locale) . $datecontent;
} else {
$feeditem['desc'] = '<a title="' . html_encode($title) . ' in ' . html_encode($albumobj->getTitle($this->locale)) . '" href="' . PROTOCOL . '://' . $itemlink . '"><img src="' . PROTOCOL . '://' . $this->host . html_encode(pathurlencode($item->getCustomImage($this->imagesize, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . '" alt="' . html_encode($title) . '" /></a>' . $item->getDesc($this->locale) . $datecontent;
}
}
// title
if ($this->mode != "albums") {
$feeditem['title'] = sprintf('%1$s (%2$s)', $item->getTitle($this->locale), $albumobj->getTitle($this->locale));
} else {
$feeditem['title'] = $imagenumber;
}
//link
$feeditem['link'] = PROTOCOL . '://' . $itemlink;
// enclosure
$feeditem['enclosure'] = '';
if (getOption("RSS_enclosure") and $this->mode != "albums") {
$feeditem['enclosure'] = '<enclosure url="' . PROTOCOL . '://' . $fullimagelink . '" type="' . getMimeString($ext) . '" length="' . filesize($item->localpath) . '" />';
}
//category
if ($this->mode != "albums") {
$feeditem['category'] = html_encode($albumobj->getTitle($this->locale));
} else {
$feeditem['category'] = html_encode($albumobj->getTitle($this->locale));
}
//media content
$feeditem['media_content'] = '';
$feeditem['media_thumbnail'] = '';
if (getOption("RSS_mediarss") and $this->mode != "albums") {
$feeditem['media_content'] = '<media:content url="' . PROTOCOL . '://' . $fullimagelink . '" type="image/jpeg" />';
$feeditem['media_thumbnail'] = '<media:thumbnail url="' . PROTOCOL . '://' . $fullimagelink . '" width="' . $this->imagesize . '" height="' . $this->imagesize . '" />';
}
//date
if ($this->mode != "albums") {
$feeditem['pubdate'] = date("r", strtotime($item->getDateTime()));
} else {
$feeditem['pubdate'] = date("r", strtotime($albumobj->getDateTime()));
}
return $feeditem;
}
示例5: zpFormattedDate
?>
"
commentCount="<?php
echo $_zp_current_zenpage_news->getCommentCount();
?>
">
<div class='date' day="<?php
echo zpFormattedDate('%e', $dt);
?>
"
month="<?php
echo zpFormattedDate('%b', $dt);
?>
"
year="<?php
echo zpFormattedDate('%Y', $dt);
?>
"/>
<div class='content'><?php
echo getNewsContent();
?>
</div>
<div class='categories'><?php
echo ThemeUtil::clean(NewsUtil::printNewsCategories(',', false, false), FALSE);
?>
</div>
<div class='preview'><?php
echo ThemeUtil::clean(getNewsContent(), FALSE, 120, FALSE);
?>
</div>
</div>
示例6: copyThemeDirectory
/**
* Copy a theme directory to create a new custom theme
*
* @param $source source directory
* @param $target target directory
* @return bool|string either true or an error message
* @author Ozh
* @since 1.3
*/
function copyThemeDirectory($source, $target, $newname)
{
global $_zp_current_admin_obj;
$message = true;
$source = SERVERPATH . '/themes/' . internalToFilesystem($source);
$target = SERVERPATH . '/themes/' . internalToFilesystem($target);
// If the target theme already exists, nothing to do.
if (is_dir($target)) {
return gettext('Cannot create new theme.') . ' ' . sprintf(gettext('Directory "%s" already exists!'), basename($target));
}
// If source dir is missing, exit too
if (!is_dir($source)) {
return gettext('Cannot create new theme.') . ' ' . sprintf(gettext('Cannot find theme directory "%s" to copy!'), basename($source));
}
// We must be able to write to the themes dir.
if (!is_writable(dirname($target))) {
return gettext('Cannot create new theme.') . ' ' . gettext('The <tt>/themes</tt> directory is not writable!');
}
// We must be able to create the directory
if (!mkdir($target, CHMOD_VALUE)) {
return gettext('Cannot create new theme.') . ' ' . gettext('Could not create directory for the new theme');
}
chmod($target, CHMOD_VALUE);
// Get a list of files to copy: get all files from the directory, remove those containing '/.svn/'
$source_files = array_filter(listDirectoryFiles($source), create_function('$str', 'return strpos($str, "/.svn/") === false;'));
// Determine nested (sub)directories structure to create: go through each file, explode path on "/"
// and collect every unique directory
$dirs_to_create = array();
foreach ($source_files as $path) {
$path = dirname(str_replace($source . '/', '', $path));
$path = explode('/', $path);
$dirs = '';
foreach ($path as $subdir) {
if ($subdir == '.svn' or $subdir == '.') {
continue 2;
}
$dirs = "{$dirs}/{$subdir}";
$dirs_to_create[$dirs] = $dirs;
}
}
/*
Example result for theme 'effervescence_plus': $dirs_to_create = array (
'/styles' => '/styles',
'/scripts' => '/scripts',
'/images' => '/images',
'/images/smooth' => '/images/smooth',
'/images/slimbox' => '/images/slimbox',
);
*/
// Create new directory structure
foreach ($dirs_to_create as $dir) {
mkdir("{$target}/{$dir}", CHMOD_VALUE);
chmod("{$target}/{$dir}", CHMOD_VALUE);
// Using chmod as PHP doc suggested: "Avoid using umask() in multithreaded webservers. It is better to change the file permissions with chmod() after creating the file."
}
// Now copy every file
foreach ($source_files as $file) {
$newfile = str_replace($source, $target, $file);
if (!copy("{$file}", "{$newfile}")) {
return sprintf(gettext("An error occurred while copying files. Please delete manually the new theme directory '%s' and retry or copy files manually."), basename($target));
}
chmod("{$newfile}", CHMOD_VALUE);
}
// Rewrite the theme header.
if (file_exists($target . '/theme_description.php')) {
$theme_description = array();
require $target . '/theme_description.php';
$theme_description['desc'] = sprintf(gettext('Your theme, based on theme %s'), $theme_description['name']);
} else {
$theme_description['desc'] = gettext('Your theme');
}
$theme_description['name'] = $newname;
$theme_description['author'] = $_zp_current_admin_obj->getUser();
$theme_description['version'] = '1.0';
$theme_description['date'] = zpFormattedDate(DATE_FORMAT, time());
$description = sprintf('<' . '?php
// Zenphoto theme definition file
$theme_description["name"] = "%s";
$theme_description["author"] = "%s";
$theme_description["version"] = "%s";
$theme_description["date"] = "%s";
$theme_description["desc"] = "%s";
?' . '>', html_encode($theme_description['name']), html_encode($theme_description['author']), html_encode($theme_description['version']), html_encode($theme_description['date']), html_encode($theme_description['desc']));
$f = fopen($target . '/theme_description.php', 'w');
if ($f !== FALSE) {
@fwrite($f, $description);
fclose($f);
$message = gettext('New custom theme created successfully!');
} else {
$message = gettext('New custom theme created, but its description could not be updated');
}
//.........这里部分代码省略.........
示例7: RSS_Display
function RSS_Display($url, $size = 15, $site = 0)
{
$opened = false;
$page = "";
$site = intval($site) == 0 ? 1 : 0;
if ($size <= 0) {
return '';
}
$recents = array_slice(RSS_Retrieve($url), $site, $size + 1 - $site);
foreach ($recents as $article) {
$type = $article["type"];
if ($type == 0) {
if ($opened) {
$page .= "</ul>\n";
$opened = false;
}
$page .= "<b />";
} else {
if (!$opened) {
$page .= "<ul>\n";
$opened = true;
}
}
$title = $article["title"];
$format = DATE_FORMAT;
$date = zpFormattedDate($format, strtotime($article["pubDate"]));
$link = $article["link"];
$description = $article["description"];
$page .= "<li><a href=\"{$link}\"><strong>{$title}</strong> ({$date})</a>";
if ($description != false) {
$page .= "<br />{$description}";
}
$page .= "</li>\n";
if ($type == 0) {
$page .= "<br />";
}
}
if ($opened) {
$page .= "</ul>\n";
}
return $page . "\n";
}
示例8: getSearchDate
/**
* Returns the date of the search
*
* @param string $format formatting of the date, default 'F Y'
* @return string
* @since 1.1
*/
function getSearchDate($format = '%B %Y')
{
if (in_context(ZP_SEARCH)) {
global $_zp_current_search;
$date = $_zp_current_search->getSearchDate();
if (empty($date)) {
return "";
}
if ($date == '0000-00') {
return gettext("no date");
}
$dt = strtotime($date . "-01");
return zpFormattedDate($format, $dt);
}
return false;
}
示例9: printImageStatistic
<?php
if ($zpmin_albumorimage == 'image') {
printImageStatistic(1, $zpmin_functionoption, '', true, true, false, 40, '', 535, 535, false);
} else {
if ($zpmin_albumorimage == 'album') {
printAlbumStatistic(1, $zpmin_functionoption, true, true, false, 40, '', 535, 535, false);
} else {
$randomImage = getRandomImages($zpmin_functionoption);
if (is_object($randomImage) && $randomImage->exists) {
$randomImageURL = html_encode($randomImage->getLink());
echo '<a href="' . $randomImageURL . '" title="' . sprintf(gettext('View image: %s'), html_encode($randomImage->getTitle())) . '">';
$html = "<img src=\"" . html_encode($randomImage->getCustomImage(535, NULL, NULL, NULL, NULL, NULL, NULL, TRUE)) . "\" alt=\"" . html_encode($randomImage->getTitle()) . "\" />\n";
echo zp_apply_filter('custom_image_html', $html, false);
echo "</a>";
echo '<h3><a href="' . $randomImageURL . '" title="' . sprintf(gettext('View image: %s'), html_encode($randomImage->getTitle())) . '">' . html_encode($randomImage->getTitle()) . '</a></h3>';
echo "<p>" . zpFormattedDate(getOption('date_format'), strtotime($randomImage->getDateTime())) . "</p>";
} else {
echo gettext('No Images Exist...');
}
}
}
?>
<div id="enter">
<a href="<?php
echo getCustomPageURL('gallery');
?>
" title="<?php
echo gettext('Gallery Index');
?>
"><?php
echo gettext('Enter Gallery →');
示例10: printImageStatistic
/**
* Prints image statistic according to $option as an unordered HTML list
* A css id is attached by default named accordingly'$option'
*
* @param string $number the number of albums to get
* @param string $option "popular" for the most popular images,
* "latest" for the latest uploaded,
* "latest-date" for the latest uploaded, but fetched by date,
* "latest-mtime" for the latest uploaded, but fetched by mtime,
* "mostrated" for the most voted,
* "toprated" for the best voted
* @param string $albumfolder foldername of an specific album
* @param bool $showtitle if the image title should be shown
* @param bool $showdate if the image date should be shown
* @param bool $showdesc if the image description should be shown
* @param integer $desclength the length of the description to be shown
* @param string $showstatistic "hitcounter" for showing the hitcounter (views),
* "rating" for rating,
* "rating+hitcounter" for both.
* @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
* @param integer $height the height/cropheight of the thumb if crop=true else not used. (Default 85px)
* @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
* @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
*
* @return string
*/
function printImageStatistic($number, $option, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = 85, $height = 85, $crop = true, $collection = false)
{
$images = getImageStatistic($number, $option, $albumfolder, $collection);
echo "\n<div id=\"{$option}\">\n";
echo "<ul>";
foreach ($images as $image) {
echo "<li><a href=\"" . html_encode($image->getImageLink()) . "\" title=\"" . html_encode($image->getTitle()) . "\">\n";
if ($crop) {
echo "<img src=\"" . html_encode($image->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE)) . "\" alt=\"" . html_encode($image->getTitle()) . "\" /></a>\n";
} else {
echo "<img src=\"" . html_encode($image->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE)) . "\" alt=\"" . html_encode($image->getTitle()) . "\" /></a>\n";
}
if ($showtitle) {
echo "<h3><a href=\"" . html_encode($image->getImageLink()) . "\" title=\"" . html_encode($image->getTitle()) . "\">\n";
echo $image->getTitle() . "</a></h3>\n";
}
if ($showdate) {
echo "<p>" . zpFormattedDate(DATE_FORMAT, strtotime($image->getDateTime())) . "</p>";
}
if ($showstatistic === "rating" or $showstatistic === "rating+hitcounter") {
$votes = $image->get("total_votes");
$value = $image->get("total_value");
if ($votes != 0) {
$rating = round($value / $votes, 1);
}
echo "<p>" . sprintf(gettext('Rating: %1$u (Votes: %2$u)'), $rating, $votes) . "</p>";
}
if ($showstatistic === "hitcounter" or $showstatistic === "rating+hitcounter") {
$hitcounter = $image->get("hitcounter");
if (empty($hitcounter)) {
$hitcounter = "0";
}
echo "<p>" . sprintf(gettext("Views: %u"), $hitcounter) . "</p>";
}
if ($showdesc) {
echo shortenContent($image->getDesc(), $desclength, ' (...)');
}
echo "</li>";
}
echo "</ul></div>\n";
}
示例11: printLatestNewsCustom
function printLatestNewsCustom($number = 5, $category = '', $showdate = true, $showcontent = true, $contentlength = 70, $showcat = true)
{
global $_zp_gallery, $_zp_current_article;
$latest = getLatestNews($number, $category);
echo "\n<div id=\"latestnews-spotlight\">\n";
$count = "";
foreach ($latest as $item) {
$count++;
$category = "";
$categories = "";
$obj = newArticle($item['titlelink']);
$title = htmlspecialchars($obj->getTitle());
$link = getNewsURL($item['titlelink']);
$count2 = 0;
$category = $obj->getCategories();
foreach ($category as $cat) {
$catobj = new Category($cat['titlelink']);
$count2++;
if ($count2 != 1) {
$categories = $categories . "; ";
}
$categories = $categories . $catobj->getTitle();
}
$content = strip_tags($obj->getContent());
$date = zpFormattedDate(getOption('date_format'), strtotime($item['date']));
$type = 'news';
echo "<div>";
echo "<h3><a href=\"" . $link . "\" title=\"" . strip_tags(htmlspecialchars($title, ENT_QUOTES)) . "\">" . htmlspecialchars($title) . "</a></h3>\n";
echo "<div class=\"newsarticlecredit\">\n";
echo "<span class=\"latestnews-date\">" . $date . "</span>\n";
echo "<span class=\"latestnews-cats\">| Posted in " . $categories . "</span>\n";
echo "</div>\n";
echo "<p class=\"latestnews-desc\">" . html_encode(getContentShorten($content, $contentlength, '(...)', null, null)) . "</p>\n";
echo "</div>\n";
if ($count == $number) {
break;
}
}
echo "</div>\n";
}
示例12: sprintf
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)) . ']]>';
} else {
if ($totalimages == 1) {
$imagenumber = sprintf(gettext('%s (1 image)'), $title);
} else {
$imagenumber = sprintf(gettext('%1$s (%2$s images)'), $title, $totalimages);
}
$itemcontent = '<![CDATA[<a title="' . html_encode($title) . '" href="' . $protocol . '://' . $itemlink . '">' . $thumburl . '</a>' . html_encode(get_language_string($albumitem->get("desc"), $locale)) . ']]>';
$datecontent = '<![CDATA[' . sprintf(gettext("Date: %s"), zpFormattedDate(DATE_FORMAT, $albumitem->get('mtime'))) . ']]>';
}
$ext = strtolower(strrchr($thumb->filename, "."));
}
$mimetype = getMimeType($ext);
?>
<item>
<title><?php
if ($rssmode != "albums") {
html_encode(printf('%1$s (%2$s)', get_language_string($item->get("title"), $locale), get_language_string($albumobj->get("title"), $locale)));
} else {
echo html_encode($imagenumber);
}
?>
</title>
<link>
示例13: getImageStatistic
</managingEditor>
<webMaster><?php
echo "{$adminemail} ({$adminname})";
?>
</webMaster>
<?php
$result = getImageStatistic($items, getOption("feed_sortorder"), $albumfolder, $collection);
foreach ($result as $image) {
$ext = strtolower(strrchr($image->filename, "."));
$albumobj = $image->getAlbum();
$imagelink = $host . WEBPATH . $albumpath . $albumobj->name . $imagepath . $image->filename . $modrewritesuffix;
$fullimagelink = $host . WEBPATH . "/albums/" . $albumobj->name . "/" . $image->filename;
$thumburl = '<img border="0" src="' . $image->getCustomImage($size, NULL, NULL, NULL, NULL, NULL, NULL, TRUE) . '" alt="' . $image->getTitle() . '" />';
$imagecontent = '<![CDATA[<a title="' . $image->getTitle() . ' in ' . $albumobj->getTitle() . '" href="http://' . $imagelink . '">' . $thumburl . '</a><p>' . $image->getDesc() . '</p>]]>';
$videocontent = '<![CDATA[<a title="' . $image->getTitle() . ' in ' . $albumobj->getTitle() . '" href="http://' . $imagelink . '">' . $image->filename . '</a><p>' . $image->getDesc() . '</p>]]>';
$datecontent = '<![CDATA[Date: ' . zpFormattedDate(getOption('date_format'), $image->get('mtime')) . ']]>';
switch ($ext) {
case ".flv":
$mimetype = "video/x-flv";
break;
case ".mp3":
$mimetype = "audio/mpeg";
break;
case ".mp4":
$mimetype = "video/mpeg";
break;
case ".3gp":
$mimetype = "video/3gpp";
break;
case ".mov":
$mimetype = "video/quicktime";
示例14: create
/**
* Creates a zip file of the album
*
* @param string $albumname album folder
* @param bool fromcache if true, images will be the "sized" image in the cache file
*/
static function create($albumname, $fromcache)
{
global $_zp_zip_list, $_zp_gallery, $defaultSize;
$album = newAlbum($albumname);
if (!$album->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumname)) {
self::pageError(403, gettext("Forbidden"));
}
if (!$album->exists) {
self::pageError(404, gettext('Album not found'));
}
$_zp_zip_list = array();
if ($fromcache) {
$opt = array('large_file_size' => 5 * 1024 * 1024, 'comment' => sprintf(gettext('Created from cached images of %1$s on %2$s.'), $album->name, zpFormattedDate(DATE_FORMAT, time())));
loadLocalOptions(false, $_zp_gallery->getCurrentTheme());
$defaultSize = getOption('image_size');
self::AddAlbumCache($album, strlen($albumname), SERVERPATH . '/' . CACHEFOLDER . '/' . $albumname);
} else {
$opt = array('large_file_size' => 5 * 1024 * 1024, 'comment' => sprintf(gettext('Created from images in %1$s on %2$s.'), $album->name, zpFormattedDate(DATE_FORMAT, time())));
self::AddAlbum($album, strlen($albumname), SERVERPATH . '/' . ALBUMFOLDER . '/' . $albumname);
}
$zip = new ZipStream($albumname . '.zip', $opt);
foreach ($_zp_zip_list as $path => $file) {
@set_time_limit(6000);
$zip->add_file_from_path(internalToFilesystem($file), internalToFilesystem($path));
}
$zip->finish();
}
示例15: printRelatedItems
//.........这里部分代码省略.........
$obj = new ZenpagePage($item['name']);
$url = $obj->getLink();
$text = $obj->getContent();
$category = gettext('Page');
break;
}
?>
<?php
if ($thumb) {
$thumburl = false;
switch ($item['type']) {
case 'albums':
$thumburl = $obj->getThumb();
break;
case 'images':
$thumburl = $obj->getThumb();
break;
}
if ($thumburl) {
?>
<a href="<?php
echo html_encode(pathurlencode($url));
?>
" title="<?php
echo html_encode($obj->getTitle());
?>
" class="relateditems_thumb">
<img src="<?php
echo html_encode(pathurlencode($thumburl));
?>
" alt="<?php
echo html_encode($obj->getTitle());
?>
" />
</a>
<?php
}
}
?>
<h4><a href="<?php
echo html_encode(pathurlencode($url));
?>
" title="<?php
echo html_encode($obj->getTitle());
?>
"><?php
echo html_encode($obj->getTitle());
?>
</a>
<?php
if ($date) {
switch ($item['type']) {
case 'albums':
case 'images':
$d = $obj->getDateTime();
break;
case 'news':
case 'pages':
$d = $obj->getDateTime();
break;
}
?>
<span class="relateditems_date">
<?php
echo zpFormattedDate(DATE_FORMAT, strtotime($d));
?>
</span>
<?php
}
?>
<?php
if ($type == 'all') {
?>
(<small><?php
echo $category;
?>
</small>)<?php
}
?>
</h4>
<?php
if ($excerpt) {
echo shortenContent($text, $excerpt, '...', true);
}
?>
</li>
<?php
if ($count == $number) {
break;
}
}
// foreach
if ($count) {
?>
</ul>
<?php
}
}
}