本文整理汇总了PHP中getBare函数的典型用法代码示例。如果您正苦于以下问题:PHP getBare函数的具体用法?PHP getBare怎么用?PHP getBare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getBare函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptionsSupported
function getOptionsSupported()
{
global $personalities;
if (!extensionEnabled('print_album_menu') && (($m = getOption('garland_menu')) == 'garland' || $m == 'zenpage' || $m == 'garland')) {
$note = '<p class="notebox">' . sprintf(gettext('<strong>Note:</strong> The <em>%s</em> custom menu makes use of the <em>print_album_menu</em> plugin.'), $m) . '</p>';
} else {
$note = '';
}
$options = array(gettext('Theme personality') => array('key' => 'garland_personality', 'type' => OPTION_TYPE_SELECTOR, 'selections' => $personalities, 'desc' => gettext('Select the theme personality')), gettext('Allow search') => array('key' => 'Allow_search', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Set to enable search form.')), gettext('Allow cloud') => array('key' => 'Allow_cloud', 'type' => OPTION_TYPE_CHECKBOX, 'desc' => gettext('Set to enable tag cloud for album page.')), gettext('Custom menu') => array('key' => 'garland_menu', 'type' => OPTION_TYPE_CUSTOM, 'desc' => gettext('Set this to the <em>menu_manager</em> menu you wish to use.') . $note));
if (extensionEnabled('zenpage')) {
global $_zp_CMS;
$pages = $_zp_CMS->getPages(false);
$list = array();
foreach ($pages as $page) {
$pageObj = newPage($page['titlelink']);
if (!$pageObj->getShow()) {
$list[getBare(get_language_string($page['title']))] = $page['titlelink'];
}
}
$options[gettext('Custom Homepage')] = array('key' => 'garland_customHome', 'type' => OPTION_TYPE_SELECTOR, 'selections' => $list, 'null_selection' => gettext('none'), 'desc' => gettext('Select the <em>pages</em> titlelink for the home page. Only unpublished pages are offered for selection.'));
}
if (getOption('garland_personality') == 'image_gallery') {
$options[gettext('Image gallery transition')] = array('key' => 'garland_transition', 'type' => OPTION_TYPE_SELECTOR, 'selections' => array(gettext('None') => '', gettext('Fade') => 'fade', gettext('Shrink/grow') => 'resize', gettext('Horizontal') => 'slide-hori', gettext('Vertical') => 'slide-vert'), 'order' => 10, 'desc' => gettext('Transition effect for Image gallery'));
$options[gettext('Image gallery caption')] = array('key' => 'garland_caption_location', 'type' => OPTION_TYPE_RADIO, 'buttons' => array(gettext('On image') => 'image', gettext('Separate') => 'separate', gettext('Omit') => 'none'), 'order' => 10.5, 'desc' => gettext('Location for Image gallery picture caption'));
}
return $options;
}
示例2: gettext
$link = "<a href=\"" . $obj->getLink() . '#zp_comment_id_' . $id . '">' . gettext("[page]") . ' ' . $obj->getTitle() . "</a>";
}
}
break;
default:
// all the image types
$obj = getItemByID('images', $comment['ownerid']);
if ($obj) {
$link = "<a href=\"" . $obj->getLink() . '#zp_comment_id_' . $id . '">' . $obj->getTitle() . "</a>";
}
break;
}
$date = myts_date('%m/%d/%Y %I:%M %p', $comment['date']);
$website = $comment['website'];
$fullcomment = sanitize($comment['comment'], 2);
$shortcomment = truncate_string(getBare($fullcomment), 123);
$inmoderation = $comment['inmoderation'];
$private = $comment['private'];
$anon = $comment['anon'];
?>
<tr class="newstr">
<td><?php
echo $fulltext ? $fullcomment : $shortcomment;
?>
</td>
<td><?php
echo date('Y-m-d H:i:s', strtotime($date));
?>
</td>
<td>
<?php
示例3: explode
$feeds = explode(';', $feeds);
if (count($feeds) < 0) {
exitZP();
}
// set the header type
header("Content-type: text/xml");
// set an arbitrary feed date
$RSS_date = date("r", mktime(10, 0, 0, 9, 8, 2010));
if (isset($_GET['lang'])) {
$locale = sanitize($_GET['lang']);
} else {
$locale = getOption('locale');
}
$gallery = new Gallery();
// Create new MergedRSS object with desired parameters
$MergedRSS = new MergedRSS($feeds, getBare(get_language_string($gallery->getTitle(), $locale)), FULLWEBPATH, getBare(get_language_string($gallery->getDesc(), $locale)), $RSS_date);
//Export the first 10 items to screen
$mergedrss_feeditems = getOption('mergedrss_items');
if (empty($mergedrss_feeditems)) {
$mergedrss_feeditems = 10;
}
$MergedRSS->export(false, true, $mergedrss_feeditems);
//getOption('RSS_items')
exitZP();
}
class MergedRSSOptions
{
function __construct()
{
if (OFFSET_PATH == 2) {
setOptionDefault('mergedrss_items', 10);
示例4: while
</small></h3>
<ul data-role="listview" data-inset="true" data-theme="c" class="ui-listview ui-group-theme-a">
<?php
while (next_news()) {
$c++;
?>
<li<?php
printZDToggleClass('news', $c, $number_to_show);
?>
>
<h4><?php
printNewsURL();
?>
</h4>
<p class="zenpageexcerpt"><?php
echo html_encodeTagged(shortenContent(getBare(getNewsContent()), 80, getOption("zenpage_textshorten_indicator")));
?>
</p>
</li>
<?php
}
?>
</ul>
<?php
}
}
?>
<h3>
<?php
if (getOption('search_no_albums')) {
if (!getOption('search_no_images') && $numpages + $numnews > 0) {
示例5: printSlideShowLink
//.........这里部分代码省略.........
transition: '<?php
echo getOption('slideshow_colorbox_transition');
?>
',
slideshowSpeed: <?php
echo getOption('slideshow_speed');
?>
,
slideshowStart: '<?php
echo gettext("start slideshow");
?>
',
slideshowStop: '<?php
echo gettext("stop slideshow");
?>
',
previous: '<?php
echo gettext("prev");
?>
',
next: '<?php
echo gettext("next");
?>
',
close: '<?php
echo gettext("close");
?>
',
current: '<?php
printf(gettext('image %1$s of %2$s'), '{current}', '{total}');
?>
',
maxWidth: '98%',
maxHeight: '98%',
photo: true
});
});
</script>
<?php
foreach ($images as $image) {
if (is_array($image)) {
$suffix = getSuffix($image['filename']);
} else {
$suffix = getSuffix($image);
}
$suffixes = array('jpg', 'jpeg', 'gif', 'png');
if (in_array($suffix, $suffixes)) {
$count++;
if (is_array($image)) {
$albobj = newAlbum($image['folder']);
$imgobj = newImage($albobj, $image['filename']);
} else {
$imgobj = newImage($_zp_current_album, $image);
}
if (in_context(ZP_SEARCH_LINKED) || $_zp_gallery_page != 'image.php') {
if ($count == 1) {
$style = '';
} else {
$style = ' style="display:none"';
}
} else {
if ($_zp_current_image->filename == $image) {
$style = '';
} else {
$style = ' style="display:none"';
}
}
switch (getOption('slideshow_colorbox_imagetype')) {
case 'fullimage':
$imagelink = getFullImageURL($imgobj);
break;
case 'sizedimage':
$imagelink = $imgobj->getCustomImage(getOption("slideshow_width"), NULL, NULL, NULL, NULL, NULL, NULL, false, NULL);
break;
}
$imagetitle = '';
if (getOption('slideshow_colorbox_imagetitle')) {
$imagetitle = html_encode(getBare($imgobj->getTitle()));
}
?>
<a href="<?php
echo html_encode(pathurlencode($imagelink));
?>
" rel="slideshow"<?php
echo $style;
?>
title="<?php
echo $imagetitle;
?>
"><?php
echo $linktext;
?>
</a>
<?php
}
}
}
break;
}
}
示例6: debugLogVar
/**
* Records a Var to the debug log
*
* @param string $message message to insert in log [optional]
* @param mixed $var the variable to record
* @param string $log alternative log file
*/
function debugLogVar($message)
{
$args = func_get_args();
if (count($args) == 1) {
$var = $message;
$message = '';
} else {
$message .= ' ';
$var = $args[1];
}
if (count($args) == 3) {
$log = $args[2];
} else {
$log = 'debug';
}
ob_start();
var_dump($var);
$str = ob_get_contents();
ob_end_clean();
debugLog(trim($message) . "\r" . html_decode(getBare($str)), false, $log);
}
示例7: __construct
/**
* Creates a feed object from the URL parameters fetched only
*
*/
function __construct($options = NULL)
{
global $_zp_gallery, $_zp_current_admin_obj, $_zp_loggedin;
if (empty($options)) {
self::feed404();
}
$this->feedtype = $options['external'];
$this->key = @$options['accesskey'];
parent::__construct($options);
if ($this->key) {
$result = query_single_row('SELECT * FROM ' . prefix('plugin_storage') . ' WHERE `type`="externalFeed" AND `data`=' . db_quote($this->key));
if (!$result) {
$this->key = NULL;
}
}
if (!$this->key && $this->feedtype != 'site_closed') {
self::feed404();
}
// general feed setup
$channeltitlemode = getOption('externalFeed_title');
$this->host = html_encode($_SERVER["HTTP_HOST"]);
//channeltitle general
switch ($channeltitlemode) {
case 'gallery':
$this->channel_title = $_zp_gallery->getBareTitle($this->locale);
break;
case 'website':
$this->channel_title = getBare($_zp_gallery->getWebsiteTitle($this->locale));
break;
case 'both':
$website_title = $_zp_gallery->getWebsiteTitle($this->locale);
$this->channel_title = $_zp_gallery->getBareTitle($this->locale);
if (!empty($website_title)) {
$this->channel_title = $website_title . ' - ' . $this->channel_title;
}
break;
}
// individual feedtype setup
switch ($this->feedtype) {
case 'gallery':
if (!getOption('externalFeed_album_image')) {
self::feed404();
}
$albumname = $this->getChannelTitleExtra();
if ($this->albumfolder) {
$alb = newAlbum($this->albumfolder, true, true);
if ($alb->exists) {
$albumtitle = $alb->getTitle();
if ($this->mode == 'albums' || $this->collection) {
$albumname = ' - ' . html_encode($albumtitle) . $this->getChannelTitleExtra();
}
} else {
self::feed404();
}
} else {
$albumtitle = '';
}
$albumname = $this->getChannelTitleExtra();
$this->channel_title = html_encode($this->channel_title . ' ' . getBare($albumname));
$this->imagesize = $this->getImageSize();
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
break;
case 'news':
//Zenpage News
if (!getOption('externalFeed_articles')) {
self::feed404();
}
$titleappendix = gettext(' (Latest news)');
switch ($this->sortorder) {
case 'popular':
$titleappendix = gettext(' (Most popular news)');
break;
case 'mostrated':
$titleappendix = gettext(' (Most rated news)');
break;
case 'toprated':
$titleappendix = gettext(' (Top rated news)');
break;
case 'random':
$titleappendix = gettext(' (Random news)');
break;
}
$this->channel_title = html_encode($this->channel_title . $this->cattitle . $titleappendix);
$this->imagesize = $this->getImageSize();
$this->itemnumber = getOption("externalFeed_zenpage_items");
// # of Items displayed on the feed
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/zenpage/zenpage-template-functions.php';
break;
case 'pages':
//Zenpage News
if (!getOption('externalFeed_pages')) {
self::feed404();
}
switch ($this->sortorder) {
case 'popular':
//.........这里部分代码省略.........
示例8: html_encode
<a href="<?php
echo html_encode(jqm_getLink());
?>
" title="<?php
printBareNewsTitle();
?>
">
<?php
printNewsTitle();
?>
<small>(<?php
printNewsDate();
?>
)</small>
<div class="albumdesc"><?php
echo shortenContent(getBare(getNewsContent()), 57, '(...)', false);
?>
</div>
</a>
</li>
<?php
}
?>
</ul>
<?php
printNewsPageListWithNav(gettext('next »'), gettext('« prev'), true, 'pagelist', true, 7);
}
?>
</div>
<div class="content-secondary">
示例9: getHTMLMetaData
/**
* Prints html meta data to be used in the <head> section of a page
*
*/
static function getHTMLMetaData()
{
global $_zp_gallery, $_zp_page, $_zp_current_album, $_zp_current_image, $_zp_current_search, $_zp_current_article, $_zp_current_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority, $_zp_conf_vars, $_myFavorites;
$host = sanitize("http://" . $_SERVER['HTTP_HOST']);
$url = $host . getRequestURI();
// Convert locale shorttag to allowed html meta format
$locale_ = getUserLocale();
$locale = zpFunctions::getLanguageText($locale_, '-');
$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;
}
$twittercard_type = 'summary';
}
$type = 'article';
switch ($_zp_gallery_page) {
case 'index.php':
$desc = getBareGalleryDesc();
$canonicalurl = $host . $_zp_gallery->getLink($_zp_page);
$type = 'website';
break;
case 'album.php':
case 'favorites.php':
$pagetitle = getBareAlbumTitle() . " - ";
$date = getAlbumDate();
$desc = getBareAlbumDesc();
$canonicalurl = $host . $_zp_current_album->getLink($_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)));
$twittercard_type = 'summary_large_image';
}
break;
case 'image.php':
$pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
$date = getImageDate();
$desc = getBareImageDesc();
$canonicalurl = $host . $_zp_current_image->getLink();
if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
$thumb = $host . html_encode(pathurlencode(getCustomSizedImageMaxSpace($ogimage_width, $ogimage_height)));
$twittercard_type = 'summary_large_image';
}
break;
case 'news.php':
if (function_exists("is_NewsArticle")) {
if (is_NewsArticle()) {
$pagetitle = getBareNewsTitle() . " - ";
$date = getNewsDate();
$desc = trim(getBare(getNewsContent()));
$canonicalurl = $host . $_zp_current_article->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($_zp_page);
$type = 'category';
} else {
$pagetitle = gettext('News') . " - ";
$desc = '';
$canonicalurl = $host . getNewsPathNav($_zp_page);
$type = 'website';
}
}
}
break;
case 'pages.php':
$pagetitle = getBarePageTitle() . " - ";
$date = getPageDate();
$desc = trim(getBare(getPageContent()));
$canonicalurl = $host . $_zp_current_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');
}
//.........这里部分代码省略.........
示例10: substr
if (false !== ($i = stripos($option, chr(0)))) {
$option = substr($option, 0, $i);
}
if ($option) {
?>
<li><code><?php
echo $option;
?>
</code></li>
<?php
}
}
}
}
foreach ($notes as $note) {
$n = getBare($note['desc']);
if (!empty($n)) {
?>
<li><code><?php
echo $note['desc'];
?>
</li>
<?php
}
}
?>
</ul>
</p>
<?php
}
if (!empty($buttonlist) || !empty($albumbuttons) || !empty($imagebuttons)) {
示例11: checkForEmptyTitle
/**
* Checks if no title has been provide for items on new item creation
* @param string $titlefield The title field
* @param string $type 'page', 'news' or 'category'
* @return string
*/
function checkForEmptyTitle($titlefield, $type, $truncate = true)
{
switch ($type) {
case "page":
$text = gettext("Untitled page");
break;
case "news":
$text = gettext("Untitled article");
break;
case "category":
$text = gettext("Untitled category");
break;
}
$title = getBare($titlefield);
if ($title) {
if ($truncate) {
$title = truncate_string($title, 40);
}
} else {
$title = "<span style='color:red; font-weight: bold'>" . $text . "</span>";
}
echo $title;
}
示例12: getLinkHTML
/**
* @param string $url The link URL
* @param string $text The text to go with the link
* @param string $title Text for the title tag
* @param string $class optional class
* @param string $id optional id
*/
function getLinkHTML($url, $text, $title = NULL, $class = NULL, $id = NULL)
{
return "<a href=\"" . html_encode($url) . "\"" . ($title ? " title=\"" . html_encode(getBare($title)) . "\"" : "") . ($class ? " class=\"{$class}\"" : "") . ($id ? " id=\"{$id}\"" : "") . ">" . html_encode($text) . "</a>";
}
示例13: getBareTitle
/**
* Returns a tag stripped title
* @param string $locale
* @return string
*/
function getBareTitle($locale = NULL)
{
return getBare($this->getTitle($locale));
}
示例14: composeStatus
/**
* Composes the tweet at 140 characters or less
* @param string $link
* @param string $title
* @param string $text
*
* @return string
*/
private static function composeStatus($link, $title, $text)
{
$text = trim(html_decode(getBare($text)));
if ($title) {
$title = trim(html_decode(getBare($title))) . ': ';
}
if (strlen($title . $text . ' ' . $link) > 140) {
$c = 140 - strlen($link);
if (mb_strlen($title) >= $c - 25) {
// not much point in the body if shorter than 25
$text = truncate_string($title, $c - 4, '... ') . $link;
// allow for ellipsis
} else {
$c = $c - mb_strlen($title) - 5;
$text = $title . truncate_string($text, $c, '... ') . $link;
}
} else {
$text = $title . $text . ' ' . $link;
}
$error = self::sendTweet($text);
if ($error) {
$error = sprintf(gettext('Error tweeting <code>%1$s</code>: %2$s'), $text, $error);
}
return $error;
}
示例15: printThumbs
/**
* Prints the thumbnails
*
*/
function printThumbs()
{
global $_zp_current_album, $_zp_current_image, $_zp_current_search, $_zp_gallery;
echo "<div id='pagedthumbsimages'>";
$thumbs = $this->getThumbs();
//$thcount = count($thumbs); echo "thcount:".$thcount;
$number = 0;
foreach ($thumbs as $image) {
if ($image->getID() == $_zp_current_image->getID()) {
$css = " id='pagedthumbsnav-active' ";
} else {
$css = "";
}
echo "<a {$css} href=\"" . html_encode($image->getLink()) . "\" title=\"" . html_encode(getBare($image->getTitle())) . "\">";
if ($this->crop) {
$html = "<img src='" . html_encode(pathurlencode($image->getCustomImage(null, $this->width, $this->height, $this->width, $this->height, null, null, true))) . "' alt=\"" . html_encode(getBare($image->getTitle())) . "\" width='" . $this->width . "' height='" . $this->height . "' />";
} else {
$maxwidth = $this->width;
// needed because otherwise getMaxSpaceContainer will use the values of the first image for all others, too
$maxheight = $this->height;
getMaxSpaceContainer($maxwidth, $maxheight, $image, true);
$html = "<img src=\"" . html_encode(pathurlencode($image->getCustomImage(NULL, $maxwidth, $maxheight, NULL, NULL, NULL, NULL, true))) . "\" alt=\"" . html_encode(getBare($image->getTitle())) . "\" />";
}
echo zp_apply_filter('custom_image_html', $html, true);
echo "</a>\n";
$number++;
}
if ($this->placeholders) {
if ($number != $this->imagesperpage) {
$placeholdernr = $this->imagesperpage - $number;
for ($nr2 = 1; $nr2 <= $placeholdernr; $nr2++) {
echo "<span class=\"placeholder\" style=\"width:" . $this->width . "px;height:" . $this->height . "px\"></span>";
}
}
}
echo "</div>";
}