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


PHP bbp_has_replies函数代码示例

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


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

示例1: pg_get_user_replies_created

function pg_get_user_replies_created($user_id = 0)
{
    // Validate user
    $user_id2 = bbp_get_user_id($user_id);
    $current_user = wp_get_current_user()->ID;
    if (empty($user_id)) {
        return false;
    }
    if (bbp_is_user_keymaster()) {
        $limit = 'n';
    }
    if (user_can($current_user, 'moderate')) {
        $check = get_user_meta($current_user, 'private_group', true);
        if ($check == '') {
            $limit = 'n';
        }
    }
    if ($limit != 'n') {
        global $wpdb;
        $reply = bbp_get_reply_post_type();
        $post_ids = $wpdb->get_col("select ID from {$wpdb->posts} where post_type = '{$reply}'");
        //check this list against those the user is allowed to see, and create a list of valid ones for the wp_query in bbp_has_topics
        $allowed_posts = check_private_groups_reply_ids($post_ids);
    }
    // The default reply query with allowed topic and reply ids array added
    // Try to get the topics
    $query = bbp_has_replies(array('post_type' => bbp_get_reply_post_type(), 'order' => 'DESC', 'author' => $user_id2, 'post__in' => $allowed_posts));
    return apply_filters('pg_get_user_replies_created', $query, $user_id);
}
开发者ID:USSLomaPrieta,项目名称:usslomaprieta.org,代码行数:29,代码来源:replies.php

示例2: getReplyList

 public function getReplyList($topicId = -1)
 {
     $topicId = $topicId == -1 ? $_POST['param']['topicId'] : $topicId;
     $loadFrom = empty($_POST['param']['from']) ? 0 : $_POST['param']['from'];
     $loadTo = empty($_POST['param']['to']) ? 0 : $_POST['param']['to'];
     $return = array();
     $param = array('post_parent' => $topicId, 'post_type' => 'reply');
     if (!bbp_has_replies($param)) {
         $this->_die();
     }
     while (bbp_replies()) {
         bbp_the_reply();
         $reply = new ForumBbpAjaxIntegratorPost(bbp_get_reply_id(), 'reply');
         $return[] = $reply->getPostData();
     }
     return $return;
 }
开发者ID:Bnei-Baruch,项目名称:Forum-bbpres-,代码行数:17,代码来源:forum-bbpAjaxIntegrator.php

示例3: bbp_get_template_part

    ?>

		<?php 
    if (bbp_show_lead_topic()) {
        ?>

			<?php 
        bbp_get_template_part('content', 'single-topic-lead');
        ?>

		<?php 
    }
    ?>

		<?php 
    if (bbp_has_replies()) {
        ?>

			<?php 
        bbp_get_template_part('pagination', 'replies');
        ?>

			<?php 
        bbp_get_template_part('loop', 'replies');
        ?>

			<?php 
        bbp_get_template_part('pagination', 'replies');
        ?>

		<?php 
开发者ID:nikitansk,项目名称:devschool,代码行数:31,代码来源:content-single-topic.php

示例4: bbp_get_user_replies_created

/**
 * Get the replies that a user created
 *
 * @since bbPress (r4225)
 *
 * @param int $user_id Optional. User id
 * @uses bbp_get_user_id() To get the topic id
 * @uses bbp_has_replies() To get the topics created by the user
 * @return array|bool Results if the user has created topics, otherwise false
 */
function bbp_get_user_replies_created($user_id = 0)
{
    // Validate user
    $user_id = bbp_get_user_id($user_id);
    if (empty($user_id)) {
        return false;
    }
    // Try to get the topics
    $query = bbp_has_replies(array('post_type' => array(bbp_get_topic_post_type(), bbp_get_reply_post_type()), 'post_parent' => 'any', 'posts_per_page' => bbp_get_replies_per_page(), 'paged' => bbp_get_paged(), 'orderby' => 'date', 'order' => 'DESC', 'author' => $user_id, 'show_stickies' => false));
    return apply_filters('bbp_get_user_replies_created', $query, $user_id);
}
开发者ID:hscale,项目名称:webento,代码行数:21,代码来源:functions.php

示例5: bbp_display_replies_feed_rss2


//.........这里部分代码省略.........
</dc:creator>

						<description>
							<![CDATA[
							<p><?php 
                printf(__('Replies: %s', 'bbpress'), bbp_get_topic_reply_count());
                ?>
</p>
							<?php 
                bbp_topic_content();
                ?>
							]]>
						</description>

						<?php 
                rss_enclosure();
                ?>

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

					</item>

				<?php 
            }
            ?>
			<?php 
        }
        ?>
		<?php 
    }
    ?>

		<?php 
    if (bbp_has_replies($replies_query)) {
        ?>
			<?php 
        while (bbp_replies()) {
            bbp_the_reply();
            ?>

				<item>
					<guid><?php 
            bbp_reply_url();
            ?>
</guid>
					<title><![CDATA[<?php 
            bbp_reply_title();
            ?>
]]></title>
					<link><?php 
            bbp_reply_url();
            ?>
</link>
					<pubDate><?php 
            echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false);
            ?>
</pubDate>
					<dc:creator><?php 
            the_author();
            ?>
</dc:creator>

					<description>
						<![CDATA[
						<?php 
            bbp_reply_content();
            ?>
						]]>
					</description>

					<?php 
            rss_enclosure();
            ?>

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

				</item>

			<?php 
        }
        ?>
		<?php 
    }
    ?>

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

	</channel>
	</rss>

