本文整理汇总了PHP中stripSuffix函数的典型用法代码示例。如果您正苦于以下问题:PHP stripSuffix函数的具体用法?PHP stripSuffix怎么用?PHP stripSuffix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了stripSuffix函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: zp_register_filter
/**
* Registers a filtering function
* Filtering functions are used to post process zenphoto elements or to trigger functions when a filter occur
*
* Typical use:
*
* zp_register_filter('some_hook', 'function_handler_for_hook');
*
* global array $_zp_filters Storage for all of the filters
* @param string $hook the name of the zenphoto element to be filtered
* @param callback $function_name the name of the function that is to be called.
* @param integer $priority optional. Used to specify the order in which the functions associated with a particular
* action are executed (default=5, lower=earlier execution, and functions with
* the same priority are executed in the order in which they were added to the filter)
* @param int $accepted_args optional. The number of arguments the function accept (default is the number provided).
*/
function zp_register_filter($hook, $function_name, $priority = NULL, $accepted_args = NULL)
{
global $_zp_filters, $_EnabledPlugins;
$bt = @debug_backtrace();
if (is_array($bt)) {
$b = array_shift($bt);
$base = basename($b['file']);
} else {
$base = 'unknown';
}
if (is_null($priority)) {
$priority = @$_EnabledPlugins[stripSuffix($base)];
if (is_null($priority)) {
$priority = 5;
} else {
$priority = $priority & PLUGIN_PRIORITY;
}
}
// At this point, we cannot check if the function exists, as it may well be defined later (which is OK)
$id = zp_filter_unique_id($hook, $function_name, $priority);
$_zp_filters[$hook][$priority][$id] = array('function' => $function_name, 'accepted_args' => $accepted_args, 'script' => $base);
if (DEBUG_FILTERS) {
debugLog($base . '=>' . $function_name . ' registered to ' . $hook . ' at priority ' . $priority);
}
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:41,代码来源:functions-filter.php
示例2: zipAddAlbum
function zipAddAlbum($album, $base, $zip)
{
global $_zp_zip_list, $zip_gallery;
$albumbase = '.' . substr($album->name, $base) . '/';
foreach ($album->sidecars as $suffix) {
$f = $albumbase . $album->name . '.' . $suffix;
if (file_exists($f)) {
$_zp_zip_list[] = $f;
}
}
$images = $album->getImages();
foreach ($images as $imagename) {
$image = newImage($album, $imagename);
$_zp_zip_list[] = $albumbase . $image->filename;
$imagebase = stripSuffix($image->filename);
foreach ($image->sidecars as $suffix) {
$f = $albumbase . $imagebase . '.' . $suffix;
if (file_exists($f)) {
$_zp_zip_list[] = $f;
}
}
}
$albums = $album->getAlbums();
foreach ($albums as $albumname) {
$subalbum = new Album($zip_gallery, $albumname);
if ($subalbum->exists && !$album->isDynamic()) {
zipAddAlbum($subalbum, $base, $zip);
}
}
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:30,代码来源:album-zip.php
示例3: __construct
function __construct()
{
foreach (getPluginFiles('*.php') as $extension => $plugin) {
$deprecated = stripSuffix($plugin) . '/deprecated-functions.php';
if (file_exists($deprecated)) {
$plugin = basename(dirname($deprecated));
$content = preg_replace('~#.*function~', '', file_get_contents($deprecated));
// remove the comments!
preg_match_all('~@deprecated\\s+.*since\\s+.*(\\d+\\.\\d+\\.\\d+)~', $content, $versions);
preg_match_all('/([public static|static]*)\\s*function\\s+(.*)\\s?\\(.*\\)\\s?\\{/', $content, $functions);
if ($plugin == 'deprecated-functions') {
$plugin = 'core';
$suffix = '';
} else {
$suffix = ' (' . $plugin . ')';
}
foreach ($functions[2] as $key => $function) {
if ($functions[1][$key]) {
$flag = '_method';
$star = '*';
} else {
$star = $flag = '';
}
$name = $function . $star . $suffix;
$option = 'deprecated_' . $plugin . '_' . $function . $flag;
setOptionDefault($option, 1);
$this->unique_functions[strtolower($function)] = $this->listed_functions[$name] = array('plugin' => $plugin, 'function' => $function, 'class' => trim($functions[1][$key]), 'since' => @$versions[1][$key], 'option' => $option, 'multiple' => array_key_exists($function, $this->unique_functions));
}
}
}
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:deprecated-functions.php
示例4: iconColor
function iconColor($icon)
{
global $themeColor;
if (getOption('css_style') == 'dark') {
$icon = stripSuffix($icon) . '-white.png';
}
return $icon;
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:8,代码来源:functions.php
示例5: storeConfig
/**
* backs-up and updates the Zenphoto configuration file
*
* @param string $zp_cfg
*/
function storeConfig($zp_cfg)
{
debugLogBacktrace(gettext('Updating the configuration file'));
$mod = fileperms(SERVERPATH . '/' . DATA_FOLDER . '/' . CONFIGFILE) & 0777;
@rename(SERVERPATH . '/' . DATA_FOLDER . '/' . CONFIGFILE, $backkup = SERVERPATH . '/' . DATA_FOLDER . '/' . stripSuffix(CONFIGFILE) . '.bak.php');
@chmod($backup, $mod);
file_put_contents(SERVERPATH . '/' . DATA_FOLDER . '/' . CONFIGFILE, $zp_cfg);
@chmod($backup, SERVERPATH . '/' . DATA_FOLDER . '/' . CONFIGFILE, $mod);
}
开发者ID:rb26,项目名称:zenphoto,代码行数:14,代码来源:functions-config.php
示例6: storeConfig
/**
* backs-up and updates the configuration file
*
* @param string $zp_cfg
*/
function storeConfig($zp_cfg, $folder = NULL)
{
if (is_null($folder)) {
$folder = SERVERPATH . '/';
}
$mod = fileperms($folder . DATA_FOLDER . '/' . CONFIGFILE) & 0777;
@rename($folder . DATA_FOLDER . '/' . CONFIGFILE, $backkup = $folder . DATA_FOLDER . '/' . stripSuffix(CONFIGFILE) . '.bak.php');
@chmod($backup, $mod);
file_put_contents($folder . DATA_FOLDER . '/' . CONFIGFILE, $zp_cfg);
clearstatcache();
@chmod($folder . DATA_FOLDER . '/' . CONFIGFILE, $mod);
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:17,代码来源:functions-config.php
示例7: getImageProcessorURIFromCacheName
function getImageProcessorURIFromCacheName($match, $watermarks)
{
$args = array(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
$set = array();
$done = false;
$params = explode('_', stripSuffix($match));
while (!$done && count($params) > 1) {
$check = array_pop($params);
if (is_numeric($check) && !isset($set['w']) && !isset($set['h'])) {
$set['s'] = $check;
break;
} else {
$c = substr($check, 0, 1);
if ($c == 'w' || $c == 'h') {
if (is_numeric($v = substr($check, 1))) {
$set[$c] = (int) $v;
continue;
}
}
if ($c == 'c') {
$c = substr($check, 0, 2);
if (is_numeric($v = substr($check, 2))) {
$set[$c] = (int) $v;
continue;
}
}
if (!isset($set['w']) && !isset($set['h']) && !isset($set['s'])) {
if (!isset($set['wm']) && in_array($check, $watermarks)) {
$set['wmk'] = $check;
} else {
if ($check == 'thumb') {
$set['t'] = true;
} else {
$set['effects'] = $check;
}
}
} else {
array_push($params, $check);
break;
}
}
}
if (!isset($set['wmk'])) {
$set['wmk'] = '!';
}
$image = preg_replace('~.*/' . CACHEFOLDER . '/~', '', implode('_', $params)) . '.' . getSuffix($match);
// strip out the obfustication
$album = dirname($image);
$image = preg_replace('~^[0-9a-f]{' . CACHE_HASH_LENGTH . '}\\.~', '', basename($image));
$image = $album . '/' . $image;
return array($image, getImageArgs($set));
}
开发者ID:rb26,项目名称:zenphoto,代码行数:52,代码来源:functions.php
示例8: getOptionsSupported
function getOptionsSupported()
{
global $_zp_gallery;
$options = array(gettext('Minimum items') => array('key' => 'bxslider_minitems', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("The minimum number of slides to be shown. Slides will be sized down if carousel becomes smaller than the original size."), 'order' => 1), gettext('Maximum items') => array('key' => 'bxslider_maxitems', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("The maximum number of slides to be shown. Slides will be sized up if carousel becomes larger than the original size."), 'order' => 2), gettext('Width') => array('key' => 'bxslider_width', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("Width of the thumb. Note that the CSS might need to be adjusted."), 'order' => 3), gettext('Height') => array('key' => 'bxslider_height', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("Height of the thumb. Note that the CSS might need to be adjusted."), 'order' => 4), gettext('Crop width') => array('key' => 'bxslider_cropw', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => "", 'order' => 5), gettext('Crop height') => array('key' => 'bxslider_croph', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => "", 'order' => 6), gettext('Speed') => array('key' => 'bxslider_speed', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("The speed in miliseconds the slides advance when clicked.)"), 'order' => 7), gettext('Full image link') => array('key' => 'bxslider_fullimagelink', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext("If checked the thumbs link to the full image instead of the image page."), 'order' => 8), gettext('Mode') => array('key' => 'bxslider_mode', 'type' => OPTION_TYPE_SELECTOR, 'selections' => array(gettext('Horizontal') => "horizontal", gettext('Vertical') => "vertical", gettext('Fade') => "fade"), 'desc' => gettext("The mode of the thumb nav. Note this might require theme changes."), 'order' => 9));
foreach (getThemeFiles(array('404.php', 'themeoptions.php', 'theme_description.php', 'functions.php', 'password.php', 'sidebar.php', 'register.php', 'contact.php')) as $theme => $scripts) {
$list = array();
foreach ($scripts as $script) {
$list[$script] = 'bxslider_' . $theme . '_' . stripSuffix($script);
}
$options[$theme] = array('key' => 'bxslider_' . $theme . '_scripts', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'checkboxes' => $list, 'desc' => gettext('The scripts for which BxSlider is enabled. {If themes require it they might set this, otherwise you need to do it manually!}'));
}
return $options;
}
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:13,代码来源:bxslider_thumb_nav.php
示例9: getOptionsSupported
function getOptionsSupported()
{
global $_zp_gallery;
$options = array(gettext('Thumbs number') => array('key' => 'jcarousel_scroll', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("The number of thumbs to scroll by. Note that the CSS might need to be adjusted.")), gettext('width') => array('key' => 'jcarousel_width', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("Width of the carousel. Note that the CSS might need to be adjusted.")), gettext('height') => array('key' => 'jcarousel_height', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => gettext("Height of the carousel. Note that the CSS might need to be adjusted.")), gettext('Crop width') => array('key' => 'jcarousel_cropw', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => ""), gettext('Crop height') => array('key' => 'jcarousel_croph', 'type' => OPTION_TYPE_TEXTBOX, 'desc' => ""), gettext('Full image link') => array('key' => 'jcarousel_fullimagelink', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext("If checked the thumbs link to the full image instead of the image page.")), gettext('Vertical') => array('key' => 'jcarousel_vertical', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext("If checked the carousel will flow vertically instead of the default horizontal. Changing this may require theme changes!")));
foreach (getThemeFiles(array('404.php', 'themeoptions.php', 'theme_description.php', 'functions.php', 'password.php', 'sidebar.php', 'register.php', 'contact.php')) as $theme => $scripts) {
$list = array();
foreach ($scripts as $script) {
$list[$script] = 'jcarousel_' . $theme . '_' . stripSuffix($script);
}
$options[$theme] = array('key' => 'jcarousel_' . $theme . '_scripts', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'checkboxes' => $list, 'desc' => gettext('The scripts for which jCarousel is enabled. {If themes require it they might set this, otherwise you need to do it manually!}'));
}
return $options;
}
开发者ID:rb26,项目名称:zenphoto,代码行数:13,代码来源:jcarousel_thumb_nav.php
示例10: __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);
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:46,代码来源:favoritesAlbums.php
示例11: getOptionsSupported
function getOptionsSupported()
{
global $_zp_gallery;
$themes = getPluginFiles('colorbox_js/themes/*.*');
$list = array('Custom (theme based)' => 'custom');
foreach ($themes as $theme) {
$theme = stripSuffix(basename($theme));
$list[ucfirst($theme)] = $theme;
}
$opts = array(gettext('Colorbox theme') => array('key' => 'colorbox_theme', 'type' => OPTION_TYPE_SELECTOR, 'order' => 0, 'selections' => $list, 'desc' => gettext("The Colorbox script comes with 5 example themes you can select here. If you select <em>custom (within theme)</em> you need to place a folder <em>colorbox_js</em> containing a <em>colorbox.css</em> file and a folder <em>images</em> within the current theme to override to use a custom Colorbox theme.")));
$c = 1;
foreach (getThemeFiles(array('404.php', 'themeoptions.php', 'theme_description.php')) as $theme => $scripts) {
$list = array();
foreach ($scripts as $script) {
$list[$script] = 'colorbox_' . $theme . '_' . stripSuffix($script);
}
$opts[$theme] = array('key' => 'colorbox_' . $theme . '_scripts', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'order' => $c++, 'checkboxes' => $list, 'desc' => gettext('The scripts for which Colorbox is enabled. {Should have been set by the themes!}'));
}
return $opts;
}
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:20,代码来源:colorbox_js.php
示例12: getOptionsSupported
function getOptionsSupported()
{
$gallery = new Gallery();
$opts = array();
$exclude = array('404.php', 'themeoptions.php', 'theme_description.php');
foreach (array_keys($gallery->getThemes()) as $theme) {
$curdir = getcwd();
$root = SERVERPATH . '/' . THEMEFOLDER . '/' . $theme . '/';
chdir($root);
$filelist = safe_glob('*.php');
$list = array();
foreach ($filelist as $file) {
if (!in_array($file, $exclude)) {
$list[$script = stripSuffix(filesystemToInternal($file))] = 'colorbox_' . $theme . '_' . $script;
}
}
chdir($curdir);
$opts[$theme] = array('key' => 'colorbox_' . $theme . '_scripts', 'type' => OPTION_TYPE_CHECKBOX_ARRAY, 'checkboxes' => $list, 'desc' => gettext('The scripts for which Colorbox is enabled. {Should have been set by the themes!}'));
}
return $opts;
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:21,代码来源:colorbox.php
示例13: array
$personalities = array();
foreach ($persona as $personality) {
if (file_exists(SERVERPATH . '/' . THEMEFOLDER . '/effervescence_plus/' . $personality . '/functions.php')) {
$personalities[ucfirst(str_replace('_', ' ', $personality))] = $personality;
}
}
$personality = strtolower(getOption('effervescence_personality'));
if (!in_array($personality, $personalities)) {
$persona = $personalities;
$personality = array_shift($persona);
}
chdir(SERVERPATH . "/themes/" . basename(dirname(__FILE__)) . "/styles");
$filelist = safe_glob('*.txt');
$themecolors = array();
foreach ($filelist as $file) {
$themecolors[basename($file)] = stripSuffix(filesystemToInternal($file));
}
chdir($cwd);
if (!OFFSET_PATH) {
if (extensionEnabled('themeSwitcher')) {
$themeColor = getOption('themeSwitcher_effervescence_color');
if (isset($_GET['themeColor'])) {
$new = $_GET['themeColor'];
if (in_array($new, $themecolors)) {
setOption('themeSwitcher_effervescence_color', $new);
$themeColor = $new;
}
}
if (!$themeColor) {
$themeColor = getThemeOption('Theme_colors');
}
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:functions.php
示例14: zp_apply_filter
$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);
$album = new Album($gallery, $folder);
$image = newImage($album, $seoname);
$image->setOwner($_zp_current_admin_obj->getUser());
if ($name != $seoname && $image->getTitle() == substr($seoname, 0, strrpos($seoname, '.'))) {
$image->setTitle(substr($name, 0, strrpos($name, '.')));
}
$image->save();
} else {
$error = UPLOAD_ERR_NO_FILE;
}
} else {
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:uploader.php
示例15: buttons
/**
* Creates a list of logon buttons for federated logon handlers.
* Note that it will use an image if one exists. The name of the image
* should be cononical to the name of the logon handler, but without the "_logon'.
* The image must be a PNG file.
*
* The styling of the buttons is done by the "federated_logon_buttons.css". If you do not like the
* one provided place an alternate version in your theme folder or the plugins/federated_logon
* folder.
*/
static function buttons($redirect = NULL)
{
$alt_handlers = federated_logon::alt_login_handler('');
?>
<ul class="logon_buttons">
<?php
foreach ($alt_handlers as $handler => $details) {
$script = $details['script'];
$authority = str_replace('_logon', '', stripSuffix(basename($script)));
if (is_null($redirect)) {
$details['params'][] = 'redirect=/' . ZENFOLDER . '/admin.php';
} else {
if (!empty($redirect)) {
$details['params'][] = 'redirect=' . $redirect;
}
}
if (count($details['params'])) {
$params = "'" . implode("','", $details['params']) . "'";
} else {
$params = '';
}
?>
<li>
<span class="fed_buttons">
<a href="javascript:launchScript('<?php
echo $script;
?>
',[<?php
echo $params;
?>
]);" title="<?php
echo $authority;
?>
" >
<?php
$logo = ltrim(str_replace(WEBPATH, '', dirname($script)) . '/' . $authority . '.png', '/');
if (file_exists(SERVERPATH . '/' . $logo)) {
?>
<img src="<?php
echo WEBPATH . '/' . $logo;
?>
" alt="<?php
echo $authority;
?>
" title="<?php
printf(gettext('Login using %s'), $authority);
?>
" />
<?php
} else {
echo $authority;
}
?>
</a>
</span>
</li>
<?php
}
?>
</ul>
<?php
}
开发者ID:rb26,项目名称:zenphoto,代码行数:72,代码来源:federated_logon.php
示例16: getShow
static function getShow($heading, $speedctl, $albumobj, $imageobj, $width, $height, $crop, $shuffle, $linkslides, $controls, $returnpath, $imagenumber)
{
global $_zp_gallery, $_zp_gallery_page;
setOption('slideshow_' . $_zp_gallery->getCurrentTheme() . '_' . stripSuffix($_zp_gallery_page), 1);
if (!$albumobj->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumobj)) {
return '<div class="errorbox" id="message"><h2>' . gettext('This album is password protected!') . '</h2></div>';
}
$slideshow = '';
$numberofimages = $albumobj->getNumImages();
// setting the image size
if ($width) {
$wrapperwidth = $width;
} else {
$width = $wrapperwidth = getOption("slideshow_width");
}
if ($height) {
$wrapperheight = $height;
} else {
$height = $wrapperheight = getOption("slideshow_height");
}
if ($numberofimages == 0) {
return '<div class="errorbox" id="message"><h2>' . gettext('No images for the slideshow!') . '</h2></div>';
}
$option = getOption("slideshow_mode");
// jQuery Cycle slideshow config
// get slideshow data
$showdesc = getOption("slideshow_showdesc");
// slideshow display section
$validtypes = array('jpg', 'jpeg', 'gif', 'png', 'mov', '3gp');
$slideshow .= '
<script type="text/javascript">
// <!-- <![CDATA[
$(document).ready(function(){
$(function() {
var ThisGallery = "' . html_encode($albumobj->getTitle()) . '";
var ImageList = new Array();
var TitleList = new Array();
var DescList = new Array();
var ImageNameList = new Array();
var DynTime=(' . (int) getOption("slideshow_timeout") . ');
';
$images = $albumobj->getImages(0);
if ($shuffle) {
shuffle($images);
}
for ($imgnr = 0, $cntr = 0, $idx = $imagenumber; $imgnr < $numberofimages; $imgnr++, $idx++) {
if (is_array($images[$idx])) {
$filename = $images[$idx]['filename'];
$album = newAlbum($images[$idx]['folder']);
$image = newImage($album, $filename);
} else {
$filename = $images[$idx];
$image = newImage($albumobj, $filename);
}
$ext = slideshow::is_valid($filename, $validtypes);
if ($ext) {
if ($crop) {
$img = $image->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, NULL, NULL);
} else {
$maxwidth = $width;
$maxheight = $height;
getMaxSpaceContainer($maxwidth, $maxheight, $image);
$img = $image->getCustomImage(NULL, $maxwidth, $maxheight, NULL, NULL, NULL, NULL, NULL, NULL);
}
$slideshow .= 'ImageList[' . $cntr . '] = "' . $img . '";' . "\n";
$slideshow .= 'TitleList[' . $cntr . '] = "' . js_encode($image->getTitle()) . '";' . "\n";
if ($showdesc) {
$desc = $image->getDesc();
$desc = str_replace("\r\n", '<br />', $desc);
$desc = str_replace("\r", '<br />', $desc);
$slideshow .= 'DescList[' . $cntr . '] = "' . js_encode($desc) . '";' . "\n";
} else {
$slideshow .= 'DescList[' . $cntr . '] = "";' . "\n";
}
if ($idx == $numberofimages - 1) {
$idx = -1;
}
$slideshow .= 'ImageNameList[' . $cntr . '] = "' . urlencode($filename) . '";' . "\n";
$cntr++;
}
}
$slideshow .= "\n";
$numberofimages = $cntr;
$slideshow .= '
var countOffset = ' . $imagenumber . ';
var totalSlideCount = ' . $numberofimages . ';
var currentslide = 2;
function onBefore(curr, next, opts) {
if (opts.timeout != DynTime) {
opts.timeout = DynTime;
}
if (!opts.addSlide)
return;
var currentImageNum = currentslide;
currentslide++;
if (currentImageNum == totalSlideCount) {
opts.addSlide = null;
return;
}
var relativeSlot = (currentslide + countOffset) % totalSlideCount;
//.........这里部分代码省略.........
开发者ID:rb26,项目名称:zenphoto,代码行数:101,代码来源:slideshow.php
示例17: db_quote
if (preg_match('~^' . THEMEFOLDER . '/~', $owner)) {
if ($owner == THEMEFOLDER . '/') {
$where = ' WHERE `creator` = "' . THEMEFOLDER . '/"';
} else {
$where = ' WHERE `creator` LIKE ' . db_quote('%' . basename($owner) . '/themeoptions.php');
}
$sql = 'DELETE FROM ' . prefix('options') . $where;
$result = query($sql);
} else {
purgeOption('zp_plugin_' . stripSuffix(basename($owner)));
}
}
}
if (isset($_POST['missingplugin'])) {
foreach ($_POST['missingplugin'] as $plugin) {
purgeOption('zp_plugin_' . stripSuffix($plugin));
}
}
}
printAdminHeader('options', '');
?>
<link rel="stylesheet" href="purgeOptions.css" type="text/css">
</head>
<body>
<?php
printLogoAndLinks();
?>
<div id="main">
<?php
printTabs();
?>
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:purgeOptions_tab.php
示例18: getFullImageURL
/**
* returns URL to the original image or to a high quality alternate
* e.g. ogg, avi, wmv files that can be handled by the client browser
*
* @param unknown_type $path
*/
function getFullImageURL()
{
// Search for a high quality version of the video
if ($vid = parent::getFullImageURL()) {
$folder = ALBUM_FOLDER_SERVERPATH . internalToFilesystem($this->album->getFileName());
$video = stripSuffix($this->filename);
$curdir = getcwd();
chdir($folder);
$candidates = safe_glob($video . '.*');
chdir($curdir);
foreach ($candidates as $target) {
$ext = getSuffix($target);
if (in_array($ext, $this->videoalt)) {
$vid = stripSuffix($vid) . '.' . substr(strrchr($target, "."), 1);
}
}
}
return $vid;
}
开发者ID:Simounet,项目名称:zenphoto,代码行数:25,代码来源:class-video.php
示例19: getHTMLMetaData
/**
* Prints html meta data to be used in the <head> section of a page
*
*/
static function getHTMLMetaData()
{
global $_zp_gallery, $_zp_galley_page, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority, $_zp_conf_vars, $_myFavorites, $htmlmetatags_need_cache, $_zp_page;
zp_register_filter('image_processor_uri', 'htmlmetatags::ipURI');
$host = sanitize("http://" . $_SERVER['HTTP_HOST']);
$url = $host . getRequestURI();
// Convert locale shorttag to allowed html meta format
$locale = str_replace("_", "-", getUserLocale());
$canonicalurl = '';
// generate page title, get date
$pagetitle = "";
// for gallery index setup below switch
$date = strftime(DATE_FORMAT);
// if we don't have a item date use current date
$desc = getBareGalleryDesc();
$thumb = '';
if (getOption('htmlmeta_sitelogo')) {
$thumb = getOption('htmlmeta_sitelogo');
}
if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
$ogimage_width = getOption('htmlmeta_ogimage_width');
$ogimage_height = getOption('htmlmeta_ogimage_height');
if (empty($ogimage_width)) {
$ogimage_width = 1280;
}
if (empty($ogimage_height)) {
$ogimage_height = 900;
}
}
$type = 'article';
switch ($_zp_gallery_page) {
case 'index.php':
$desc = getBareGalleryDesc();
//$canonicalurl = $host . getGalleryIndexURL();
$canonicalurl = $host . getPageNumURL($_zp_page);
$type = 'website';
break;
case 'album.php':
$pagetitle = getBareAlbumTitle() . " - ";
$date = getAlbumDate();
$desc = getBareAlbumDesc();
$canonicalurl = $host . getPageNumURL($_zp_page);
if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
$thumbimg = $_zp_current_album->getAlbumThumbImage();
getMaxSpaceContainer($ogimage_width, $ogimage_height, $thumbimg, false);
$thumb = $host . html_encode(pathurlencode($thumbimg->getCustomImage(NULL, $ogimage_width, $ogimage_height, NULL, NULL, NULL, NULL, false, NULL)));
}
break;
case 'image.php':
$pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
$date = getImageDate();
$desc = getBareImageDesc();
$canonicalurl = $host . getImageURL();
if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
$thumb = $host . html_encode(pathurlencode(getCustomSizedImageMaxSpace($ogimage_width, $ogimage_height)));
}
break;
case 'news.php':
if (function_exists("is_NewsArticle")) {
if (is_NewsArticle()) {
$pagetitle = getBareNewsTitle() . " - ";
$date = getNewsDate();
$desc = trim(getBare(getNewsContent()));
$canonicalurl = $host . $_zp_current_zenpage_news->getLink();
} else {
if (is_NewsCategory()) {
$pagetitle = $_zp_current_category->getTitlelink() . " - ";
$date = strftime(DATE_FORMAT);
$desc = trim(getBare($_zp_current_category->getDesc()));
$canonicalurl = $host . $_zp_current_category->getLink();
$type = 'category';
} else {
$pagetitle = gettext('News') . " - ";
$desc = '';
$canonicalurl = $host . getNewsIndexURL();
$type = 'website';
}
}
if ($_zp_page != 1) {
$canonicalurl .= '/' . $_zp_page;
}
}
break;
case 'pages.php':
$pagetitle = getBarePageTitle() . " - ";
$date = getPageDate();
$desc = trim(getBare(getPageContent()));
$canonicalurl = $host . $_zp_current_zenpage_page->getLink();
break;
default:
// for all other possible static custom pages
$custompage = stripSuffix($_zp_gallery_page);
$standard = array('contact' => gettext('Contact'), 'register' => gettext('Register'), 'search' => gettext('Search'), 'archive' => gettext('Archive view'), 'password' => gettext('Password required'));
if (is_object($_myFavorites)) {
$standard['favorites'] = gettext('My favorites');
}
//.........这里部分代码省略.........
开发者ID:rb26,项目名称:zenphoto,代码行数:101,代码来源:html_meta_tags.php
示例20: gettext
* allow your plugin to co-exist with other custom field extender plugins.
*
* @author Stephen Billard (sbillard)
* @package plugins
* @subpackage example
* @category package
*
*/
$plugin_is_filter = 5 | CLASS_PLUGIN;
// if you have such a plugin you probably want to use it
$plugin_description = gettext('Adds user defined fields to database tables');
$plugin_author = "Stephen Billard (sbillard)";
if (file_exists(SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/common/fieldExtender.php')) {
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/common/fieldExtender.php';
} else {
require_once stripSuffix(__FILE__) . '/fieldExtender.php';
}
//NOTE: you should choose a unique class name to be sure not to conflict with another custom field extender plugin
class customFieldExtender extends fieldExtender
{
/*
* For definition of this array see fieldExtender.php in the extensions/common folder
*/
static $fields = array(array('table' => 'albums', 'name' => 'Album_Custom', 'desc' => 'Custom album field', 'type' => 'varchar', 'size' => 50, 'edit' => 'multilingual'), array('table' => 'albums', 'name' => 'custom_field2', 'desc' => 'Custom field 2', 'type' => 'varchar', 'size' => 75, 'searchDefault' => 1, 'bulkAction' => array('Custom field 2' => 'mass_customText_data')), array('table' => 'images', 'name' => 'custom_field1', 'desc' => 'Custom field 1', 'type' => 'varchar', 'size' => 75, 'searchDefault' => 1, 'edit' => 'function', 'function' => 'customFieldExtender::custom_option'), array('table' => 'images', 'name' => 'custom_field2', 'desc' => 'Custom field 2', 'type' => 'varchar', 'size' => 75, 'searchDefault' => 1, 'bulkAction' => array('Custom field 2' => 'mass_customText_data')), array('table' => 'news', 'name' => 'News_Custom', 'desc' => 'Custom News field', 'type' => 'varchar', 'size' => 50), array('table' => 'news', 'name' => 'custom_field2', 'desc' => 'Custom field 2', 'type' => 'varchar', 'size' => 75, 'searchDefault' => 1, 'bulkAction' => array('Custom field 2' => 'mass_customText_data')), array('table' => 'pages', 'name' => 'Page_custom', 'desc' => 'Custom Page field', 'type' => 'varchar', 'size' => 50), array('table' => 'pages', 'name' => 'custom_field2', 'desc' => 'Custom field 2', 'type' => 'text', 'searchDefault' => 1, 'bulkAction' => array('Custom field 2' => 'mass_customTextarea_data')));
function __construct()
{
par
|
请发表评论