当前位置: 首页>>代码示例>>PHP>>正文


PHP _n函数代码示例

本文整理汇总了PHP中_n函数的典型用法代码示例。如果您正苦于以下问题:PHP _n函数的具体用法?PHP _n怎么用?PHP _n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_n函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pdfMain

 static function pdfMain(PluginPdfSimplePDF $pdf, KnowbaseItem $item)
 {
     global $DB;
     $ID = $item->getField('id');
     if (!Session::haveRight('knowbase', 'r') || !Session::haveRight('faq', 'r')) {
         return false;
     }
     $knowbaseitemcategories_id = $item->getField('knowbaseitemcategories_id');
     $fullcategoryname = Html::clean(getTreeValueCompleteName("glpi_knowbaseitemcategories", $knowbaseitemcategories_id));
     $question = Html::clean(Toolbox::unclean_cross_side_scripting_deep(html_entity_decode($item->getField('name'), ENT_QUOTES, "UTF-8")));
     $answer = Html::clean(Toolbox::unclean_cross_side_scripting_deep(html_entity_decode($item->getField('answer'), ENT_QUOTES, "UTF-8")));
     $pdf->setColumnsSize(100);
     if (Toolbox::strlen($fullcategoryname) > 0) {
         $pdf->displayTitle('<b>' . __('Category name') . '</b>');
         $pdf->displayLine($fullcategoryname);
     }
     if (Toolbox::strlen($question) > 0) {
         $pdf->displayTitle('<b>' . __('Subject') . '</b>');
         $pdf->displayText('', $question, 5);
     } else {
         $pdf->displayTitle('<b>' . __('No question found', 'pdf') . '</b>');
     }
     if (Toolbox::strlen($answer) > 0) {
         $pdf->displayTitle('<b>' . __('Content') . '</b>');
         $pdf->displayText('', $answer, 5);
     } else {
         $pdf->displayTitle('<b>' . __('No answer found') . '</b>');
     }
     $pdf->setColumnsSize(50, 15, 15, 10, 10);
     $pdf->displayTitle(__('Writer'), __('Creation date'), __('Last update'), __('FAQ'), _n('View', 'Views', 2));
     $pdf->displayLine(getUserName($item->fields["users_id"]), Html::convDateTime($item->fields["date"]), Html::convDateTime($item->fields["date_mod"]), Dropdown::getYesNo($item->fields["is_faq"]), $item->fields["view"]);
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:33,代码来源:knowbaseitem.class.php

示例2: recheck_queue

 /**
  * Recheck all comments in the Pending queue.
  *
  * ## EXAMPLES
  *
  *     wp akismet recheck_queue
  *
  * @alias recheck-queue
  */
 public function recheck_queue()
 {
     $batch_size = 100;
     $start = 0;
     $total_counts = array();
     do {
         $result_counts = Akismet_Admin::recheck_queue_portion($start, $batch_size);
         if ($result_counts['processed'] > 0) {
             foreach ($result_counts as $key => $count) {
                 if (!isset($total_counts[$key])) {
                     $total_counts[$key] = $count;
                 } else {
                     $total_counts[$key] += $count;
                 }
             }
             $start += $batch_size;
             $start -= $result_counts['spam'];
             // These comments will have been removed from the queue.
         }
     } while ($result_counts['processed'] > 0);
     WP_CLI::line(sprintf(_n("Processed %d comment.", "Processed %d comments.", $total_counts['processed'], 'akismet'), number_format($total_counts['processed'])));
     WP_CLI::line(sprintf(_n("%d comment moved to Spam.", "%d comments moved to Spam.", $total_counts['spam'], 'akismet'), number_format($total_counts['spam'])));
     if ($total_counts['error']) {
         WP_CLI::line(sprintf(_n("%d comment could not be checked.", "%d comments could not be checked.", $total_counts['error'], 'akismet'), number_format($total_counts['error'])));
     }
 }
开发者ID:coreymargulis,项目名称:karenmargulis,代码行数:35,代码来源:class.akismet-cli.php

示例3: woo_warp_side_cart

function woo_warp_side_cart()
{
    ?>

 <link rel="stylesheet" type="text/css" href="<?php 
    echo '' . plugins_url('css/style.css', __FILE__) . '';
    ?>
">

    <div class="side-cart uk-panel uk-panel-box uk-panel-box-secondary"> 
        <span  class="ww-cart-icon side-cart uk-panel uk-panel-box uk-panel-box-primary">
            <span class="uk-icon-shopping-cart"></span>
        </span>
        <p>
            <?php 
    echo sprintf(_n('%d item', '%d items', WC()->cart->cart_contents_count), WC()->cart->cart_contents_count);
    ?>
 
                <br /> 
            <?php 
    echo WC()->cart->get_cart_total();
    ?>
        </p>
        <a class="uk-button uk-button-mini uk-width-1-1 uk-button-primary" href="<?php 
    echo WC()->cart->get_cart_url();
    ?>
" title="<?php 
    _e('View Cart');
    ?>
">View Cart</a>
    </div> 
<?php 
}
开发者ID:ericwallen,项目名称:woocommerce-uikit-side-cart,代码行数:33,代码来源:index.php

示例4: pdfForSoftware

 static function pdfForSoftware(PluginPdfSimplePDF $pdf, Software $software, $infocom = false)
 {
     global $DB;
     $sID = $software->getField('id');
     $license = new SoftwareLicense();
     $query = "SELECT `id`\n                FROM `glpi_softwarelicenses`\n                WHERE `softwares_id` = '" . $sID . "' " . getEntitiesRestrictRequest('AND', 'glpi_softwarelicenses', '', '', true) . "\n                ORDER BY `name`";
     $pdf->setColumnsSize(100);
     $pdf->displayTitle('<b>' . _n('License', 'Licenses', 2) . '</b>');
     if ($result = $DB->query($query)) {
         if ($DB->numrows($result)) {
             for ($tot = 0; $data = $DB->fetch_assoc($result);) {
                 if ($license->getFromDB($data['id'])) {
                     self::pdfMain($pdf, $license, false);
                     if ($infocom) {
                         PluginPdfInfocom::pdfForItem($pdf, $license);
                     }
                 }
             }
         } else {
             $pdf->displayLine(__('No item found'));
         }
     } else {
         $pdf->displayLine(__('No item found'));
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:26,代码来源:softwarelicense.class.php

示例5: setup

 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 1.0.0
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, $data)
 {
     parent::setup($action, $data);
     add_thickbox();
     $this->admin_page->enqueue_script('list', array('jquery'), array('list' => array('shortcode_popup' => __('To embed this table into a post or page, use this Shortcode:', 'tablepress'), 'donation-message-already-donated' => __('Thank you very much! Your donation is highly appreciated. You just contributed to the further development of TablePress!', 'tablepress'), 'donation-message-maybe-later' => sprintf(__('No problem! I still hope you enjoy the benefits that TablePress adds to your site. If you should change your mind, you\'ll always find the &#8220;Donate&#8221; button on the <a href="%s">TablePress website</a>.', 'tablepress'), 'http://tablepress.org/'))));
     if ($data['messages']['first_visit']) {
         $this->add_header_message('<strong><em>' . __('Welcome!', 'tablepress') . '</em></strong><br />' . __('Thank you for using TablePress for the first time!', 'tablepress') . ' ' . sprintf(__('If you encounter any questions or problems, please visit the <a href="%1$s">FAQ</a>, the <a href="%2$s">documentation</a>, and the <a href="%3$s">Support</a> section on the <a href="%4$s">plugin website</a>.', 'tablepress'), 'http://tablepress.org/faq/', 'http://tablepress.org/documentation/', 'http://tablepress.org/support/', 'http://tablepress.org/') . '<br /><br />' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'first_visit', 'return' => 'list'), __('Hide this message', 'tablepress')));
     }
     if ($data['messages']['wp_table_reloaded_warning']) {
         $this->add_header_message('<strong><em>' . __('Attention!', 'tablepress') . '</em></strong><br />' . __('You have activated the plugin WP-Table Reloaded, which can not be used together with TablePress.', 'tablepress') . '<br />' . __('It is strongly recommended that you switch from WP-Table Reloaded to TablePress, which not only fixes many problems, but also has more and better features than WP-Table Reloaded.', 'tablepress') . '<br />' . sprintf(__('Please follow the <a href="%s">migration guide</a> to move your tables and then deactivate WP-Table Reloaded!', 'tablepress'), 'http://tablepress.org/migration-from-wp-table-reloaded/') . '<br />' . '<a href="' . TablePress::url(array('action' => 'import')) . '" class="button button-primary button-large" title="' . __('Import your tables from WP-Table Reloaded', 'tablepress') . '" style="color:#ffffff;margin-top:5px;">' . __('Import your tables from WP-Table Reloaded', 'tablepress') . '</a>', 'error');
     }
     if ($data['messages']['donation_message']) {
         $this->add_header_message('<img alt="' . __('Tobias Bäthge, developer of TablePress', 'tablepress') . '" src="https://secure.gravatar.com/avatar/50f1cff2e27a1f522b18ce229c057bc5?s=94" height="94" width="94" style="float:left;margin-right:10px;" />' . __('Hi, my name is Tobias, I\'m the developer of the TablePress plugin.', 'tablepress') . '<br /><br />' . __('Thanks for using it! You\'ve installed TablePress over a month ago.', 'tablepress') . ' ' . sprintf(_n('If everything works and you are satisfied with the results of managing your %s table, isn\'t that worth a coffee or two?', 'If everything works and you are satisfied with the results of managing your %s tables, isn\'t that worth a coffee or two?', $data['table_count'], 'tablepress'), $data['table_count']) . '<br/>' . sprintf(__('<a href="%s">Donations</a> help me to continue user support and development of this <em>free</em> software &mdash; things for which I spend countless hours of my free time! Thank you very much!', 'tablepress'), 'http://tablepress.org/donate/') . '<br/><br />' . __('Sincerly, Tobias', 'tablepress') . '<br /><br />' . sprintf('<a href="%s" target="_blank"><strong>%s</strong></a>', 'http://tablepress.org/donate/', __('Sure, I\'ll buy you a coffee and support TablePress!', 'tablepress')) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list', 'target' => 'already-donated'), __('I already donated.', 'tablepress')) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list', 'target' => 'maybe-later'), __('No, thanks. Don\'t ask again.', 'tablepress')));
     }
     if ($data['messages']['show_plugin_update']) {
         $message = '<strong><em>' . sprintf(__('Thank you for updating to TablePress %s!', 'tablepress'), TablePress::version) . '</em></strong><br />';
         if (!empty($data['messages']['plugin_update_message'])) {
             $message .= $data['messages']['plugin_update_message'] . '<br />';
         }
         $message .= sprintf(__('Please read the <a href="%s">release announcement</a> for more information.', 'tablepress'), 'http://tablepress.org/news/') . ' ' . sprintf(__('If you like the new features and enhancements, <a href="%s">giving a donation</a> towards the further support and development of TablePress is recommended. Thank you!', 'tablepress'), 'http://tablepress.org/donate/') . '<br /><br />';
         $message .= $this->ajax_link(array('action' => 'hide_message', 'item' => 'plugin_update', 'return' => 'list'), __('Hide this message', 'tablepress'));
         $this->add_header_message($message);
     }
     $this->process_action_messages(array('success_delete' => _n('The table was deleted successfully.', 'The tables were deleted successfully.', 1, 'tablepress'), 'success_delete_plural' => _n('The table was deleted successfully.', 'The tables were deleted successfully.', 2, 'tablepress'), 'error_delete' => __('Error: The table could not be deleted.', 'tablepress'), 'error_save' => __('Error: The table could not be saved.', 'tablepress'), 'success_copy' => _n('The table was copied successfully.', 'The tables were copied successfully.', 1, 'tablepress'), 'success_copy_plural' => _n('The table was copied successfully.', 'The tables were copied successfully.', 2, 'tablepress'), 'error_copy' => __('Error: The table could not be copied.', 'tablepress'), 'error_no_table' => __('Error: You did not specify a valid table ID.', 'tablepress'), 'error_load_table' => __('Error: This table could not be loaded!', 'tablepress'), 'error_bulk_action_invalid' => __('Error: This bulk action is invalid!', 'tablepress'), 'error_no_selection' => __('Error: You did not select any tables!', 'tablepress'), 'error_delete_not_all_tables' => __('Notice: Not all selected tables could be deleted!', 'tablepress'), 'error_copy_not_all_tables' => __('Notice: Not all selected tables could be copied!', 'tablepress'), 'success_import' => __('The tables were imported successfully.', 'tablepress'), 'success_import_wp_table_reloaded' => __('The tables were imported successfully from WP-Table Reloaded.', 'tablepress')));
     $this->add_text_box('head', array($this, 'textbox_head'), 'normal');
     $this->add_text_box('tables-list', array($this, 'textbox_tables_list'), 'normal');
     add_screen_option('per_page', array('label' => __('Tables', 'tablepress'), 'default' => 20));
     // Admin_Controller contains function to allow changes to this in the Screen Options to be saved
     $this->wp_list_table = new TablePress_All_Tables_List_Table();
     $this->wp_list_table->set_items($this->data['tables']);
     $this->wp_list_table->prepare_items();
     // cleanup Request URI string, which WP_List_Table uses to generate the sort URLs
     $_SERVER['REQUEST_URI'] = remove_query_arg(array('message', 'table_id'), $_SERVER['REQUEST_URI']);
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:42,代码来源:view-list.php

