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


PHP bbp_topic_reply_count函数代码示例

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


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

示例1: test_bbp_get_topic_reply_count

 /**
  * @covers ::bbp_topic_reply_count
  * @covers ::bbp_get_topic_reply_count
  */
 public function test_bbp_get_topic_reply_count()
 {
     $f = $this->factory->forum->create();
     $t = $this->factory->topic->create(array('post_parent' => $f, 'topic_meta' => array('forum_id' => $f)));
     $int_value = 3;
     $formatted_value = bbp_number_format($int_value);
     $this->factory->reply->create_many($int_value, array('post_parent' => $t, 'reply_meta' => array('forum_id' => $f, 'topic_id' => $t)));
     bbp_update_topic_reply_count($t);
     // Output
     $this->expectOutputString($formatted_value);
     bbp_topic_reply_count($t);
     // Formatted string
     $count = bbp_get_topic_reply_count($t, false);
     $this->assertSame($formatted_value, $count);
     // Integer
     $count = bbp_get_topic_reply_count($t, true);
     $this->assertSame($int_value, $count);
 }
开发者ID:joeyblake,项目名称:bbpress,代码行数:22,代码来源:counts.php

示例2: do_action

do_action('bbp_theme_after_topic_meta');
?>

		<?php 
bbp_topic_row_actions();
?>

	</li>

	<li class="bbp-topic-voice-count"><?php 
bbp_topic_voice_count();
?>
</li>

	<li class="bbp-topic-reply-count"><?php 
bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count();
?>
</li>

	<li class="bbp-topic-freshness">

		<?php 
do_action('bbp_theme_before_topic_freshness_link');
?>

		<?php 
bbp_topic_freshness_link();
?>

		<?php 
do_action('bbp_theme_after_topic_freshness_link');
开发者ID:berniecultess,项目名称:infirev,代码行数:31,代码来源:loop-single-topic.php

示例3: bbpkr_topic_views

<strong><?php 
bbpkr_topic_views();
?>
</strong></span>
				<span class="favs"><?php 
_e('Favorites:', 'bbpresskr');
?>
<strong><?php 
echo bbPressKR\Topic::favorites_counts();
?>
</strong></span>
				<span class="replies"><?php 
_e('Replies:', 'bbpresskr');
?>
<strong><?php 
bbp_topic_reply_count();
?>
</strong></span>
			</div>
		</li>
		<?php 