<?php 
    // We're done here
    exit;
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:101,代码来源:functions.php

示例6: bbp_get_template_part

    ?>

		<?php 
    if (bbp_show_lead_topic()) {
        ?>

			<?php 
        bbp_get_template_part('bbpress/content', 'single-topic-lead');
        ?>

		<?php 
    }
    ?>

		<?php 
    if (bbp_get_query_name() || bbp_has_replies()) {
        ?>

			<?php 
        bbp_get_template_part('bbpress/pagination', 'replies');
        ?>

			<?php 
        bbp_get_template_part('bbpress/loop', 'replies');
        ?>

			<?php 
        bbp_get_template_part('bbpress/pagination', 'replies');
        ?>

		<?php 
开发者ID:besimhu,项目名称:legacy,代码行数:31,代码来源:content-single-topic.php

示例7: bbp_get_user_replies_created

/**
 * Get the replies that a user created
 *
 * @since bbPress (r4225)
 *
 * @param int $user_id Optional. User id
 * @uses bbp_get_user_id() To get the topic id
 * @uses bbp_has_replies() To get the topics created by the user
 * @return array|bool Results if the user has created topics, otherwise false
 */
function bbp_get_user_replies_created($user_id = 0)
{
    // Validate user
    $user_id = bbp_get_user_id($user_id);
    if (empty($user_id)) {
        return false;
    }
    // Try to get the topics
    $query = bbp_has_replies(array('post_type' => bbp_get_reply_post_type(), 'order' => 'DESC', 'author' => $user_id));
    return apply_filters('bbp_get_user_replies_created', $query, $user_id);
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:21,代码来源:functions.php

示例8: display_forums


//.........这里部分代码省略.........
                        bbp_forum_title();
                        ?>
</h3>
						<?php 
                        bbp_get_template_part('feedback', 'no-topics');
                        return;
                    }
                    // Setup the topic
                    bbp_the_topic();
                    ?>

					<h3><?php 
                    bbp_topic_title();
                    ?>
</h3>

					<?php 
                    // Topic edit
                    if (bp_action_variable($offset + 2) === bbp_get_edit_rewrite_id()) {
                        // Unset the super sticky link on edit topic template
                        add_filter('bbp_get_topic_types', array($this, 'unset_super_sticky'), 10, 1);
                        // Set the edit switches
                        $wp_query->bbp_is_edit = true;
                        $wp_query->bbp_is_topic_edit = true;
                        // Setup the global forum ID
                        $bbp->current_topic_id = get_the_ID();
                        // Merge
                        if (!empty($_GET['action']) && 'merge' === $_GET['action']) {
                            bbp_set_query_name('bbp_topic_merge');
                            bbp_get_template_part('form', 'topic-merge');
                            // Split
                        } elseif (!empty($_GET['action']) && 'split' === $_GET['action']) {
                            bbp_set_query_name('bbp_topic_split');
                            bbp_get_template_part('form', 'topic-split');
                            // Edit
                        } else {
                            bbp_set_query_name('bbp_topic_form');
                            bbp_get_template_part('form', 'topic');
                        }
                        // Single Topic
                    } else {
                        bbp_set_query_name('bbp_single_topic');
                        bbp_get_template_part('content', 'single-topic');
                    }
                    break;
                    /** Single Reply **********************************************/
                /** Single Reply **********************************************/
                case $this->reply_slug:
                    // Get the reply
                    bbp_has_replies(array('name' => bp_action_variable($offset + 1), 'posts_per_page' => 1));
                    // If no topic, 404
                    if (!bbp_replies()) {
                        bp_do_404(bbp_get_forum_permalink($forum_id));
                        ?>
						<h3><?php 
                        bbp_forum_title();
                        ?>
</h3>
						<?php 
                        bbp_get_template_part('feedback', 'no-replies');
                        return;
                    }
                    // Setup the reply
                    bbp_the_reply();
                    ?>

					<h3><?php 
                    bbp_reply_title();
                    ?>
</h3>

					<?php 
                    if (bp_action_variable($offset + 2) === bbp_get_edit_rewrite_id()) {
                        // Set the edit switches
                        $wp_query->bbp_is_edit = true;
                        $wp_query->bbp_is_reply_edit = true;
                        // Setup the global reply ID
                        $bbp->current_reply_id = get_the_ID();
                        // Move
                        if (!empty($_GET['action']) && 'move' === $_GET['action']) {
                            bbp_set_query_name('bbp_reply_move');
                            bbp_get_template_part('form', 'reply-move');
                            // Edit
                        } else {
                            bbp_set_query_name('bbp_reply_form');
                            bbp_get_template_part('form', 'reply');
                        }
                    }
                    break;
            }
            // Reset the query
            wp_reset_query();
            ?>

		</div>

		<?php 
            // Allow actions immediately after group forum output
            do_action('bbp_after_group_forum_display');
        }
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:101,代码来源:groups.php

