本文整理汇总了PHP中__ngettext函数的典型用法代码示例。如果您正苦于以下问题:PHP __ngettext函数的具体用法?PHP __ngettext怎么用?PHP __ngettext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了__ngettext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: import_opml
/**
* Parse feeds into an array, ready to pass to the Javascript importer
*
* @param string $opml_url URL to parse feed data from, in the OPML standard.
* @return array Associative array containing feed URL, title and category (if applicable)
*/
protected function import_opml($opml_url)
{
if (empty($opml_url)) {
MessageHandler::add_error(sprintf(_r('No OPML specified')));
return false;
}
require_once LILINA_INCPATH . '/contrib/simplepie/simplepie.inc';
$opml = new SimplePie_File($opml_url);
$opml = new OPML($opml->body);
if (!empty($opml->error) || empty($opml->data)) {
MessageHandler::add_error(sprintf(_r('The OPML file could not be read. The parser said: %s'), $opml->error));
return false;
}
$feeds_num = 0;
foreach ($opml->data as $cat => $feed) {
if (!isset($feed['xmlurl']) && isset($feed[0]['xmlurl'])) {
foreach ($feed as $subfeed) {
$feeds[] = array('url' => $subfeed['xmlurl'], 'title' => $subfeed['title'], 'cat' => $cat);
++$feeds_num;
}
continue;
}
$feeds[] = array('url' => $feed['xmlurl'], 'title' => $feed['title'], 'cat' => '');
++$feeds_num;
}
MessageHandler::add(sprintf(__ngettext('Adding %d feed', 'Adding %d feeds', $feeds_num), $feeds_num));
return $feeds;
}
示例2: wpmp_msma_overview
function wpmp_msma_overview($menu)
{
$base = get_option('home');
$post_count = wp_count_posts('post');
$page_count = wp_count_posts('page');
print "<p>";
printf(__ngettext("You have one post", "You have %d posts", $c = 0 + $post_count->publish, 'wpmp'), $c);
print ' ';
printf(__ngettext("and one page", "and %d pages", $c = 0 + $page_count->publish, 'wpmp'), $c);
print ' ' . __("contained within", 'wpmp') . ' ';
printf(__ngettext("one category", "%d categories", $c = 0 + wp_count_terms('category'), 'wpmp'), $c);
print ' ' . __("and", 'wpmp') . ' ';
printf(__ngettext("one tag", "%d tags", $c = 0 + wp_count_terms('post_tag'), 'wpmp'), $c);
print ".</p>";
global $wpdb;
$comments = $wpdb->get_results("SELECT count(*) as cnt FROM {$wpdb->comments} WHERE comment_approved='0'");
$comment_count = $comments[0];
printf("<p>" . __ngettext("You have one comment to moderate", "You have %d comments to moderate", $c = 0 + $comment_count->cnt, 'wpmp') . ".</p>", $c);
print "<h3>" . __("Select an admin page:", 'wpmp') . "</h3>";
print "<p><ul>";
$not_first = false;
foreach ($menu as $name => $link) {
if ($name[0] != '_' && $not_first) {
if (substr($link, 0, 7) != "http://" && substr($link, 0, 8) != "https://") {
$link = $base . $link;
}
print "<li><a href='{$link}'>" . __("{$name}", 'wpmp') . "</a>";
}
$not_first = true;
}
print "</ul></p>";
print "<p>" . sprintf(__("...or <a%s>return to the site</a>", 'wpmp'), " href='{$base}/'") . "</p>";
print "<p>" . __("A subset of the full WordPress administration is available through this mobile interface.", 'wpmp') . "</p>";
}
示例3: wpmp_theme_theme_admin
function wpmp_theme_theme_admin()
{
if (sizeof($_POST) > 0) {
print '<div id="message" class="updated fade"><p><strong>' . wpmp_theme_options_write() . '</strong></p></div>';
if (isset($_POST['wpmp_theme_transcoder_clear_cache_now']) && $_POST['wpmp_theme_transcoder_clear_cache_now'] == 'true') {
if (function_exists('wpmp_transcoder_purge_cache') && ($count = wpmp_transcoder_purge_cache()) > 0) {
print '<div id="message" class="updated fade"><p><strong>' . sprintf(__ngettext('One file cleared from image cache', '%d files cleared from image cache', $count, 'wpmp'), $count) . '</strong></p></div>';
}
}
}
include_once 'wpmp_theme_theme_admin.php';
}
示例4: getAdSize
/**
* Outputs the name of Ads Place Size.
*
* Returns full Ads Place Size name.
*
* @since 0.1.1
*
* @param string $size Short name of Ads Place size
* @return string value of Ads Place Size Name
*/
private function getAdSize($value = '', $width = null, $height = null)
{
if ($value == '') {
return null;
}
if ($value == 'custom') {
return array('name' => __('Custom sizes', SAM_DOMAIN), 'width' => $width, 'height' => $height);
}
$aSizes = array('800x90' => sprintf('%1$s x %2$s %3$s', 800, 90, __('Large Leaderboard', SAM_DOMAIN)), '728x90' => sprintf('%1$s x %2$s %3$s', 728, 90, __('Leaderboard', SAM_DOMAIN)), '600x90' => sprintf('%1$s x %2$s %3$s', 600, 90, __('Small Leaderboard', SAM_DOMAIN)), '550x250' => sprintf('%1$s x %2$s %3$s', 550, 250, __('Mega Unit', SAM_DOMAIN)), '550x120' => sprintf('%1$s x %2$s %3$s', 550, 120, __('Small Leaderboard', SAM_DOMAIN)), '550x90' => sprintf('%1$s x %2$s %3$s', 550, 90, __('Small Leaderboard', SAM_DOMAIN)), '468x180' => sprintf('%1$s x %2$s %3$s', 468, 180, __('Tall Banner', SAM_DOMAIN)), '468x120' => sprintf('%1$s x %2$s %3$s', 468, 120, __('Tall Banner', SAM_DOMAIN)), '468x90' => sprintf('%1$s x %2$s %3$s', 468, 90, __('Tall Banner', SAM_DOMAIN)), '468x60' => sprintf('%1$s x %2$s %3$s', 468, 60, __('Banner', SAM_DOMAIN)), '450x90' => sprintf('%1$s x %2$s %3$s', 450, 90, __('Tall Banner', SAM_DOMAIN)), '430x90' => sprintf('%1$s x %2$s %3$s', 430, 90, __('Tall Banner', SAM_DOMAIN)), '400x90' => sprintf('%1$s x %2$s %3$s', 400, 90, __('Tall Banner', SAM_DOMAIN)), '234x60' => sprintf('%1$s x %2$s %3$s', 234, 60, __('Half Banner', SAM_DOMAIN)), '200x90' => sprintf('%1$s x %2$s %3$s', 200, 90, __('Tall Half Banner', SAM_DOMAIN)), '150x50' => sprintf('%1$s x %2$s %3$s', 150, 50, __('Half Banner', SAM_DOMAIN)), '120x90' => sprintf('%1$s x %2$s %3$s', 120, 90, __('Button', SAM_DOMAIN)), '120x60' => sprintf('%1$s x %2$s %3$s', 120, 60, __('Button', SAM_DOMAIN)), '83x31' => sprintf('%1$s x %2$s %3$s', 83, 31, __('Micro Bar', SAM_DOMAIN)), '728x15x4' => sprintf('%1$s x %2$s %3$s, %4$s', 728, 15, __('Thin Banner', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 4, SAM_DOMAIN), 4)), '728x15x5' => sprintf('%1$s x %2$s %3$s, %4$s', 728, 15, __('Thin Banner', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 5, SAM_DOMAIN), 5)), '468x15x4' => sprintf('%1$s x %2$s %3$s, %4$s', 468, 15, __('Thin Banner', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 4, SAM_DOMAIN), 4)), '468x15x5' => sprintf('%1$s x %2$s %3$s, %4$s', 468, 15, __('Thin Banner', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 5, SAM_DOMAIN), 5)), '160x600' => sprintf('%1$s x %2$s %3$s', 160, 600, __('Wide Skyscraper', SAM_DOMAIN)), '120x600' => sprintf('%1$s x %2$s %3$s', 120, 600, __('Skyscraper', SAM_DOMAIN)), '200x360' => sprintf('%1$s x %2$s %3$s', 200, 360, __('Wide Half Banner', SAM_DOMAIN)), '240x400' => sprintf('%1$s x %2$s %3$s', 240, 400, __('Vertical Rectangle', SAM_DOMAIN)), '180x300' => sprintf('%1$s x %2$s %3$s', 180, 300, __('Tall Rectangle', SAM_DOMAIN)), '200x270' => sprintf('%1$s x %2$s %3$s', 200, 270, __('Tall Rectangle', SAM_DOMAIN)), '120x240' => sprintf('%1$s x %2$s %3$s', 120, 240, __('Vertical Banner', SAM_DOMAIN)), '336x280' => sprintf('%1$s x %2$s %3$s', 336, 280, __('Large Rectangle', SAM_DOMAIN)), '336x160' => sprintf('%1$s x %2$s %3$s', 336, 160, __('Wide Rectangle', SAM_DOMAIN)), '334x100' => sprintf('%1$s x %2$s %3$s', 334, 100, __('Wide Rectangle', SAM_DOMAIN)), '300x250' => sprintf('%1$s x %2$s %3$s', 300, 250, __('Medium Rectangle', SAM_DOMAIN)), '300x150' => sprintf('%1$s x %2$s %3$s', 300, 150, __('Small Wide Rectangle', SAM_DOMAIN)), '300x125' => sprintf('%1$s x %2$s %3$s', 300, 125, __('Small Wide Rectangle', SAM_DOMAIN)), '300x70' => sprintf('%1$s x %2$s %3$s', 300, 70, __('Mini Wide Rectangle', SAM_DOMAIN)), '250x250' => sprintf('%1$s x %2$s %3$s', 250, 250, __('Square', SAM_DOMAIN)), '200x200' => sprintf('%1$s x %2$s %3$s', 200, 200, __('Small Square', SAM_DOMAIN)), '200x180' => sprintf('%1$s x %2$s %3$s', 200, 180, __('Small Rectangle', SAM_DOMAIN)), '180x150' => sprintf('%1$s x %2$s %3$s', 180, 150, __('Small Rectangle', SAM_DOMAIN)), '160x160' => sprintf('%1$s x %2$s %3$s', 160, 160, __('Small Square', SAM_DOMAIN)), '125x125' => sprintf('%1$s x %2$s %3$s', 125, 125, __('Button', SAM_DOMAIN)), '200x90x4' => sprintf('%1$s x %2$s %3$s, %4$s', 200, 90, __('Tall Half Banner', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 4, SAM_DOMAIN), 4)), '200x90x5' => sprintf('%1$s x %2$s %3$s, %4$s', 200, 90, __('Tall Half Banner', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 5, SAM_DOMAIN), 5)), '180x90x4' => sprintf('%1$s x %2$s %3$s, %4$s', 180, 90, __('Half Banner', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 4, SAM_DOMAIN), 4)), '180x90x5' => sprintf('%1$s x %2$s %3$s, %4$s', 180, 90, __('Half Banner', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 5, SAM_DOMAIN), 5)), '160x90x4' => sprintf('%1$s x %2$s %3$s, %4$s', 160, 90, __('Tall Button', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 4, SAM_DOMAIN), 4)), '160x90x5' => sprintf('%1$s x %2$s %3$s, %4$s', 160, 90, __('Tall Button', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 5, SAM_DOMAIN), 5)), '120x90x4' => sprintf('%1$s x %2$s %3$s, %4$s', 120, 90, __('Button', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 4, SAM_DOMAIN), 4)), '120x90x5' => sprintf('%1$s x %2$s %3$s, %4$s', 120, 90, __('Button', SAM_DOMAIN), sprintf(__ngettext('%d Link', '%d Links', 5, SAM_DOMAIN), 5)));
$aSize = explode("x", $value);
//$aSize = preg_split("[x]", $value, null, PREG_SPLIT_NO_EMPTY);
return array('name' => $aSizes[$value], 'width' => $aSize[0], 'height' => $aSize[1]);
}
示例5: widget
/**
* Display widget
*/
function widget($args, $instance)
{
global $wpdb, $current_user;
if (!is_user_logged_in()) {
return;
}
extract($args);
$title = apply_filters('widget_title', $instance['title']);
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
// get number of PM
$num_pm = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'pm WHERE `recipient` = "' . $current_user->user_login . '" AND `deleted` != "2"');
$num_unread = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'pm WHERE `recipient` = "' . $current_user->user_login . '" AND `read` = 0 AND `deleted` != "2"');
if (empty($num_pm)) {
$num_pm = 0;
}
if (empty($num_unread)) {
$num_unread = 0;
}
echo '<p><b>', sprintf(__ngettext('You have %d private message. %d unread.', 'You have %d private messages. %d unread.', $num_pm, 'pm4wp'), $num_pm, $num_unread), '</b></p>';
if ($instance['num_pm']) {
$msgs = $wpdb->get_results('SELECT `id`, `sender`, `subject`, `read`, `date` FROM ' . $wpdb->prefix . 'pm WHERE `recipient` = "' . $current_user->user_login . '" AND `deleted` != "2" ORDER BY `date` DESC LIMIT ' . $instance['num_pm']);
if (count($msgs)) {
echo '<ol>';
foreach ($msgs as $msg) {
$msg->sender = $wpdb->get_var("SELECT display_name FROM {$wpdb->users} WHERE user_login = '{$msg->sender}'");
echo '<li>';
if (!$msg->read) {
echo '<b>';
}
echo $msg->subject;
if (!$msg->read) {
echo '</b>';
}
printf(__('<br />by <b>%s</b><br />at %s', 'pm4wp'), $msg->sender, $msg->date);
echo '</li>';
}
echo '</ol>';
}
}
echo '<p><a href="', get_bloginfo('wpurl'), '/wp-admin/admin.php?page=rwpm_inbox">', __('Click here to go to inbox', 'pm4wp'), ' »</a></p>';
echo $after_widget;
}
示例6: wp_new_user_notification
function wp_new_user_notification($user_id, $plaintext_pass = '')
{
global $wpdb, $mySabre;
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
$message = sprintf(__('New user registration on your site %s:', 'sabre'), get_option('blogname')) . "\r\n\r\n";
$message .= sprintf(__('Username: %s', 'sabre'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s', 'sabre'), $user_email) . "\r\n";
$sabre_opt = $mySabre->get_option('sabre_opt');
$mail_from = "From: ";
$mail_from .= (!empty($sabre_opt['mail_from_name']) ? $sabre_opt['mail_from_name'] : get_option('blogname')) . " <";
$mail_from .= (!empty($sabre_opt['mail_from_mail']) ? $sabre_opt['mail_from_mail'] : get_option('admin_email')) . ">";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration', 'sabre'), get_option('blogname')), $message, $mail_from);
if (empty($plaintext_pass)) {
return;
}
if ($sabre_opt['user_pwd'] == 'true') {
$plaintext_pass = $_POST['user_pwd1'];
wp_set_password($plaintext_pass, $user_id);
delete_user_setting('default_password_nag', $user_id);
update_user_option($user_id, 'default_password_nag', false, true);
}
$message = sprintf(__('Thank you for registering on %s', 'sabre'), get_option('blogname')) . "\r\n\r\n";
$message .= sprintf(__('Username: %s', 'sabre'), $user_login) . "\r\n";
if ($sabre_opt['user_pwd'] == 'true') {
$message .= __('Use the password defined during your registration', 'sabre') . "\r\n\r\n";
} else {
$message .= sprintf(__('Password: %s', 'sabre'), $plaintext_pass) . "\r\n\r\n";
}
if ($sabre_opt['enable_confirm'] == 'user') {
$message .= sprintf(__ngettext('You must confirm your registration within %s day by following the link below', 'You must confirm your registration within %s days by following the link below', $sabre_opt['period'], 'sabre'), $sabre_opt['period']) . "\r\n\r\n";
$message .= get_option('siteurl') . "/wp-login.php?sabre_confirm=" . md5($_POST['sabre_id']) . "\r\n";
} elseif ($sabre_opt['enable_confirm'] == 'admin') {
$message .= __('Your registration has to be validated by the administrator before you can sign on the site. You will be advised by e-mail upon completion.', 'sabre') . "\r\n\r\n";
$message .= get_option('siteurl') . "/wp-login.php\r\n";
} else {
$message .= get_option('siteurl') . "/wp-login.php\r\n";
}
wp_mail($user_email, sprintf(__('[%s] - Your registration information', 'sabre'), get_option('blogname')), $message, $mail_from);
}
示例7: check_post_keyword
function check_post_keyword($precheck = true)
{
global $wpdb;
echo '<div class="narrow">';
echo '<p><h3>' . __('Reading Bunny’s Technorati Tags…') . '</h3></p>';
// import Bunny's Keywords tags
$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM {$wpdb->postmeta} WHERE {$wpdb->postmeta}.meta_key = 'tags'");
if (!is_array($metakeys)) {
echo '<p>' . __('No Tags Found!') . '</p>';
return false;
} else {
$count = count($metakeys);
echo '<p>' . sprintf(__ngettext('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count) . '<br /></p>';
echo '<ul>';
foreach ($metakeys as $post_meta) {
if ($post_meta->meta_value != '') {
$post_keys = explode(' ', $post_meta->meta_value);
foreach ($post_keys as $keyword) {
$keyword = addslashes(trim(str_replace('+', ' ', $keyword)));
if ('' != $keyword) {
echo '<li>' . $post_meta->post_id . ' - ' . $keyword . '</li>';
if (!$precheck) {
wp_add_post_tags($post_meta->post_id, $keyword);
}
}
}
}
if (!$precheck) {
delete_post_meta($post_meta->post_id, 'tags');
}
}
echo '</ul>';
}
echo '<form action="admin.php?import=btt&step=' . ($precheck ? 2 : 3) . '" method="post">';
wp_nonce_field('import-btt');
echo '<p class="submit"><input type="submit" name="submit" class="button" value="' . __('Next') . '" /></p>';
echo '</form>';
echo '</div>';
}
示例8: look_for_entities
function look_for_entities(&$cmt_object, $part)
{
$hit = $letter_entities = 0;
if ($total = preg_match_all('|&#([0-9]{1,5});|', $cmt_object->{$part}, $matches)) {
foreach ($matches[1] as $match) {
if ($match >= 65 && $match <= 90 || $match >= 97 && $match <= 122) {
$letter_entities++;
}
}
}
if ($double_entities = preg_match_all('|&#[0-9]{1,2};|', $cmt_object->{$part}, $matches)) {
$log = sprintf(__ngettext("Comment %s contains %d <em>double</em> entity", "Comment %s contains %d <em>double</em> entities ", $double_entities, 'sk2'), $part, $double_entities) . " " . sprintf(__ngettext("and one regular entity coding for a letter (%d total).", " and %d regular entities coding for a letter (%d total).", $letter_entities, 'sk2'), $letter_entities, $total);
$hit = $double_entities * 5 + $letter_entities * 2;
} elseif ($letter_entities) {
$log = sprintf(__ngettext("Comment %s contains %d entity coding for a letter (%d total).", "Comment one contains %d entities coding for a letter (%d total).", $letter_entities), $part, $letter_entities, $total, 'sk2');
$hit = 1 + $letter_entities * 2;
}
if ($hit) {
$this->log_msg($log, 2);
$this->hit_karma($cmt_object, $hit, $log);
}
}
示例9: add_menu
function add_menu()
{
add_menu_page(__ngettext('Gallery', 'Galleries', 1, 'nggallery'), __ngettext('Gallery', 'Galleries', 1, 'nggallery'), 'NextGEN Gallery overview', NGGFOLDER, array(&$this, 'show_menu'), NGGALLERY_URLPATH . 'admin/images/nextgen.png');
add_submenu_page(NGGFOLDER, __('Overview', 'nggallery'), __('Overview', 'nggallery'), 'NextGEN Gallery overview', NGGFOLDER, array(&$this, 'show_menu'));
add_submenu_page(NGGFOLDER, __('Add Gallery / Images', 'nggallery'), __('Add Gallery / Images', 'nggallery'), 'NextGEN Upload images', 'nggallery-add-gallery', array(&$this, 'show_menu'));
add_submenu_page(NGGFOLDER, __('Manage Gallery', 'nggallery'), __('Manage Gallery', 'nggallery'), 'NextGEN Manage gallery', 'nggallery-manage-gallery', array(&$this, 'show_menu'));
add_submenu_page(NGGFOLDER, __ngettext('Album', 'Albums', 1, 'nggallery'), __ngettext('Album', 'Albums', 1, 'nggallery'), 'NextGEN Edit album', 'nggallery-manage-album', array(&$this, 'show_menu'));
add_submenu_page(NGGFOLDER, __('Tags', 'nggallery'), __('Tags', 'nggallery'), 'NextGEN Manage tags', 'nggallery-tags', array(&$this, 'show_menu'));
add_submenu_page(NGGFOLDER, __('Options', 'nggallery'), __('Options', 'nggallery'), 'NextGEN Change options', 'nggallery-options', array(&$this, 'show_menu'));
if (wpmu_enable_function('wpmuStyle')) {
add_submenu_page(NGGFOLDER, __('Style', 'nggallery'), __('Style', 'nggallery'), 'NextGEN Change style', 'nggallery-style', array(&$this, 'show_menu'));
}
add_submenu_page(NGGFOLDER, __('Setup Gallery', 'nggallery'), __('Setup', 'nggallery'), 'activate_plugins', 'nggallery-setup', array(&$this, 'show_menu'));
if (wpmu_enable_function('wpmuRoles')) {
add_submenu_page(NGGFOLDER, __('Roles', 'nggallery'), __('Roles', 'nggallery'), 'activate_plugins', 'nggallery-roles', array(&$this, 'show_menu'));
}
add_submenu_page(NGGFOLDER, __('About this Gallery', 'nggallery'), __('About', 'nggallery'), 'NextGEN Gallery overview', 'nggallery-about', array(&$this, 'show_menu'));
if (wpmu_site_admin()) {
add_submenu_page('wpmu-admin.php', __('NextGEN Gallery', 'nggallery'), __('NextGEN Gallery', 'nggallery'), 'activate_plugins', 'nggallery-wpmu', array(&$this, 'show_menu'));
}
//register the column fields
$this->register_columns();
}
示例10: ngg_overview_right_now
/**
* Show a summary of the used images
*
* @return void
*/
function ngg_overview_right_now()
{
global $wpdb;
$images = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->nggpictures}"));
$galleries = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->nggallery}"));
$albums = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->nggalbum}"));
?>
<p class="sub"><?php
_e('At a Glance', 'nggallery');
?>
</p>
<div class="table">
<table>
<tbody>
<tr class="first">
<td class="first b"><a href="admin.php?page=nggallery-add-gallery"><?php
echo $images;
?>
</a></td>
<td class="t"><?php
echo __ngettext('Image', 'Images', $images, 'nggallery');
?>
</td>
<td class="b"></td>
<td class="last"></td>
</tr>
<tr>
<td class="first b"><a href="admin.php?page=nggallery-manage-gallery"><?php
echo $galleries;
?>
</a></td>
<td class="t"><?php
echo __ngettext('Gallery', 'Galleries', $galleries, 'nggallery');
?>
</td>
<td class="b"></td>
<td class="last"></td>
</tr>
<tr>
<td class="first b"><a href="admin.php?page=nggallery-manage-album"><?php
echo $albums;
?>
</a></td>
<td class="t"><?php
echo __ngettext('Album', 'Albums', $albums, 'nggallery');
?>
</td>
<td class="b"></td>
<td class="last"></td>
</tr>
</tbody>
</table>
</div>
<div class="versions">
<p>
<?php
if (current_user_can('NextGEN Upload images')) {
?>
<a class="button rbutton" href="admin.php?page=nggallery-add-gallery"><strong><?php
_e('Upload pictures', 'nggallery');
?>
</strong></a><?php
}
?>
<?php
_e('Here you can control your images, galleries and albums.', 'nggallery');
?>
</p>
<span>
<?php
$userlevel = '<span class="b">' . (current_user_can('manage_options') ? __('Gallery Administrator', 'nggallery') : __('Gallery Editor', 'nggallery')) . '</span>';
printf(__('You currently have %s rights.', 'nggallery'), $userlevel);
?>
</span>
</div>
<?php
}
示例11: tags_tab
function tags_tab()
{
$this->populate_tags();
$tags_num = count($this->all_tags);
echo '<br class="clear" />';
if ($tags_num > 0) {
screen_icon();
echo '<h2>' . sprintf(__ngettext('Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num), $tags_num) . '</h2>';
echo '<div class="narrow">';
echo '<p>' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '</p>';
echo '<p>' . __('The newly created categories will still be associated with the same posts.') . '</p></div>';
$this->tags_form();
} else {
echo '<p>' . __('You have no tags to convert!') . '</p>';
}
}
示例12: _e
echo '<br />';
}
echo '</p></div>';
}
}
?>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<h2><?php _e('Manage Comments'); ?></h2>
<ul class="subsubsub">
<?php
$status_links = array();
$num_comments = wp_count_comments();
$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 'approved' => _c('Approved|plural'));
$class = ( '' === $comment_status ) ? ' class="current"' : '';
$status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>";
foreach ( $stati as $status => $label ) {
$class = '';
if ( $status == $comment_status )
$class = ' class="current"';
$status_links[] = "<li><a href=\"edit-comments.php?comment_status=$status\"$class>" . $label . '</a>';
}
$status_links = apply_filters( 'comment_status_links', $status_links );
echo implode(' | </li>', $status_links) . '</li>';
unset($status_links);
示例13: die
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
die(__('Please do not load this page directly. Thanks!', 'arras'));
}
if (post_password_required()) {
_e('<p class="nocomments">This post is password protected. Enter the password to view comments.</p>', 'arras');
return;
}
if (have_comments()) {
?>
<?php
if (!empty($comments_by_type['comment'])) {
?>
<h4 class="module-title"><?php
comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __ngettext('% Comment', '% Comments', get_comments_number(), 'arras'));
?>
</h4>
<ol id="commentlist" class="clearfix">
<?php
wp_list_comments('type=comment&callback=arras_list_comments');
?>
</ol>
<div class="comments-navigation clearfix">
<div class="floatleft"><?php
previous_comments_link(__('« View Older', 'arras'));
?>
</div>
<div class="floatright"><?php
next_comments_link(__('View Newer »', 'arras'));
?>
示例14: ec3_upgrade_posts
/** Only include this file if a database upgrade is called for.
* Otherwise it can be safely ignored. */
function ec3_upgrade_posts()
{
if (!function_exists('__ngettext')) {
function __ngettext($single, $plural, $number, $domain = 'default')
{
if ($number == 1) {
return __($single, $domain);
} else {
return __($plural, $domain);
}
}
}
global $ec3, $post, $wpdb;
$ec3->advanced = false;
$changed = ec3_upgrade_posts_apply();
$query =& new WP_Query();
$query->query('nopaging=1&cat=' . $ec3->event_category);
$format = 'Y-m-d H:i:s';
$now = time();
$rownum = 0;
?>
<?php
if ($changed) {
?>
<div id="message" class="updated fade"><p><strong>
<?php
$msg = __ngettext('Post upgraded.', '%d posts upgraded.', $changed, 'ec3');
echo sprintf($msg, $changed);
?>
</strong></p></div>
<?php
}
?>
<div class="wrap">
<form method="post">
<h2><?php
_e('Upgrade Event Posts (from version 3.0)', 'ec3');
?>
</h2>
<?php
if ($query->have_posts()) {
?>
<input type="hidden" name="ec3_action" value="upgrade_posts" />
<table class="widefat">
<thead>
<tr>
<th scope="col">OK</th>
<th scope="col">Title</th>
<th scope="col">Post date</th>
<th scope="col">Event date</th>
</tr>
</thead>
<?php
while ($query->have_posts()) {
$query->the_post();
?>
<?php
if (empty($post->ec3_schedule)) {
$post_date = get_post_time();
$post_modified_date = get_post_modified_time();
$rownum++;
if ($rownum % 2) {
$rowclass = 'alternate ';
} else {
$rowclass = '';
}
if ($post_modified_date >= $now) {
$errstyle = 'background-color:#fcc';
} else {
$errstyle = '';
}
?>
<tr class="<?php
echo $rowclass;
?>
">
<td>
<input type="checkbox" name="ec3_upgrade_<?php
the_ID();
?>
"
value="1" checked="checked" />
</td>
<td title="Post ID: <?php
the_ID();
?>
">
<a target="_blank" href="<?php
//.........这里部分代码省略.........
示例15: WP_members_list_list
function WP_members_list_list()
{
global $wp_roles, $getWP, $tern_wp_msg, $tern_wp_members_defaults, $current_user, $notice;
get_currentuserinfo();
$o = $getWP->getOption('tern_wp_members', $tern_wp_members_defaults);
$wps = new WP_User_Search($_GET['query'], $_GET['userspage'], $_GET['role']);
$paging_text = paginate_links(array('total' => ceil($wps->total_users_for_query / $wps->users_per_page), 'current' => $wps->page, 'base' => 'admin.php?page=members-list-edit-members-list&%_%', 'format' => 'userspage=%#%', 'add_args' => $args));
if ($paging_text) {
$paging_text = sprintf('<span class="displaying-num">' . __('Displaying %s–%s of %s') . '</span>%s', number_format_i18n(($wps->page - 1) * $wps->users_per_page + 1), number_format_i18n(min($wps->page * $wps->users_per_page, $wps->total_users_for_query)), number_format_i18n($wps->total_users_for_query), $paging_text);
}
?>
<div class="wrap">
<div id="icon-users" class="icon32"><br /></div>
<h2>Members List</h2>
<?php
if (!empty($notice)) {
?>
<div id="notice" class="error"><p><?php
echo $notice;
?>
</p></div><?php
}
?>
<p>Here you are able to select which of your members you'd like to show or hide in your members list. By default all members are showm.</p>
<?php
if (!empty($tern_wp_msg)) {
echo '<div id="message" class="updated fade"><p>' . $tern_wp_msg . '</p></div>';
}
?>
<div class="filter">
<form id="list-filter" action="" method="get">
<ul class="subsubsub">
<?php
$l = array();
$a = array();
$u = get_users_of_blog();
$t = count($u);
foreach ((array) $u as $c) {
$d = unserialize($c->meta_value);
foreach ((array) $d as $e => $v) {
if (!isset($a[$e])) {
$a[$e] = 0;
}
$a[$e]++;
}
}
unset($u);
$current_role = false;
$class = empty($role) ? ' class="current"' : '';
$l[] = "<li><a href='admin.php?page=members-list-edit-members-list'{$class}>" . sprintf(__ngettext('All<span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $t), number_format_i18n($t)) . '</a>';
foreach ($wp_roles->get_names() as $s => $name) {
if (!isset($a[$s])) {
continue;
}
$class = '';
if ($s == $role) {
$current_role = $role;
$class = ' class="current"';
}
$name = translate_with_context($name);
$name = sprintf(_c('%1$s <span class="count">(%2$s)</span>|user role with count'), $name, $a[$s]);
$l[] = "<li><a href='admin.php?page=members-list-edit-members-list&role={$s}'{$class}>{$name}</a>";
}
echo implode(" |</li>\n", $l) . '</li>';
unset($l);
?>
</ul>
</form>
</div>
<form class="search-form" action="" method="get">
<p class="search-box">
<label class="hidden" for="user-search-input">Search Users:</label>
<input type="text" class="search-input" id="user-search-input" name="query" value="" />
<input type="hidden" id="page" name="page" value="<?php
echo $_REQUEST['page'];
?>
" />
<input type="submit" value="Search Users" class="button" />
</p>
</form>
<form id="posts-filter" action="" method="get">
<div class="tablenav">
<?php
if ($wps->results_are_paged()) {
?>
<div class="tablenav-pages"><?php
echo $paging_text;
?>
</div>
<?php
}
?>
<div class="alignleft actions">
<select name="action">
<option value="" selected="selected">Bulk Actions</option>
<option value="show">Show</option>
<option value="hide">Hide</option>
</select>
<input type="submit" value="Apply" name="doaction" id="doaction" class="button-secondary action" />
</div>
//.........这里部分代码省略.........