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


PHP bbp_forum_post_count函数代码示例

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


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

示例1: do_action

do_action('bbp_theme_after_forum_sub_forums');
?>

		<?php 
bbp_forum_row_actions();
?>

	</li>

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

	<li class="bbp-forum-reply-count"><?php 
bbp_show_lead_topic() ? bbp_forum_reply_count() : bbp_forum_post_count();
?>
</li>

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

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

		<?php 
bbp_forum_freshness_link();
?>

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

示例2: ipt_kb_bbp_list_subforums

    /**
     * List subforums or forums
     *
     * Must be called within a loop or be assigned an forum id
     *
     * @param mixed $args The function supports these args:
     *  - forum_id: Forum id. Defaults to ''
     * @uses bbp_forum_get_subforums() To check if the forum has subforums or not
     * @uses bbp_get_forum_permalink() To get forum permalink
     * @uses bbp_get_forum_title() To get forum title
     * @uses bbp_is_forum_category() To check if a forum is a category
     * @uses bbp_get_forum_topic_count() To get forum topic count
     * @uses bbp_get_forum_reply_count() To get forum reply count
     * @return void
     */
    function ipt_kb_bbp_list_subforums($args = array())
    {
        $r = bbp_parse_args($args, array('forum_id' => ''), 'ipt_kb_list_forums');
        $sub_forums = bbp_forum_get_subforums($r['forum_id']);
        if (!empty($sub_forums)) {
            foreach ($sub_forums as $sub_forum) {
                ?>
<li class="<?php 
                if (bbp_is_forum_category($sub_forum->ID)) {
                    echo 'bbp-forum-is-category';
                }
                ?>
 list-group-item  bbp-body ipt_kb_subforum_list">
<?php 
                do_action('bbp_theme_before_forum_sub_forums');
                ?>
	<ul id="bbp-forum-<?php 
                bbp_forum_id($sub_forum->ID);
                ?>
" <?php 
                bbp_forum_class($sub_forum->ID);
                ?>
>
		<li class="bbp-forum-info">
			<span class="pull-left ipt_kb_bbpress_subforum_icon ipt_kb_bbpress_forum_icon">
			<?php 
                if (bbp_is_forum_category($sub_forum->ID)) {
                    ?>
				<span class="glyphicon ipt-icomoon-folder-open"></span>
			<?php 
                } else {
                    ?>
				<span class="glyphicon ipt-icomoon-file4"></span>
			<?php 
                }
                ?>
			</span>
			<?php 
                ipt_kb_bbp_forum_title_in_list($sub_forum->ID);
                ?>
			<?php 
                ipt_kb_bbp_forum_description_in_list($sub_forum->ID);
                ?>
			<?php 
                bbp_forum_row_actions();
                ?>
		</li>

		<li class="bbp-forum-topic-count">
			<?php 
                bbp_forum_topic_count($sub_forum->ID);
                ?>
		</li>

		<li class="bbp-forum-reply-count">
			<?php 
                bbp_show_lead_topic() ? bbp_forum_reply_count($sub_forum->ID) : bbp_forum_post_count($sub_forum->ID);
                ?>
		</li>

		<li class="bbp-forum-freshness">
			<?php 
                ipt_kb_bbp_forum_freshness_in_list($sub_forum->ID);
                ?>
		</li>
	</ul>
	<?php 
                do_action('bbp_theme_after_forum_sub_forums');
                ?>
	<div class="clearfix"></div>
</li>
			<?php 
            }
        }
    }
开发者ID:kreapress,项目名称:ipt-knowledgebase-theme-wp,代码行数:90,代码来源:bbpress.php

示例3: test_bbp_get_forum_post_count

 /**
  * @covers ::bbp_forum_post_count
  * @covers ::bbp_get_forum_post_count
  */
 public function test_bbp_get_forum_post_count()
 {
     $c = $this->factory->forum->create(array('forum_meta' => array('forum_type' => 'category')));
     $f = $this->factory->forum->create(array('post_parent' => $c, 'forum_meta' => array('forum_id' => $c)));
     $t = $this->factory->topic->create(array('post_parent' => $f));
     $int_value = 3;
     // Topic + Replies.
     $result = 4;
     $formatted_result = bbp_number_format($result);
     $this->factory->reply->create_many($int_value, array('post_parent' => $t));
     bbp_update_forum_topic_count($c);
     bbp_update_forum_topic_count($f);
     bbp_update_forum_reply_count($c);
     bbp_update_forum_reply_count($f);
     // Forum output.
     $count = bbp_get_forum_post_count($f, true, false);
     $this->expectOutputString($formatted_result);
     bbp_forum_post_count($f);
     // Forum formatted string.
     $count = bbp_get_forum_post_count($f, true, false);
     $this->assertSame($formatted_result, $count);
     // Forum integer.
     $count = bbp_get_forum_post_count($f, true, true);
     $this->assertSame($result, $count);
     // Category post count.
     $count = bbp_get_forum_post_count($c, false, true);
     $this->assertSame(0, $count);
     // Category total post count.
     $count = bbp_get_forum_post_count($c, true, true);
     $this->assertSame($result, $count);
 }
开发者ID:CompositeUK,项目名称:clone.bbPress,代码行数:35,代码来源:counts.php

