本文整理汇总了PHP中nggGallery::i18n方法的典型用法代码示例。如果您正苦于以下问题:PHP nggGallery::i18n方法的具体用法?PHP nggGallery::i18n怎么用?PHP nggGallery::i18n使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nggGallery
的用法示例。
在下文中一共展示了nggGallery::i18n方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nggallery_picturelist
//.........这里部分代码省略.........
_e('Search Images', 'nggallery');
?>
:</label>
<input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
<input type="text" id="media-search-input" name="s" value="<?php
the_search_query();
?>
" />
<input type="submit" value="<?php
_e('Search Images', 'nggallery');
?>
" class="button" />
</p>
</form>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&s=' . get_search_query();
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<?php
} else {
?>
<h2><?php
echo _n('Gallery', 'Galleries', 1, 'nggallery');
?>
: <?php
echo esc_html(nggGallery::i18n($gallery->title));
?>
</h2>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid . '&paged=' . $_GET['paged'];
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<?php
if (nggGallery::current_user_can('NextGEN Edit gallery options')) {
?>
<div id="poststuff">
<?php
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
?>
<div id="gallerydiv" class="postbox <?php
echo postbox_classes('gallerydiv', 'ngg-manage-gallery');
?>
" >
<h3><?php
_e('Gallery settings', 'nggallery');
?>
<small> (<?php
_e('Click here for more settings', 'nggallery');
?>
)</small></h3>
示例2: nggallery_picturelist
//.........这里部分代码省略.........
_e('Search Images', 'nggallery');
?>
:</label>
<input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
<input type="text" id="media-search-input" name="s" value="<?php
the_search_query();
?>
" />
<input type="submit" value="<?php
_e('Search Images', 'nggallery');
?>
" class="button" />
</p>
</form>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&s=' . get_search_query();
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<?php
} else {
?>
<h2><?php
echo _n('Gallery', 'Galleries', 1, 'nggallery');
?>
: <?php
echo esc_html(nggGallery::i18n($gallery->title));
?>
</h2>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid . '&paged=' . esc_attr($_GET['paged']);
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<?php
if (nggGallery::current_user_can('NextGEN Edit gallery options')) {
?>
<div id="poststuff">
<?php
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
?>
<div id="gallerydiv" class="postbox <?php
echo postbox_classes('gallerydiv', 'ngg-manage-gallery');
?>
" >
<h3><?php
_e('Gallery settings', 'nggallery');
?>
<small> (<?php
_e('Click here for more settings', 'nggallery');
?>
)</small></h3>
示例3: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title'], $instance, $this->id_base);
global $wpdb;
$items = $instance['items'];
$exclude = $instance['exclude'];
$list = $instance['list'];
$webslice = $instance['webslice'];
$count = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->nggpictures} WHERE exclude != 1 ");
if ($count < $instance['items']) {
$instance['items'] = $count;
}
$exclude_list = '';
// THX to Kay Germer for the idea & addon code
if (!empty($list) && $exclude != 'all') {
$list = explode(',', $list);
// Prepare for SQL
$list = "'" . implode("', '", $list) . "'";
if ($exclude == 'denied') {
$exclude_list = "AND NOT (t.gid IN ({$list}))";
}
if ($exclude == 'allow') {
$exclude_list = "AND t.gid IN ({$list})";
}
// Limit the output to the current author, can be used on author template pages
if ($exclude == 'user_id') {
$exclude_list = "AND t.author IN ({$list})";
}
}
if ($instance['type'] == 'random') {
$imageList = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 {$exclude_list} ORDER by rand() limit {$items}");
} else {
$imageList = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 {$exclude_list} ORDER by pid DESC limit 0,{$items}");
}
// IE8 webslice support if needed
if ($webslice) {
$before_widget .= "\n" . '<div class="hslice" id="ngg-webslice" >' . "\n";
//the headline needs to have the class enty-title
$before_title = str_replace('class="', 'class="entry-title ', $before_title);
$after_widget = '</div>' . "\n" . $after_widget;
}
echo $before_widget . $before_title . $title . $after_title;
echo "\n" . '<div class="ngg-widget entry-content">' . "\n";
if (is_array($imageList)) {
foreach ($imageList as $image) {
// get the URL constructor
$image = new nggImage($image);
// get the effect code
$thumbcode = $image->get_thumbcode($widget_id);
// enable i18n support for alttext and description
$alttext = htmlspecialchars(stripslashes(nggGallery::i18n($image->alttext, 'pic_' . $image->pid . '_alttext')));
$description = htmlspecialchars(stripslashes(nggGallery::i18n($image->description, 'pic_' . $image->pid . '_description')));
//TODO:For mixed portrait/landscape it's better to use only the height setting, if widht is 0 or vice versa
$out = '<a href="' . $image->imageURL . '" title="' . $description . '" ' . $thumbcode . '>';
// Typo fix for the next updates (happend until 1.0.2)
$instance['show'] = $instance['show'] == 'orginal' ? 'original' : $instance['show'];
if ($instance['show'] == 'original') {
$out .= '<img src="' . trailingslashit(home_url()) . 'index.php?callback=image&pid=' . $image->pid . '&width=' . $instance['width'] . '&height=' . $instance['height'] . '" title="' . $alttext . '" alt="' . $alttext . '" />';
} else {
$out .= '<img src="' . $image->thumbURL . '" width="' . $instance['width'] . '" height="' . $instance['height'] . '" title="' . $alttext . '" alt="' . $alttext . '" />';
}
echo $out . '</a>' . "\n";
}
}
echo '</div>' . "\n";
echo $after_widget;
}
示例4: get_image_mrss_node
/**
* Get the XML <item> node corresponding to one single image
*
* @param $image The image object
*/
function get_image_mrss_node($image, $indent = "\t\t")
{
$ngg_options = nggGallery::get_option('ngg_options');
$tags = $image->get_tags();
$tag_names = '';
foreach ($tags as $tag) {
$tag_names .= $tag_names == '' ? $tag->name : ', ' . $tag->name;
}
$title = html_entity_decode(stripslashes($image->alttext));
$desc = html_entity_decode(stripslashes($image->description));
$thumbwidth = $ngg_options['thumbwidth'];
$thumbheight = $ngg_options['thumbfix'] ? $ngg_options['thumbheight'] : $thumbwidth;
$out = $indent . "<item>\n";
$out .= $indent . "\t<title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></title>\n";
$out .= $indent . "\t<description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></description>\n";
$out .= $indent . "\t<link><![CDATA[" . $image->get_permalink() . "]]></link>\n";
$out .= $indent . "\t<guid>image-id:" . $image->pid . "</guid>\n";
$out .= $indent . "\t<media:content url='" . nextgen_esc_url($image->imageURL) . "' medium='image' />\n";
$out .= $indent . "\t<media:title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></media:title>\n";
$out .= $indent . "\t<media:description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></media:description>\n";
$out .= $indent . "\t<media:thumbnail url='" . nextgen_esc_url($image->thumbURL) . "' width='" . $thumbwidth . "' height='" . $thumbheight . "' />\n";
$out .= $indent . "\t<media:keywords><![CDATA[" . nggGallery::i18n($tag_names) . "]]></media:keywords>\n";
$out .= $indent . "\t<media:copyright><![CDATA[Copyright (c) " . get_option("blogname") . " (" . site_url() . ")]]></media:copyright>\n";
$out .= $indent . "</item>\n";
return $out;
}
示例5: header
// get the gallery id
$galleryID = (int) $_GET['gid'];
// get the pictures
if ($galleryID == 0) {
$thepictures = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
} else {
$thepictures = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE t.gid = '{$galleryID}' AND tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
}
// Create XML output
header("content-type:text/xml;charset=utf-8");
echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n";
echo "\t<title>" . stripslashes(nggGallery::i18n($thepictures[0]->name)) . "</title>\n";
echo "\t<trackList>\n";
if (is_array($thepictures)) {
foreach ($thepictures as $picture) {
echo "\t\t<track>\n";
if (!empty($picture->description)) {
echo "\t\t\t<title>" . strip_tags(stripslashes(html_entity_decode(nggGallery::i18n($picture->description)))) . "</title>\n";
} else {
if (!empty($picture->alttext)) {
echo "\t\t\t<title>" . stripslashes(nggGallery::i18n($picture->alttext)) . "</title>\n";
} else {
echo "\t\t\t<title>" . $picture->filename . "</title>\n";
}
}
echo "\t\t\t<location>" . $siteurl . "/" . $picture->path . "/" . $picture->filename . "</location>\n";
echo "\t\t</track>\n";
}
}
echo "\t</trackList>\n";
echo "</playlist>\n";
示例6: widget
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @todo Needs to be better, without the mess to call to the database, but this requires a better database API.
*
* @param array $args Widget arguments.
* @param array $instance Saved values from the database.
*/
public function widget($args, $instance)
{
$title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title'], $instance, $this->id_base);
global $wpdb;
$items = min($instance['items'], $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->nggpictures} WHERE exclude != 1 "));
$exclude = $instance['exclude'];
$list = $instance['list'];
$exclude_list = '';
// THX to Kay Germer for the idea & addon code
if (!empty($list) && $exclude != 'all') {
$list = explode(',', $list);
// Prepare for SQL
$list = "'" . implode("', '", $list) . "'";
if ($exclude == 'denied') {
$exclude_list = "AND NOT (t.gid IN ({$list}))";
}
if ($exclude == 'allow') {
$exclude_list = "AND t.gid IN ({$list})";
}
}
if ($instance['type'] == 'random') {
$imageList = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 {$exclude_list} ORDER by rand() limit {$items}");
} else {
$imageList = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 {$exclude_list} ORDER by pid DESC limit 0,{$items}");
}
echo $args['before_widget'] . $args['before_title'] . $title . $args['after_title'];
echo "\n" . '<div class="ngg-widget entry-content">' . "\n";
if (is_array($imageList)) {
foreach ($imageList as $image) {
// get the URL constructor
$image = new nggImage($image);
// get the effect code
$thumbcode = $image->get_thumbcode($args['widget_id']);
// enable i18n support for alttext and description
$alttext = htmlspecialchars(stripslashes(nggGallery::i18n($image->alttext, 'pic_' . $image->pid . '_alttext')));
$description = htmlspecialchars(stripslashes(nggGallery::i18n($image->description, 'pic_' . $image->pid . '_description')));
//TODO:For mixed portrait/landscape it's better to use only the height setting, if widht is 0 or vice versa
$out = '<a href="' . $image->imageURL . '" title="' . $description . '" ' . $thumbcode . '>';
if ($instance['show'] == 'original') {
$out .= '<img src="' . trailingslashit(home_url()) . 'index.php?callback=image&pid=' . $image->pid . '&width=' . $instance['width'] . '&height=' . $instance['height'] . '" title="' . $alttext . '" alt="' . $alttext . '" />';
} else {
$out .= '<img src="' . $image->thumbURL . '" width="' . $instance['width'] . '" height="' . $instance['height'] . '" title="' . $alttext . '" alt="' . $alttext . '" />';
}
echo $out . '</a>' . "\n";
}
}
echo '</div>' . "\n";
echo $args['after_widget'];
}
示例7: get_container
/**
* Create the album or gallery container
*
* @param integer $id (the prefix 'a' indidcates that you look for a album
* @param bool $used (object will be hidden)
* @return $output
*/
function get_container($id = 0, $used = false)
{
global $wpdb, $nggdb;
$obj = array();
$preview_image = '';
$class = '';
// if the id started with a 'a', then it's a sub album
if (substr($id, 0, 1) == 'a') {
if (!($album = $this->albums[substr($id, 1)])) {
return;
}
$obj['id'] = $album->id;
$obj['name'] = $obj['title'] = $album->name;
$obj['type'] = 'album';
$class = 'album_obj';
// get the post name
$post = get_post($album->pageid);
$obj['pagenname'] = $post == null ? '---' : $post->post_title;
// for speed reason we limit it to 50
if ($this->num_albums < 50) {
if ($album->previewpic != 0) {
$image = $nggdb->find_image($album->previewpic);
$preview_image = !is_null($image->thumbURL) ? '<div class="inlinepicture"><img src="' . esc_url($image->thumbURL) . '" /></div>' : '';
}
}
// this indicates that we have a album container
$prefix = 'a';
} else {
if (!($gallery = $nggdb->find_gallery($id))) {
return;
}
$obj['id'] = $gallery->gid;
$obj['name'] = $gallery->name;
$obj['title'] = $gallery->title;
$obj['type'] = 'gallery';
// get the post name
$post = get_post($gallery->pageid);
$obj['pagenname'] = $post == null ? '---' : $post->post_title;
// for spped reason we limit it to 50
if ($this->num_galleries < 50) {
// set image url
$image = $nggdb->find_image($gallery->previewpic);
$preview_image = isset($image->thumbURL) ? '<div class="inlinepicture"><img src="' . esc_url($image->thumbURL) . '" /></div>' : '';
}
$prefix = '';
}
// add class if it's in use in other albums
$used = $used ? ' inUse' : '';
echo '<div id="gid-' . $prefix . $obj['id'] . '" class="groupItem' . $used . '">
<div class="innerhandle">
<div class="item_top ' . $class . '">
<a href="#" class="min" title="close">[-]</a>
ID: ' . $obj['id'] . ' | ' . wp_html_excerpt(esc_html(nggGallery::i18n($obj['title'])), 25) . '
</div>
<div class="itemContent">
' . $preview_image . '
<p><strong>' . __('Name', 'nggallery') . ' : </strong>' . esc_html(nggGallery::i18n($obj['name'])) . '</p>
<p><strong>' . __('Title', 'nggallery') . ' : </strong>' . esc_html(nggGallery::i18n($obj['title'])) . '</p>
<p><strong>' . __('Page', 'nggallery') . ' : </strong>' . esc_html(nggGallery::i18n($obj['pagenname'])) . '</p>
' . apply_filters('ngg_display_album_item_content', '', $obj) . '
</div>
</div>
</div>';
}
示例8: header
// get the gallery id
$galleryID = (int) $_GET['gid'];
// get the pictures
if ($galleryID == 0) {
$thepictures = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
} else {
$thepictures = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE t.gid = '{$galleryID}' AND tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
}
// Create XML output
header("content-type:text/xml;charset=utf-8");
echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n";
echo "\t<title>" . stripslashes(nggGallery::i18n($thepictures[0]->name)) . "</title>\n";
echo "\t<trackList>\n";
if (is_array($thepictures)) {
foreach ($thepictures as $picture) {
echo "\t\t<track>\n";
if (!empty($picture->description)) {
echo "\t\t\t<title>" . strip_tags(stripslashes(html_entity_decode(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description')))) . "</title>\n";
} else {
if (!empty($picture->alttext)) {
echo "\t\t\t<title>" . stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext')) . "</title>\n";
} else {
echo "\t\t\t<title>" . $picture->filename . "</title>\n";
}
}
echo "\t\t\t<location>" . $siteurl . "/" . $picture->path . "/" . $picture->filename . "</location>\n";
echo "\t\t</track>\n";
}
}
echo "\t</trackList>\n";
echo "</playlist>\n";
示例9: jig_ng_find_subalbums
function jig_ng_find_subalbums($parent_album_id, $cover_picture, $count = false)
{
global $wpdb;
$parent_album = wp_cache_get(substr($parent_album_id, 1), 'jig_ng_albums');
if ($cover_picture === 'needed') {
if ($parent_album->previewpic > 0) {
// The album had previewpic set already
$cover_picture = $this->jig_ng_find_images($parent_album->previewpic, true);
if (empty($cover_picture)) {
// The preview picture is obsolete
$cover_picture = 'needed';
}
}
}
if ($parent_album->sortorder) {
// If the album is not empty
$parent_album_contents = $this->jig_ng_unserialize($parent_album->sortorder);
$galleries = $sub_albums = array();
foreach ($parent_album_contents as $parent_album_element_ID) {
if (is_numeric($parent_album_element_ID)) {
//$galleries[] = wp_cache_get($parent_album_element_ID, 'jig_ng_galleries');
$galleries[] = $parent_album_element_ID;
} else {
$sub_albums[] = $parent_album_element_ID;
}
}
if ($cover_picture === 'needed') {
// If cover picture is not found yet, try to get one from the galleries
if (!empty($galleries)) {
foreach ($galleries as $gallery) {
$cover_picture = $this->ng_find_cover_image_for_gallery($gallery);
if (!empty($cover_picture)) {
// Gallery had (?) a previewpic set
break;
} else {
// Gallery has no pics
$cover_picture = 'needed';
}
}
}
}
if ($cover_picture === 'needed') {
// If cover picture is still not found yet
if (!empty($sub_albums)) {
foreach ($sub_albums as $sub_album) {
if ($sub_album !== $parent_album_id) {
// Protection against infinite recursion
$cover_picture = $this->jig_ng_find_subalbums($sub_album, 'needed');
// Recursive call of this function
} else {
// It would have been the same album in the same album .. (infinitely)
$cover_picture = NULL;
}
if ($cover_picture !== NULL) {
// The recursive function call found a preview picture
break;
} else {
// The recursive function call could not find a picture, this album won't be shown
$cover_picture = 'needed';
}
}
}
}
if ($cover_picture !== 'needed' && !empty($cover_picture)) {
// If there is a cover picture (should be)
if ($count === true) {
// And this is not a recursively called function but the main one, include extra data for the album
$cover_picture->jig['galleryCount'] = count($galleries);
$cover_picture->jig['albumCount'] = count($sub_albums);
$cover_picture->jig['slug'] = $parent_album->slug;
$cover_picture->jig['id'] = $parent_album->id;
$cover_picture->jig['pageid'] = $parent_album->pageid;
$cover_picture->jig['name'] = nggGallery::i18n($parent_album->name, 'album_' . $parent_album->id . '_name');
$cover_picture->jig['albumdesc'] = nggGallery::i18n($parent_album->albumdesc, 'album_' . $parent_album->id . '_albumdesc');
}
return $cover_picture;
} else {
// This album won't be shown!
return NULL;
}
} else {
//$notice_after .= sprintf(__('There is no content in the NextGEN album: "%1$s"!', 'jig_td'),stripcslashes($parent_album->name));
return NULL;
}
}
示例10: __get
/**
* Lazy-loader for image variables.
*
* @param string $name Parameter name
* @return mixed
*/
public function __get($name)
{
if (isset($this->_cache_overrides[$name])) {
return $this->_cache_overrides[$name];
}
// at the bottom we default to returning $this->_cache[$name].
switch ($name) {
case 'alttext':
$this->_cache['alttext'] = empty($this->_cache['alttext']) ? ' ' : html_entity_decode(stripslashes(nggGallery::i18n($this->_cache['alttext'], 'pic_' . $this->__get('id') . '_alttext')));
return $this->_cache['alttext'];
case 'author':
if ($this->_legacy) {
$gallery = $this->get_legacy_gallery($this->__get('galleryid'));
} else {
$gallery_map = $this->get_gallery($this->__get('galleryid'));
$gallery = $gallery_map->find($this->__get('galleryid'));
}
$this->_cache['author'] = $gallery->name;
return $this->_cache['author'];
case 'caption':
$caption = html_entity_decode(stripslashes(nggGallery::i18n($this->__get('description'), 'pic_' . $this->__get('id') . '_description')));
if (empty($caption)) {
$caption = ' ';
}
$this->_cache['caption'] = $caption;
return $this->_cache['caption'];
case 'description':
$this->_cache['description'] = empty($this->_cache['description']) ? ' ' : html_entity_decode(stripslashes(nggGallery::i18n($this->_cache['description'], 'pic_' . $this->__get('id') . '_description')));
return $this->_cache['description'];
case 'galdesc':
if ($this->_legacy) {
$gallery = $this->get_legacy_gallery($this->__get('galleryid'));
} else {
$gallery_map = $this->get_gallery($this->__get('galleryid'));
$gallery = $gallery_map->find($this->__get('galleryid'));
}
$this->_cache['galdesc'] = $gallery->name;
return $this->_cache['galdesc'];
case 'gid':
if ($this->_legacy) {
$gallery = $this->get_legacy_gallery($this->__get('galleryid'));
} else {
$gallery_map = $this->get_gallery($this->__get('galleryid'));
$gallery = $gallery_map->find($this->__get('galleryid'));
}
$this->_cache['gid'] = $gallery->name;
return $this->_cache['gid'];
case 'href':
return $this->__get('imageHTML');
case 'id':
return $this->_orig_image_id;
case 'imageHTML':
$tmp = '<a href="' . $this->__get('imageURL') . '" title="' . htmlspecialchars(stripslashes(nggGallery::i18n($this->__get('description'), 'pic_' . $this->__get('id') . '_description'))) . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext') . '" src="' . $this->__get('imageURL') . '"/>' . '</a>';
$this->_cache['href'] = $tmp;
$this->_cache['imageHTML'] = $tmp;
return $this->_cache['imageHTML'];
case 'imagePath':
$storage = $this->get_storage();
$this->_cache['imagePath'] = $storage->get_image_abspath($this->_orig_image, 'full');
return $this->_cache['imagePath'];
case 'imageURL':
$storage = $this->get_storage();
$this->_cache['imageURL'] = $storage->get_image_url($this->_orig_image, 'full');
return $this->_cache['imageURL'];
case 'linktitle':
$this->_cache['linktitle'] = htmlspecialchars(stripslashes(nggGallery::i18n($this->__get('description'), 'pic_' . $this->__get('id') . '_description')));
return $this->_cache['linktitle'];
case 'name':
if ($this->_legacy) {
$gallery = $this->get_legacy_gallery($this->__get('galleryid'));
} else {
$gallery_map = $this->get_gallery($this->__get('galleryid'));
$gallery = $gallery_map->find($this->__get('galleryid'));
}
$this->_cache['name'] = $gallery->name;
return $this->_cache['name'];
case 'pageid':
if ($this->_legacy) {
$gallery = $this->get_legacy_gallery($this->__get('galleryid'));
} else {
$gallery_map = $this->get_gallery($this->__get('galleryid'));
$gallery = $gallery_map->find($this->__get('galleryid'));
}
$this->_cache['pageid'] = $gallery->name;
return $this->_cache['pageid'];
case 'path':
if ($this->_legacy) {
$gallery = $this->get_legacy_gallery($this->__get('galleryid'));
} else {
$gallery_map = $this->get_gallery($this->__get('galleryid'));
$gallery = $gallery_map->find($this->__get('galleryid'));
}
$this->_cache['path'] = $gallery->name;
return $this->_cache['path'];
//.........这里部分代码省略.........
示例11: stripslashes
?>
"
title="<?php
echo stripslashes(nggGallery::i18n($image->description, 'pic_' . $image->pid . '_description'));
?>
"
<?php
echo $effect_code;
?>
>
<img title="<?php
echo stripslashes(nggGallery::i18n($image->alttext, 'pic_' . $image->pid . '_alttext'));
?>
"
alt="<?php
echo stripslashes(nggGallery::i18n($image->alttext, 'pic_' . $image->pid . '_alttext'));
?>
"
data-image-id="<?php
echo esc_attr($image->{$image->id_field});
?>
"
src="<?php
echo $image->thumbURL;
?>
"/>
</a>
<?php
}
?>
</div>
示例12: get_href_thumb_link
function get_href_thumb_link()
{
// create the a href link with the thumbanil
$this->href = "\n" . '<a href="' . $this->imageURL . '" title="' . htmlspecialchars(stripslashes(nggGallery::i18n($this->description, 'pic_' . $this->pid . '_description'))) . '" ' . $this->get_thumbcode($this->name) . '>' . "\n\t";
$this->href .= '<img alt="' . $this->alttext . '" src="' . $this->thumbURL . '"/>' . "\n" . '</a>' . "\n";
return $this->href;
}
示例13: get_option
}
global $wpdb, $ngg, $nggdb, $wp_query;
//$albumlist= $nggdb->find_all_albums('aid', 'asc', TRUE, 25, $start, false);
//$piclist = $nggdb->find_all_galleries('gid', 'asc', TRUE, 25, $start, false);
$ngg_options = get_option('ngg_options');
$siteurl = site_url();
// get the gallery id
$picID = (int) $_GET['gid'];
// get the pictures
if ($picID == 0) {
$thepictures = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
} else {
$thepictures = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->nggallery} AS t INNER JOIN {$wpdb->nggpictures} AS tt ON t.gid = tt.galleryid WHERE t.gid = '{$picID}' AND tt.exclude != 1 ORDER BY tt.{$ngg_options['galSort']} {$ngg_options['galSortDir']} ");
}
// Create XML output
header("content-type:text/xml;charset=utf-8");
echo "<gallery>\n";
if ($thepictures) {
foreach ($thepictures as $pic) {
$class = !isset($class) || $class == 'class="alternate"' ? '' : 'class="alternate"';
$gid = $pic->gid;
$name = empty($pic->title) ? $pic->name : $pic->title;
echo "\t<picture>\n";
echo "\t\t\t<title>" . $pic->alttext . "</title>\n";
echo "\t\t\t<description>" . $pic->description . "</description>\n";
echo "\t\t\t<url>" . $siteurl . "/" . $pic->path . "/" . $pic->filename . "</url>\n";
echo "\t\t\t<thumbnail>" . esc_url(nggGallery::i18n($pic->thumbURL)) . "</thumbnail>\n";
echo "\t</picture>\n";
}
}
echo "</gallery>\n";
示例14: nggallery_picturelist
//.........这里部分代码省略.........
_e('Search Images', 'nggallery');
?>
:</label>
<input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
<input type="text" id="media-search-input" name="s" value="<?php
the_search_query();
?>
" />
<input type="submit" value="<?php
_e('Search Images', 'nggallery');
?>
" class="button" />
</p>
</form>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&s=' . $_GET['s'];
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<?php
} else {
?>
<h2><?php
echo _n('Gallery', 'Galleries', 1, 'nggallery');
?>
: <?php
echo nggGallery::i18n($gallery->title);
?>
</h2>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid . '&paged=' . $_GET['paged'];
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<div id="poststuff">
<?php
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
?>
<div id="gallerydiv" class="postbox <?php
echo postbox_classes('gallerydiv', 'ngg-manage-gallery');
?>
" >
<h3><?php
_e('Gallery settings', 'nggallery');
?>
<small> (<?php
_e('Click here for more settings', 'nggallery');
?>
)</small></h3>
<div class="inside">
<table class="form-table" >
<tr>
示例15: nggShowRelatedGallery
/**
* nggShowRelatedGallery() - create a gallery based on the tags
*
* @access public
* @param string $taglist list of tags as csv
* @param integer $maxImages (optional) limit the number of images to show
* @return the content
*/
function nggShowRelatedGallery($taglist, $maxImages = 0)
{
$ngg_options = nggGallery::get_option('ngg_options');
// get now the related images
$picturelist = nggTags::find_images_for_tags($taglist, 'RAND');
// go on if not empty
if (empty($picturelist)) {
return;
}
// cut the list to maxImages
if ($maxImages > 0) {
array_splice($picturelist, $maxImages);
}
// *** build the gallery output
$out = '<div class="ngg-related-gallery">';
foreach ($picturelist as $picture) {
// get the effect code
$thumbcode = $picture->get_thumbcode(__('Related images for', 'nggallery') . ' ' . get_the_title());
$out .= '<a href="' . $picture->imageURL . '" title="' . stripslashes(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description')) . '" ' . $thumbcode . ' >';
$out .= '<img title="' . stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext')) . '" alt="' . stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext')) . '" src="' . $picture->thumbURL . '" />';
$out .= '</a>' . "\n";
}
$out .= '</div>' . "\n";
$out = apply_filters('ngg_show_related_gallery_content', $out, $taglist);
return $out;
}