if ($bbpkr_extras = bbpkr_meta_fields(bbp_get_forum_id(), array('single' => 'top'))) {
    ?>
		<li class="topic-info-extra clearfix">
			<ul class="topic-extra">
			<?php 
    foreach ($bbpkr_extras as $extra) {
        ?>
			<?php 
        $extra_val = get_post_meta(bbp_get_topic_id(), 'bbpmeta_' . $extra['key'], true);
        ?>
开发者ID:082net,项目名称:bbpresskr,代码行数:31,代码来源:topic-info.php

示例4: column_data

 /**
  * Print extra columns for the topics page
  *
  * @since 2.0.0 bbPress (r2485)
  *
  * @param string $column Column
  * @param int $topic_id Topic id
  * @uses bbp_get_topic_forum_id() To get the forum id of the topic
  * @uses bbp_forum_title() To output the topic's forum title
  * @uses apply_filters() Calls 'topic_forum_row_actions' with an array
  *                        of topic forum actions
  * @uses bbp_get_forum_permalink() To get the forum permalink
  * @uses admin_url() To get the admin url of post.php
  * @uses bbp_topic_reply_count() To output the topic reply count
  * @uses bbp_topic_voice_count() To output the topic voice count
  * @uses bbp_topic_author_display_name() To output the topic author name
  * @uses get_the_date() Get the topic creation date
  * @uses get_the_time() Get the topic creation time
  * @uses esc_attr() To sanitize the topic creation time
  * @uses bbp_get_topic_last_active_time() To get the time when the topic was
  *                                    last active
  * @uses do_action() Calls 'bbp_admin_topics_column_data' with the
  *                    column and topic id
  */
 public function column_data($column, $topic_id)
 {
     if ($this->bail()) {
         return;
     }
     // Get topic forum ID
     $forum_id = bbp_get_topic_forum_id($topic_id);
     // Populate column data
     switch ($column) {
         // Forum
         case 'bbp_topic_forum':
             // Output forum name
             if (!empty($forum_id)) {
                 // Forum Title
                 $forum_title = bbp_get_forum_title($forum_id);
                 if (empty($forum_title)) {
                     $forum_title = esc_html__('No Forum', 'bbpress');
                 }
                 // Output the title
                 echo $forum_title;
             } else {
                 esc_html_e('&mdash; No forum &mdash;', 'bbpress');
             }
             break;
             // Reply Count
         // Reply Count
         case 'bbp_topic_reply_count':
             bbp_topic_reply_count($topic_id);
             break;
             // Reply Count
         // Reply Count
         case 'bbp_topic_voice_count':
             bbp_topic_voice_count($topic_id);
             break;
             // Author
         // Author
         case 'bbp_topic_author':
             bbp_topic_author_display_name($topic_id);
             break;
             // Freshness
         // Freshness
         case 'bbp_topic_created':
             printf('%1$s <br /> %2$s', get_the_date(), esc_attr(get_the_time()));
             break;
             // Freshness
         // Freshness
         case 'bbp_topic_freshness':
             $last_active = bbp_get_topic_last_active_time($topic_id, false);
             if (!empty($last_active)) {
                 echo esc_html($last_active);
             } else {
                 esc_html_e('No Replies', 'bbpress');
                 // This should never happen
             }
             break;
             // Do an action for anything else
         // Do an action for anything else
         default:
             do_action('bbp_admin_topics_column_data', $column, $topic_id);
             break;
     }
 }
开发者ID:joeyblake,项目名称:bbpress,代码行数:86,代码来源:topics.php

示例5: single_row

    public function single_row($level = 0)
    {
        global $mode, $post;
        static $alternate;
        $edit_link = '#';
        get_edit_post_link($post->ID);
        $title = get_the_title();
        $post_type_object = get_post_type_object($post->post_type);
        $can_edit_post = false;
        // current_user_can( 'edit_post', $post->ID );
        $alternate = 'alternate' == $alternate ? '' : 'alternate';
        $classes = array($alternate, 'level-0');
        ?>
		<tr id="topic-row-<?php 
        echo $post->ID;
        ?>
" <?php 
        bbp_topic_class($post->ID, $classes);
        ?>
>
	<?php 
        $forum_id = bbp_get_topic_forum_id($post->ID);
        $topic_id = $post->ID;
        list($columns, $hidden) = $this->get_column_info();
        foreach ($columns as $column_name => $column_display_name) {
            $class = "class=\"column-{$column_name}\"";
            $style = '';
            if (in_array($column_name, $hidden)) {
                $style = ' style="display:none;"';
            }
            $attributes = "{$class}{$style}";
            switch ($column_name) {
                case 'no':
                    ?>
			<td <?php 
                    echo $attributes;
                    ?>
>
			<?php 
                    bbp_the_no();
                    ?>
			</td>
			<?php 
                    break;
                case 'title':
                    $pad = str_repeat('&#8212; ', $level);
                    $title = '<a class="bbp-topic-permalink row-title" href="' . bbp_get_topic_permalink() . '">' . $title . '</a>';
                    echo "<td {$attributes}>";
                    do_action('bbp_theme_before_topic_title');
                    echo $pad . $title;
                    do_action('bbp_theme_after_topic_title');
                    echo '</td>';
                    break;
                    // Forum
                // Forum
                case 'forum':
                    // Output forum name
                    if (!empty($forum_id)) {
                        // Forum Title
                        $forum_title = bbp_get_forum_title($forum_id);
                        if (empty($forum_title)) {
                            $forum_title = esc_html__('No Forum', 'bbpress');
                        }
                        // Output the title
                        echo $forum_title;
                    } else {
                        esc_html_e('(No Forum)', 'bbpress');
                    }
                    break;
                    // Reply Count
                // Reply Count
                case 'reply_count':
                    echo "<td {$attributes}>";
                    echo '<div class="post-com-count-wrapper"><a class="post-com-count" href="#"><span class="comment-count">';
                    bbp_topic_reply_count($topic_id);
                    echo '</span></a></div>';
                    echo "</td>";
                    break;
                    // Reply Count
                // Reply Count
                case 'voice_count':
                    echo "<td {$attributes}>";
                    bbp_topic_voice_count($topic_id);
                    break;
                    // Author
                // Author
                case 'author':
                    echo "<td {$attributes}>";
                    bbp_topic_author_display_name($topic_id);
                    echo "</td>";
                    break;
                    // Freshness
                // Freshness
                case 'date':
                    echo "<td {$attributes}>";
                    echo get_the_date('Y.m.d');
                    echo "</td>";
                    break;
                    // Freshness
                // Freshness
//.........这里部分代码省略.........
开发者ID:082net,项目名称:bbpresskr,代码行数:101,代码来源:list-table.php


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