本文整理汇总了PHP中zp_apply_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP zp_apply_filter函数的具体用法?PHP zp_apply_filter怎么用?PHP zp_apply_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zp_apply_filter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printHeadingImage
function printHeadingImage($randomImage)
{
global $_zp_themeroot;
$id = getAlbumId();
echo '<div id="randomhead">';
if (is_null($randomImage)) {
echo '<img src="' . $_zp_themeroot . '/images/zen-logo.jpg" alt="' . gettext('There were no images from which to select the random heading.') . '" />';
} else {
$randomAlbum = $randomImage->getAlbum();
$randomAlt1 = $randomAlbum->getTitle();
if ($randomAlbum->getAlbumId() != $id) {
$randomAlbum = $randomAlbum->getParent();
while (!is_null($randomAlbum) && $randomAlbum->getAlbumId() != $id) {
$randomAlt1 = $randomAlbum->getTitle() . ":\n" . $randomAlt1;
$randomAlbum = $randomAlbum->getParent();
}
}
$randomImageURL = html_encode(getURL($randomImage));
if (getOption('allow_upscale')) {
$wide = 620;
$high = 180;
} else {
$wide = min(620, $randomImage->getWidth());
$high = min(180, $randomImage->getHeight());
}
echo "<a href='" . $randomImageURL . "' title='" . gettext('Random picture...') . "'>";
$html = "<img src='" . html_encode($randomImage->getCustomImage(NULL, $wide, $high, $wide, $high, NULL, NULL, !getOption('Watermark_head_image'))) . "' width='{$wide}' height='{$high}' alt=" . '"' . html_encode($randomAlt1) . ":\n" . html_encode($randomImage->getTitle()) . '" />';
$html = zp_apply_filter('custom_image_html', $html, false);
echo $html;
echo '</a>';
}
echo '</div>';
}
示例2: Video
/**
* Constructor for class-video
*
* @param object &$album the owning album
* @param sting $filename the filename of the image
* @return Image
*/
function Video(&$album, $filename)
{
global $_zp_supported_images;
// $album is an Album object; it should already be created.
if (!is_object($album)) {
return NULL;
}
if (!$this->classSetup($album, $filename)) {
// spoof attempt
$this->exists = false;
return;
}
$this->sidecars = $_zp_supported_images;
$this->video = true;
$this->objectsThumb = checkObjectsThumb($album->localpath, $filename);
// Check if the file exists.
if (!file_exists($this->localpath) || is_dir($this->localpath)) {
$this->exists = false;
return;
}
// This is where the magic happens...
$album_name = $album->name;
$this->updateDimensions();
if (parent::PersistentObject('images', array('filename' => $filename, 'albumid' => $this->album->id), 'filename', false, empty($album_name))) {
$this->set('mtime', $ts = filemtime($this->localpath));
$this->updateMetaData();
$this->save();
zp_apply_filter('new_image', $this);
}
}
示例3: css
static function css()
{
global $_zp_gallery;
$inTheme = false;
if (OFFSET_PATH) {
$themepath = 'colorbox_js/themes/example4/colorbox.css';
} else {
$theme = getOption('colorbox_theme');
if (empty($theme)) {
$themepath = 'colorbox_js/themes/example4/colorbox.css';
} else {
if ($theme == 'custom') {
$themepath = zp_apply_filter('colorbox_themepath', 'colorbox_js/colorbox.css');
} else {
$themepath = 'colorbox_js/themes/' . $theme . '/colorbox.css';
}
$inTheme = $_zp_gallery->getCurrentTheme();
}
}
$css = getPlugin($themepath, $inTheme, true);
?>
<link rel="stylesheet" href="<?php
echo $css;
?>
" type="text/css" />
<script type="text/javascript" src="<?php
echo FULLWEBPATH . "/" . ZENFOLDER . '/' . PLUGIN_FOLDER;
?>
/colorbox_js/jquery.colorbox-min.js"></script>
<script>
/* Colorbox resize function */
var resizeTimer;
function resizeColorBox()
{
if (resizeTimer)
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
if (jQuery('#cboxOverlay').is(':visible')) {
jQuery.colorbox.resize({width: '90%', maxHeight: '90%'});
jQuery('#cboxLoadedContent img').css('max-width', '100%').css('height', 'auto');
}
}, 300)
}
// Resize Colorbox when resizing window or changing mobile device orientation
jQuery(window).resize(resizeColorBox);
window.addEventListener("orientationchange", resizeColorBox, false);
</script>
<?php
}
示例4: __construct
function __construct($folder8, $cache = true, $quiet = false)
{
$folder8 = trim($folder8, '/');
$folderFS = internalToFilesystem($folder8);
$localpath = ALBUM_FOLDER_SERVERPATH . $folderFS;
$this->linkname = $this->name = $folder8;
$this->localpath = rtrim($localpath, '/');
if (!($this->exists = AlbumBase::albumCheck($folder8, $folderFS, $quiet, !file_exists($this->localpath) || is_dir($this->localpath)))) {
return;
}
$data = explode("\n", file_get_contents($localpath));
foreach ($data as $param) {
$parts = explode('=', $param);
switch (trim($parts[0])) {
case 'USER':
$owner = trim($parts[1]);
break;
case 'TITLE':
$this->instance = trim($parts[1]);
break;
case 'THUMB':
$this->set('thumb', trim($parts[1]));
break;
}
}
$new = $this->instantiate('albums', array('folder' => $this->name), 'folder', $cache);
$title = $this->getTitle('all');
$desc = $this->getDesc('all');
parent::__construct($owner);
$this->exists = true;
if (!is_dir(stripSuffix($this->localpath))) {
$this->linkname = stripSuffix($folder8);
}
$this->name = $folder8;
$this->setTitle($title);
$this->setDesc($desc);
if ($new) {
$title = $this->get('title');
$this->set('title', stripSuffix($title));
// Strip the suffix
$this->setDateTime(strftime('%Y-%m-%d %H:%M:%S', $this->get('mtime')));
$this->save();
zp_apply_filter('new_album', $this);
}
zp_apply_filter('album_instantiate', $this);
}
示例5: __construct
/**
* @param object $album the owner album
* @param string $filename the filename of the media file
*/
function __construct(&$album, $filename) {
global $_zp_supported_images;
// $album is an Album object; it should already be created.
if ( ! is_object($album)) return NULL;
if ( ! $this->classSetup($album, $filename)) { // spoof attempt
$this->exists = FALSE;
return;
}
$this->sidecars = $_zp_supported_images;
$this->objectsThumb = checkObjectsThumb($album->localpath, $filename);
// Check if the file exists.
if ( ! file_exists($this->localpath) || is_dir($this->localpath)) {
$this->exists = FALSE;
return;
}
/* check the file extension, and then set the mediaType if supported */
$extension = substr(strtolower(strrchr($this->localpath,'.')),1);
foreach ($this->mediaTypes AS $t => $l) {
if (in_array($extension,$l)) {
$this->mediaType = $t;
break;
}
}
unset($t,$l);
$this->updateDimensions();
if (parent::PersistentObject('images', array('filename'=>$filename, 'albumid'=>$this->album->id), 'filename', FALSE, FALSE)) {
$this->set('mtime', $ts = filemtime($this->localpath));
$this->updateMetaData();
$this->save();
zp_apply_filter('new_image', $this);
}
}
示例6: printContactForm
<?php
printContactForm();
?>
</div>
</div>
<!-- Footer -->
<div class="footlinks">
<?php
printThemeInfo();
?>
<?php
printZenphotoLink();
?>
</div> <!-- footerlinks -->
<?php
zp_apply_filter('theme_body_close');
?>
</body>
</html>
<?php
} else {
include SERVERPATH . '/' . ZENFOLDER . '/404.php';
}
示例7: printLogoAndLinks
</head>
<body>
<?php
printLogoAndLinks();
?>
<div id="main">
<?php
printTabs();
?>
<div id="content">
<?php
printSubtabs('Mailing');
?>
<div class="tabbox">
<?php
zp_apply_filter('admin_note', 'user_mailing', '');
?>
<h1><?php
echo gettext('User mailing list');
?>
</h1>
<p><?php
echo gettext("A tool to send e-mails to all registered users who have provided an e-mail address. There is always a copy sent to the current admin and all e-mails are sent as <em>blind copies</em>.");
?>
</p>
<?php
if (!zp_has_filter('sendmail')) {
$disabled = ' disabled="disabled"';
?>
<p class="notebox">
<?php
示例8: printLogoAndLinks
<?php
printLogoAndLinks();
?>
<div id="main">
<?php
printTabs();
?>
<div id="content">
<div id="container">
<?php
$subtab = printSubtabs();
?>
<div class="tabbox">
<?php
zp_apply_filter('admin_note', 'upload', $subtab);
?>
<h1><?php
echo gettext('File Manager');
?>
</h1>
<?php
$locale = substr(getOption("locale"), 0, 2);
if (empty($locale)) {
$locale = 'en';
}
?>
<iframe src="zp-extensions/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php?language=<?php
echo $locale;
?>
&tab=files" width="100%" height="480" style="border: 0">
示例9: sanitize
$msg = sanitize($_GET['applied']);
if ($msg) {
echo "<div class=\"errorbox space\">";
echo "<h2>" . $msg . "</h2>";
echo "</div>";
} else {
echo '<div class="messagebox fade-message">';
echo "<h2>" . gettext('Processed') . "</h2>";
echo '</div>';
}
}
$subtab = printSubtabs();
?>
<div id="tab_users" class="tabbox">
<?php
zp_apply_filter('admin_note', 'users', $subtab);
$groups = array();
$subscription = 86400 * getOption('user_expiry_interval');
$now = time();
$warnInterval = $now + getOption('user_expiry_warn_interval') * 86400;
?>
<p>
<?php
echo gettext("Manage user expiry.");
?>
</p>
<form action="?action=expiry" method="post" autocomplete="off" >
<?php
XSRFToken('expiry');
?>
<span class="buttons">
示例10: printSlideShowLink
/**
* Prints a link to call the slideshow (not shown if there are no images in the album)
* To be used on album.php and image.php
* A CSS id names 'slideshowlink' is attached to the link so it can be directly styled.
*
* If the mode is set to "jQuery Colorbox" and the Colorbox plugin is enabled this link starts a Colorbox slideshow
* from a hidden HTML list of all images in the album. On album.php it starts with the first always, on image.php with the current image.
*
* @param string $linktext Text for the link
* @param string $linkstyle Style of Text for the link
*/
function printSlideShowLink($linktext = NULL, $linkstyle = Null)
{
global $_zp_gallery, $_zp_current_image, $_zp_current_album, $_zp_current_search, $slideshow_instance, $_zp_gallery_page;
if (is_null($linktext)) {
$linktext = gettext('View Slideshow');
}
if (empty($_GET['page'])) {
$pagenr = 1;
} else {
$pagenr = sanitize_numeric($_GET['page']);
}
$slideshowhidden = '';
$numberofimages = 0;
if (in_context(ZP_SEARCH)) {
$imagenumber = '';
$imagefile = '';
$albumnr = 0;
$slideshowlink = rewrite_path(_PAGE_ . '/slideshow', "index.php?p=slideshow");
$slideshowhidden = '<input type="hidden" name="preserve_search_params" value="' . html_encode($_zp_current_search->getSearchParams()) . '" />';
} else {
if (in_context(ZP_IMAGE)) {
$imagenumber = imageNumber();
$imagefile = $_zp_current_image->filename;
} else {
$imagenumber = '';
$imagefile = '';
}
if (in_context(ZP_SEARCH_LINKED)) {
$albumnr = -$_zp_current_album->getID();
$slideshowhidden = '<input type="hidden" name="preserve_search_params" value="' . html_encode($_zp_current_search->getSearchParams()) . '" />';
} else {
$albumnr = $_zp_current_album->getID();
}
if ($albumnr) {
$slideshowlink = rewrite_path(pathurlencode($_zp_current_album->getFileName()) . '/' . _PAGE_ . '/slideshow', "index.php?p=slideshow&album=" . urlencode($_zp_current_album->getFileName()));
} else {
$slideshowlink = rewrite_path(_PAGE_ . '/slideshow', "index.php?p=slideshow");
$slideshowhidden = '<input type="hidden" name="favorites_page" value="1" />' . "\n" . '<input type="hidden" name="title" value="' . $_myFavorites->instance . '" />';
}
}
$numberofimages = getNumImages();
$option = getOption('slideshow_mode');
switch ($option) {
case 'jQuery':
if ($numberofimages > 1) {
?>
<form name="slideshow_<?php
echo $slideshow_instance;
?>
" method="post" action="<?php
echo zp_apply_filter('getLink', $slideshowlink, 'slideshow.php', NULL);
?>
">
<?php
echo $slideshowhidden;
?>
<input type="hidden" name="pagenr" value="<?php
echo html_encode($pagenr);
?>
" />
<input type="hidden" name="albumid" value="<?php
echo $albumnr;
?>
" />
<input type="hidden" name="numberofimages" value="<?php
echo $numberofimages;
?>
" />
<input type="hidden" name="imagenumber" value="<?php
echo $imagenumber;
?>
" />
<input type="hidden" name="imagefile" value="<?php
echo html_encode($imagefile);
?>
" />
<?php
if (!empty($linkstyle)) {
echo '<p style="' . $linkstyle . '">';
}
?>
<a class="slideshowlink" id="slideshowlink_<?php
echo $slideshow_instance;
?>
" href="javascript:document.slideshow_<?php
echo $slideshow_instance;
?>
.submit()"><?php
echo $linktext;
//.........这里部分代码省略.........
示例11: zp_apply_filter
</table> <!-- single plugin page table -->
<input type="hidden" name="checkForPostTruncation" value="1" />
<?php
}
?>
</form>
</div>
<!-- end of tab_plugin div -->
<?php
}
if ($subtab == 'security' && zp_loggedin(ADMIN_RIGHTS)) {
?>
<div id="tab_security" class="tabbox">
<?php
zp_apply_filter('admin_note', 'options', $subtab);
?>
<form class="dirty-check" id="form_options" action="?action=saveoptions" method="post" autocomplete="off">
<?php
XSRFToken('saveoptions');
?>
<input type="hidden" name="savesecurityoptions" value="yes" />
<table class="options">
<tr>
<td colspan="3">
<p class="buttons">
<button type="submit" value="<?php
echo gettext('save');
?>
"><img src="images/pass.png" alt="" /><strong><?php
echo gettext("Apply");
示例12: header
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)) {
$append = '_' . time();
$seoname = stripSuffix($seoname) . $append . '.' . getSuffix($seoname);
$targetFile = $targetPath . '/' . internalToFilesystem($seoname);
}
if (move_uploaded_file($tempFile, $targetFile)) {
@chmod($targetFile, 0666 & CHMOD_VALUE);
示例13: printLogoAndLinks
?>
</head>
<body>
<link
<?php
printLogoAndLinks();
?>
<div id="main">
<?php
printTabs();
?>
<div id="content">
<?php
zp_apply_filter('admin_note', 'development', '');
?>
<div id="container">
<?php
printSubtabs();
?>
<div class="tabbox">
<h1><?php
echo gettext('ZenPhoto20 filters');
?>
</h1>
<?php
echo '<div style="float:left;width:70%;">';
include 'intro.html';
echo '</div>';
echo '<div style="float:right;width:30%;">';
示例14: getImageProcessorURI
/**
* forms the i.php parameter list for an image.
*
* @param array $args
* @param string $album the album name
* @param string $image the image name
* @return string
*/
function getImageProcessorURI($args, $album, $image)
{
list($size, $width, $height, $cw, $ch, $cx, $cy, $quality, $thumb, $crop, $thumbstandin, $passedWM, $adminrequest, $effects) = $args;
$args[8] = NULL;
// not used by image processor
$uri = WEBPATH . '/' . ZENFOLDER . '/i.php?a=' . $album;
if (is_array($image)) {
$uri .= '&i=' . $image['name'] . '&z=' . ($z = $image['source']);
} else {
$uri .= '&i=' . $image;
$z = NULL;
}
if (empty($size)) {
$args[0] = NULL;
} else {
$uri .= '&s=' . ($args[0] = (int) $size);
}
if ($width) {
$uri .= '&w=' . ($args[1] = (int) $width);
} else {
$args[1] = NULL;
}
if ($height) {
$uri .= '&h=' . ($args[2] = (int) $height);
} else {
$args[2] = NULL;
}
if (is_null($cw)) {
$args[3] = NULL;
} else {
$uri .= '&cw=' . ($args[3] = (int) $cw);
}
if (is_null($ch)) {
$args[4] = NULL;
} else {
$uri .= '&ch=' . ($args[4] = (int) $ch);
}
if (is_null($cx)) {
$args[5] = NULL;
} else {
$uri .= '&cx=' . ($args[5] = (int) $cx);
}
if (is_null($cy)) {
$args[6] = NULL;
} else {
$uri .= '&cy=' . ($args[6] = (int) $cy);
}
if ($quality) {
$uri .= '&q=' . ($args[7] = (int) $quality);
} else {
$args[7] = NULL;
}
$args[8] = NULL;
if ($crop) {
$uri .= '&c=' . ($args[9] = 1);
} else {
$args[9] = NULL;
}
if ($thumb || $thumbstandin) {
$uri .= '&t=' . ($args[10] = 1);
} else {
$args[10] = NULL;
}
if ($passedWM) {
$uri .= '&wmk=' . $passedWM;
} else {
$args[11] = NULL;
}
if ($adminrequest) {
$args[12] = true;
$uri .= '&admin=1';
} else {
$args[12] = false;
}
if ($effects) {
$uri .= '&effects=' . $effects;
} else {
$args[13] = NULL;
}
$args[14] = $z;
$uri .= '&check=' . sha1(HASH_SEED . serialize($args));
$uri = zp_apply_filter('image_processor_uri', $uri);
return $uri;
}
示例15: printLogoAndLinks
</head>
<body>
<?php
printLogoAndLinks();
?>
<div id="main">
<?php
printTabs();
?>
<div id="content">
<?php
$subtab = printSubtabs();
?>
<div id="tab_articles" class="tabbox">
<?php
zp_apply_filter('admin_note', 'categories', $subtab);
foreach ($reports as $report) {
echo $report;
}
?>
<h1>
<?php
echo gettext('Categories');
?>
<span class="zenpagestats"><?php
printCategoriesStatistic();
?>
</span></h1>
<form action="admin-categories.php?page=news&tab=categories" method="post" id="checkeditems" name="checkeditems" onsubmit="return confirmAction();">
<?php
XSRFToken('checkeditems');