示例9: if

	<?php if ( post_password_required() ) : ?>

		<?php bbp_get_template_part( 'form', 'protected' ); ?>

	<?php else : ?>


		<?php bbp_single_topic_description(); ?>

		<?php if ( bbp_show_lead_topic() ) : ?>

			<?php bbp_get_template_part( 'content', 'single-topic-lead' ); ?>

		<?php endif; ?>

		<?php if ( bbp_has_replies() ) : ?>

			<?php bbp_topic_tag_list(); ?>

			<?php bbp_get_template_part( 'pagination', 'replies' ); ?>

			<?php bbp_get_template_part( 'loop',       'replies' ); ?>

			<?php bbp_get_template_part( 'pagination', 'replies' ); ?>

		<?php endif; ?>

		<?php bbp_get_template_part( 'form', 'reply' ); ?>

	<?php endif; ?>
开发者ID:niamherinoc,项目名称:rctractors,代码行数:30,代码来源:content-single-topic.php

示例10: bbp_get_template_part

?>

	<?php 
if (post_password_required()) {
    ?>

		<?php 
    bbp_get_template_part('form', 'protected');
    ?>

	<?php 
} else {
    ?>

		<?php 
    if (bbp_has_replies() && is_user_logged_in()) {
        ?>

			<?php 
        bbp_get_template_part('loop', 'replies');
        ?>

			<?php 
        bbp_get_template_part('pagination', 'replies');
        ?>

			<?php 
        bbp_get_template_part('form', 'reply');
        ?>

		<?php 
开发者ID:kanawanzx,项目名称:support_forum,代码行数:31,代码来源:content-single-topic.php


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