示例4: bbp_get_forum_last_reply_id

					// Get the most recent reply and its topic
			$reply_id		= bbp_get_forum_last_reply_id( $sub_id );
			$topic_id		= bbp_is_reply( $reply_id ) ? bbp_get_reply_topic_id( $reply_id ) : $reply_id;
			$topic_title	= bbp_get_topic_title( $topic_id );
			$link 			= bbp_get_reply_url( $reply_id );

					// Get the author 
			$user_id 		= bbp_get_reply_author_id( $reply_id );

					// Toggle html class?>

			<tr>
				<td><a class="bbp-forum-title" href="<?php echo $permalink; ?>"><?php echo $title; ?></a></td>
				<td><?php echo $topics; ?></td>
				<td><?php bbp_forum_post_count( $sub_id, true ); ?></td>
				<td><p class="bbp-topic-meta">

					<?php do_action( 'bbp_theme_before_topic_author' ); ?>
					<a class="freshest-title" href="<?php echo $link; ?>" title="<?php echo $topic_title; ?>"><?php echo $topic_title; ?></a>


					<span class="bbp-topic-freshness-author">By <?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>

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

				</p>

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

				<span class="freshest-time"><?php bbp_topic_last_active_time( $topic_id ); ?></span>
开发者ID:niamherinoc,项目名称:rctractors,代码行数:30,代码来源:loop-single-forum.php

示例5: g1_bbp_forums_shortcode

/**
 * [g1_bbp_forums] shortcode callback function.
 *
 * @param 			array $atts
 * @param			string $content
 * @return			string
 */
function g1_bbp_forums_shortcode($atts, $content)
{
    /* We need a static counter to trace a shortcode without the id attribute */
    static $counter = 0;
    $counter++;
    extract(shortcode_atts(array('id' => '', 'class' => ''), $atts, 'g1_bbp_forums'));
    // Compose final HTML id attribute
    $final_id = strlen($id) ? $id : 'g1-bbp-forums-' . $counter;
    // Compose final HTML class attribute
    $final_class = array('g1-bbp-forums');
    $final_class = array_merge($final_class, explode(' ', $class));
    // Note: private and hidden forums will be excluded via the
    // bbp_pre_get_posts_normalize_forum_visibility action and function.
    $query = new WP_Query(array('post_type' => bbp_get_forum_post_type(), 'post_parent' => $settings['parent_forum'], 'post_status' => bbp_get_public_status_id(), 'posts_per_page' => get_option('_bbp_forums_per_page', 50), 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'orderby' => 'menu_order title', 'order' => 'ASC'));
    if (!$query->have_posts()) {
        return '';
    }
    // Start output buffer
    ob_start();
    ?>
    <div class="<?php 
    echo implode(' ', array_map('sanitize_html_class', $final_class));
    ?>
">
        <div class="g1-collection g1-collection--grid g1-collection--one-third g1-collection--simple">
            <ul>
                <?php 
    while ($query->have_posts()) {
        $query->the_post();
        ?>
                <li class="g1-collection__item">
                    <article>
                        <?php 
        if (has_post_thumbnail()) {
            ?>
                            <figure class="entry-featured-media">

                                <a href="<?php 
            bbp_forum_permalink($query->post->ID);
            ?>
">
                                    <?php 
            the_post_thumbnail('g1_one_third');
            ?>
                                </a>
                            </figure>
                        <?php 
        } else {
            ?>
                            <?php 
            echo do_shortcode('[placeholder icon="camera" size="g1_one_third"]');
            ?>
                        <?php 
        }
        ?>
                        <div class="g1-nonmedia">
                            <div class="g1-inner">
                                <header class="entry-header">
                                    <h3 class="entry-title">
                                        <a href="<?php 
        bbp_forum_permalink($query->post->ID);
        ?>
"><?php 
        bbp_forum_title($query->post->ID);
        ?>
</a>
                                    </h3>
                                    <p class="entry-meta g1-meta">
                                        <span><?php 
        _e('Topics', 'bbpress');
        ?>
: <?php 
        bbp_forum_topic_count($query->post->ID);
        ?>
</span>
                                        <span><?php 
        bbp_show_lead_topic() ? _e('Replies', 'bbpress') : _e('Posts', 'bbpress');
        ?>
: <?php 
        bbp_show_lead_topic() ? bbp_forum_reply_count($query->post->ID) : bbp_forum_post_count($query->post->ID);
        ?>
</span>
                                    </p>
                                </header>
                                <div class="entry-summary">
                                    <?php 
        the_excerpt();
        ?>
                                </div>
                            </div>
                        </div>
                    </article>
                </li>
//.........这里部分代码省略.........
开发者ID:aragonc,项目名称:3clicks,代码行数:101,代码来源:shortcode-forums.php

示例6: test_bbp_get_forum_post_count

 /**
  * @covers ::bbp_forum_post_count
  * @covers ::bbp_get_forum_post_count
  */
 public function test_bbp_get_forum_post_count()
 {
     $f = $this->factory->forum->create();
     $t = $this->factory->topic->create(array('post_parent' => $f));
     $int_value = 3;
     // Topic + Replies
     $result = 4;
     $formatted_result = bbp_number_format($result);
     $this->factory->reply->create_many($int_value, array('post_parent' => $t));
     bbp_update_forum_topic_count($f);
     bbp_update_forum_reply_count($f);
     // Output
     $count = bbp_get_forum_post_count($f, true, false);
     $this->expectOutputString($formatted_result);
     bbp_forum_post_count($f);
     // Formatted string
     $count = bbp_get_forum_post_count($f, true, false);
     $this->assertSame($formatted_result, $count);
     // Integer
     $count = bbp_get_forum_post_count($f, true, true);
     $this->assertSame($result, $count);
 }
开发者ID:joeyblake,项目名称:bbpress,代码行数:26,代码来源:counts.php


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