示例6: _n

 public static function _n($single, $plural, $number, $domain = null)
 {
     if (!$domain) {
         $domain = Core::ID;
     }
     return \_n($single, $plural, $number, $domain);
 }
开发者ID:kmvan,项目名称:poil10n,代码行数:7,代码来源:L10n.php

示例7: __construct

 /**
  * The constuctor
  *
  * @since 2.4.0
  */
 public function __construct()
 {
     // Allowed cover image types & upload size
     $allowed_types = bp_attachments_get_allowed_types('cover_image');
     $max_upload_file_size = bp_attachments_get_max_upload_file_size('cover_image');
     parent::__construct(array('action' => 'bp_cover_image_upload', 'file_input' => 'file', 'original_max_filesize' => $max_upload_file_size, 'base_dir' => bp_attachments_uploads_dir_get('dir'), 'required_wp_files' => array('file', 'image'), 'upload_error_strings' => array(11 => sprintf(__('That image is too big. Please upload one smaller than %s', 'buddypress'), size_format($max_upload_file_size)), 12 => sprintf(_n('Please upload only this file type: %s.', 'Please upload only these file types: %s.', count($allowed_types), 'buddypress'), self::get_cover_image_types($allowed_types)))));
 }
开发者ID:mawilliamson,项目名称:wordpress,代码行数:12,代码来源:class-bp-attachment-cover-image.php

示例8: showForm

 function showForm($target, $ID)
 {
     $this->getFromDB($ID);
     $delay_expired = $this->fields["delay_expired"];
     $delay_whichexpire = $this->fields["delay_whichexpire"];
     echo "<div align='center'>";
     echo "<form method='post' action=\"{$target}\">";
     echo "<table class='tab_cadre_fixe' cellpadding='5'><tr><th>";
     echo __('Time of checking of validity of domains', 'domains') . "</th></tr>";
     echo "<tr class='tab_bg_1'><td><div align='center'>";
     $delay_stamp_first = mktime(0, 0, 0, date("m"), date("d") - $delay_expired, date("y"));
     $delay_stamp_next = mktime(0, 0, 0, date("m"), date("d") + $delay_whichexpire, date("y"));
     $date_first = date("Y-m-d", $delay_stamp_first);
     $date_next = date("Y-m-d", $delay_stamp_next);
     echo "<tr class='tab_bg_1'><td><div align='left'>";
     _e('Domains expired since more', 'domains');
     echo "&nbsp;<input type='text' size='5' name='delay_expired' value=\"{$delay_expired}\">";
     echo "&nbsp;" . _n('Day', 'Days', 2);
     echo "&nbsp;( >" . Html::convdate($date_first) . ")<br>";
     _e('Domains expiring in less than', 'domains');
     echo "&nbsp;<input type='text' size='5' name='delay_whichexpire' value=\"{$delay_whichexpire}\">";
     echo "&nbsp;" . _n('Day', 'Days', 2);
     echo "&nbsp;( <" . Html::convdate($date_next) . ")";
     echo "</td>";
     echo "</tr>";
     echo "<tr><th>";
     echo "<input type='hidden' name='id' value='" . $ID . "'>";
     echo "<div align='center'>";
     echo "<input type='submit' name='update' value=\"" . __s('Post') . "\" class='submit' >";
     echo "</div></th></tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:34,代码来源:config.class.php

示例9: customize_registering

 function customize_registering($wp_customize)
 {
     global $xili_language;
     // in_nav_menu
     $locations = get_registered_nav_menus();
     $menus = wp_get_nav_menus();
     $menu_locations = get_nav_menu_locations();
     $num_locations = count(array_keys($locations));
     if ($num_locations >= 1 && count($menu_locations) >= 1) {
         $wp_customize->add_section('xili_options_section', array('title' => __('Multilingual Options ©xili', 'xili-language'), 'priority' => 300, 'description' => sprintf(_n('Your theme supports %s menu. Customize style.', 'Your theme supports %s menus. Customize style.', $num_locations, 'xili-language'), number_format_i18n($num_locations)) . "\n\n" . __('You can edit your menu content on the Menus screen in the Appearance section.')));
         $location_slugs = array_keys($locations);
         if (0 == $xili_language->has_languages_list_menu($location_slugs[0])) {
             // only test one menu during transition
             $wp_customize->add_setting('xili_language_settings[in_nav_menu]', array('default' => '', 'transport' => 'refresh', 'type' => 'option', 'capability' => $this->capability));
             $wp_customize->add_control('in_nav_menu', array('settings' => 'xili_language_settings[in_nav_menu]', 'label' => __('Append the languages', 'xili-language'), 'section' => 'xili_options_section', 'type' => 'radio', 'choices' => array('disable' => __('No languages menu-items', 'xili-language'), 'enable' => __('Show languages menu-items', 'xili-language'))));
             $wp_customize->add_setting('xili_language_settings[nav_menu_separator]', array('default' => '|', 'transport' => 'refresh', 'type' => 'option', 'capability' => $this->capability));
             $wp_customize->add_control('nav_menu_separator', array('settings' => 'xili_language_settings[nav_menu_separator]', 'label' => __('Separator before language list (Character or Entity Number or Entity Name)', 'xili-language'), 'section' => 'xili_options_section', 'type' => 'text'));
         }
         if (!current_theme_supports('custom_xili_flag')) {
             $wp_customize->add_setting($this->settings_name . '[no_flags]', array('default' => '', 'transport' => 'refresh', 'type' => 'option', 'capability' => $this->capability));
             $wp_customize->add_control('no_flags', array('settings' => $this->settings_name . '[no_flags]', 'label' => __('Hide the flags', 'xili-language'), 'section' => 'xili_options_section', 'type' => 'checkbox'));
         }
     } else {
         $wp_customize->add_section('xili_options_section', array('title' => __('Multilingual Options ©xili', 'xili-language'), 'priority' => 300, 'description' => __('None nav menus location seems active', 'xili-language')));
     }
     $wp_customize->add_setting($this->settings_name . '[linked_posts]', array('default' => '', 'transport' => 'refresh', 'type' => 'option', 'capability' => $this->capability));
     $wp_customize->add_control('linked_posts', array('settings' => $this->settings_name . '[linked_posts]', 'label' => __('Show linked posts', 'xili-language'), 'section' => 'xili_options_section', 'type' => 'checkbox'));
 }
开发者ID:ergov2015,项目名称:rideflag.dev,代码行数:28,代码来源:theme-multilingual-classes.php

示例10: widget

 public function widget($args, $instance)
 {
     $title = apply_filters('widget_title', @$instance['title']);
     echo $args['before_widget'];
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     $ans_count = ap_question_get_the_answer_count();
     $last_active = ap_question_get_the_active_ago();
     $total_subs = ap_question_get_the_subscriber_count();
     $view_count = ap_question_get_the_view_count();
     echo '<div class="ap-widget-inner">';
     if (is_question()) {
         echo '<ul class="ap-stats-widget">';
         echo '<li><span class="stat-label apicon-pulse">' . __('Active', 'ap') . '</span><span class="stat-value"><time class="published updated" itemprop="dateModified" datetime="' . mysql2date('c', $last_active) . '">' . ap_human_time(mysql2date('U', $last_active)) . '</time></span></li>';
         echo '<li><span class="stat-label apicon-eye">' . __('Views', 'ap') . '</span><span class="stat-value">' . sprintf(_n('One time', '%d times', $view_count, 'ap'), $view_count) . '</span></li>';
         echo '<li><span class="stat-label apicon-answer">' . __('Answers', 'ap') . '</span><span class="stat-value">' . sprintf(_n('%2$s1%3$s answer', '%2$s%1$d%3$s answers', $ans_count, 'ap'), $ans_count, '<span data-view="answer_count">', '</span>') . '</span></li>';
         echo '<li><span class="stat-label apicon-mail">' . __('Followers', 'ap') . '</span><span class="stat-value">' . sprintf(_n('1 follower', '%d followers', $total_subs, 'ap'), $total_subs) . '</span></li>';
         echo '</ul>';
     } else {
         _e('This widget can only be used in single question page', 'ap');
     }
     echo '</div>';
     echo $args['after_widget'];
 }
开发者ID:Byrlyne,项目名称:anspress,代码行数:25,代码来源:question_stats.php

示例11: getSearchOptions

 function getSearchOptions()
 {
     $tab = array();
     $tab['common'] = _n('Characteristic', 'Characteristics', 2);
     $tab[1]['table'] = $this->getTable();
     $tab[1]['field'] = 'id';
     $tab[1]['name'] = __('ID');
     $tab[1]['massiveaction'] = false;
     $tab[2]['table'] = "glpi_plugin_monitoring_services";
     $tab[2]['field'] = 'name';
     $tab[2]['linkfield'] = 'plugin_monitoring_services_id';
     $tab[2]['name'] = __('Ressource', 'monitoring');
     $tab[2]['datatype'] = 'itemlink';
     $tab[2]['itemlink_type'] = 'PluginMonitoringService';
     $tab[3]['table'] = $this->getTable();
     $tab[3]['field'] = 'begin_date';
     $tab[3]['name'] = __('Start', 'monitoring');
     $tab[3]['datatype'] = 'datetime';
     $tab[3]['massiveaction'] = false;
     $tab[4]['table'] = $this->getTable();
     $tab[4]['field'] = 'end_date';
     $tab[4]['name'] = __('End', 'monitoring');
     $tab[4]['datatype'] = 'datetime';
     $tab[4]['massiveaction'] = false;
     $tab[5]['table'] = $this->getTable();
     $tab[5]['field'] = 'duration';
     $tab[5]['name'] = __('Duration', 'monitoring');
     $tab[5]['datatype'] = 'timestamp';
     $tab[5]['withseconds'] = true;
     $tab[5]['massiveaction'] = false;
     return $tab;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:32,代码来源:unavaibility.class.php

示例12: p2_get_discussion_links

function p2_get_discussion_links()
{
    $comments = get_comments(array('post_id' => get_the_ID()));
    $unique_commentors = array();
    foreach ($comments as $comment) {
        if ('1' == $comment->comment_approved) {
            $unique_commentors[$comment->comment_author_email] = get_avatar($comment, 16) . ' ' . get_comment_author_link($comment->comment_ID);
        }
    }
    $unique_commentors = array_values($unique_commentors);
    $total_unique_commentors = count($unique_commentors);
    $content = '';
    if (1 == $total_unique_commentors) {
        $content = sprintf(__('%1$s is discussing.', 'p2'), $unique_commentors[0]);
    } else {
        if (2 == $total_unique_commentors) {
            $content = sprintf(__('%1$s and %2$s are discussing.', 'p2'), $unique_commentors[0], $unique_commentors[1]);
        } else {
            if (3 == $total_unique_commentors) {
                $content = sprintf(__('%1$s, %2$s, and %3$s are discussing.', 'p2'), $unique_commentors[0], $unique_commentors[1], $unique_commentors[2]);
            } else {
                if (3 < $total_unique_commentors) {
                    $others = $total_unique_commentors - 3;
                    $content .= sprintf(_n('%1$s, %2$s, %3$s, and %4$d other are discussing.', '%1$s, %2$s, %3$s, and %4$d others are discussing.', $others, 'p2'), $unique_commentors[0], $unique_commentors[1], $unique_commentors[2], $others);
                }
            }
        }
    }
    return $content;
}
开发者ID:cabelotaina,项目名称:redelivre,代码行数:30,代码来源:template-tags.php

示例13: import_content

 /**
  * @since 1.0.0
  * @return string
  */
 protected function import_content()
 {
     $api_key = sanitize_text_field($_POST['mailchimp_api_key']);
     $list_id = sanitize_text_field($_POST[$this->import_list_name]);
     $signup_list_index = absint($_POST['signup_list_index']);
     $signup_lists = Prompt_Subscribing::get_signup_lists();
     $import = new Prompt_Admin_MailChimp_Import($api_key, $list_id, $signup_lists[$signup_list_index]);
     $import->execute();
     $content = html('h3', __('Here\'s how it went', 'Postmatic'));
     $content .= $import->get_error() ? $import->get_error()->get_error_message() : '';
     $results_format = _n('Imported one subscriber.', 'Imported %1$s subscribers.', $import->get_imported_count(), 'Postmatic');
     if ($import->get_already_subscribed_count() > 0) {
         $results_format .= ' ' . _n('The one valid user we found was already subscribed.', 'The %2$s valid users we found were already subscribed.', $import->get_already_subscribed_count(), 'Postmatic');
     }
     $rejects = $import->get_rejected_subscribers();
     $reject_content = '';
     $reject_button = '';
     if ($rejects) {
         $results_format .= '<br />' . _n('One user didn\'t qualify for importing.', 'There were %3$s users which didn\'t qualify for importing.', count($rejects));
         $reject_content = html('div id="mailpoet-import-intro"', html('div', html('h4', __('Why weren\'t more of my users imported?', 'Postmatic')), html('p', __('We have a very strict policy regarding user imports: <em>we will never allow anyone to be subscribed to a blog running Postmatic without them having opted in</em> (such as subscriber lists bought and imported in bulk for spamming). Because of this we will not import any MailChimp subscribers unless the following two conditions are true:', 'Postmatic')), html('ol', html('li', __('The user has double opted-in to your MailChimp list', 'Postmatic')), html('li', __('The user exists on a list which is at least 14 days old', 'Postmatic'))), html('h5', __('Why so strict?', 'Postmatic')), html('p', __('Bulk importing unwilling users is easy in MailChimp. If we did not hold our import to a higher standard those unwilling users could be imported into Postmatic. And then they would spam your users. MailChimp is a one-way street. Postmatic is a conversation. That\'s a very important difference.', 'Postmatic')), html('h4', __('But we do have good news', 'Postmatic')), html('p', __('You can send an email to your remaining users. They will be invited to join your site by simply replying.', 'Postmatic'))));
         $rejected_addresses = array();
         foreach ($rejects as $reject) {
             $name = trim($reject['email']);
             //$name = trim( $reject['firstname'] . ' ' . $reject['lastname'] );
             $rejected_addresses[] = Prompt_Email_Batch::name_address($reject['email'], $name);
         }
         $reject_button = html('input', array('name' => $this->rejected_addresses_name, 'class' => 'button', 'data-addresses' => implode(",", $rejected_addresses), 'type' => 'submit', 'value' => __('Preview and send the invitations', 'Postmatic')));
     }
     $content = html('p', $content, sprintf($results_format, $import->get_imported_count(), $import->get_already_subscribed_count(), count($rejects)), $reject_content, $reject_button);
     return $content;
 }
开发者ID:postmatic,项目名称:beta-dist,代码行数:35,代码来源:mailchimp-import-options-tab.php

示例14: ajax_response

 function ajax_response()
 {
     check_ajax_referer('ajax-custom-list-nonce', '_ajax_custom_list_nonce');
     $this->prepare_items();
     extract($this->_args);
     extract($this->_pagination_args, EXTR_SKIP);
     ob_start();
     if (!empty($_REQUEST['no_placeholder'])) {
         $this->display_rows();
     } else {
         $this->display_rows_or_placeholder();
     }
     $rows = ob_get_clean();
     ob_start();
     $this->print_column_headers();
     $headers = ob_get_clean();
     ob_start();
     $this->pagination('top');
     $pagination_top = ob_get_clean();
     ob_start();
     $this->pagination('bottom');
     $pagination_bottom = ob_get_clean();
     $response = array('rows' => $rows);
     $response['pagination']['top'] = $pagination_top;
     $response['pagination']['bottom'] = $pagination_bottom;
     $response['column_headers'] = $headers;
     if (isset($total_items)) {
         $response['total_items_i18n'] = sprintf(_n('1 item', '%s items', $total_items), number_format_i18n($total_items));
     }
     if (isset($total_pages)) {
         $response['total_pages'] = $total_pages;
         $response['total_pages_i18n'] = number_format_i18n($total_pages);
     }
     die(wp_json_encode($response));
 }
开发者ID:patat,项目名称:backlink-inspector,代码行数:35,代码来源:class-bli-links-list-table.php

示例15: seventeen_right_now_content_table_end

/**
 * Add Custom Post Types and Taxonomies to "At a Glance" Dashboard Widget
 *
 * Ref Link: http://wpsnipp.com/index.php/functions-php/include-custom-post-types-in-right-now-admin-dashboard-widget/
 * http://wordpress.org/support/topic/dashboard-at-a-glance-custom-post-types
 * http://halfelf.org/2012/my-custom-posttypes-live-in-mu/
 */
function seventeen_right_now_content_table_end()
{
    $args = array('public' => true, '_builtin' => false);
    $output = 'object';
    $operator = 'and';
    $post_types = get_post_types($args, $output, $operator);
    foreach ($post_types as $post_type) {
        $num_posts = wp_count_posts($post_type->name);
        $num = number_format_i18n($num_posts->publish);
        $text = _n($post_type->labels->name, $post_type->labels->name, intval($num_posts->publish));
        if (current_user_can('edit_posts')) {
            $cpt_name = $post_type->name;
        }
        echo '<li class="post-count ' . $post_type->name . '-count"><tr><a href="edit.php?post_type=' . $cpt_name . '"><td class="first b b-' . $post_type->name . '"></td>' . $num . '&nbsp;<td class="t ' . $post_type->name . '">' . $text . '</td></a></tr></li>';
    }
    $taxonomies = get_taxonomies($args, $output, $operator);
    foreach ($taxonomies as $taxonomy) {
        $num_terms = wp_count_terms($taxonomy->name);
        $num = number_format_i18n($num_terms);
        $text = _n($taxonomy->labels->name, $taxonomy->labels->name, intval($num_terms));
        if (current_user_can('manage_categories')) {
            $cpt_tax = $taxonomy->name;
        }
        echo '<li class="taxonomy-count ' . $taxonomy->name . '-count"><tr><a href="edit-tags.php?taxonomy=' . $cpt_tax . '"><td class="first b b-' . $taxonomy->name . '"></td>' . $num . '&nbsp;<td class="t ' . $taxonomy->name . '">' . $text . '</td></a></tr></li>';
    }
}
开发者ID:psflannery,项目名称:seventeen,代码行数:33,代码来源:admin.php


注:本文中的_n函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。