• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bbp_get_reply_id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: kleo_bbp_add_role_class

function kleo_bbp_add_role_class($author_role, $r)
{
    $reply_id = bbp_get_reply_id($r['reply_id']);
    $role = strtolower(esc_attr(bbp_get_user_display_role(bbp_get_reply_author_id($reply_id))));
    $author_role = str_replace('class="', 'class="role-' . $role . ' ', $author_role);
    return $author_role;
}
开发者ID:quyip8818,项目名称:wps,代码行数:7,代码来源:config.php


示例2: widget

        function widget($args, $instance)
        {
            extract($args, EXTR_SKIP);
            $title = !empty($instance['title']) ? $instance['title'] : __('Recent Topics');
            $title = apply_filters('widget_title', $title, $instance, $this->id_base);
            $number = !empty($instance['number']) ? absint($instance['number']) : 5;
            $orderby = !empty($instance['number']) ? strip_tags($instance['order_by']) : 'newness';
            if ($orderby == 'newness') {
                $cb_meta_key = $cb_order_by = NULL;
            } elseif ($orderby == 'popular') {
                $cb_meta_key = '_bbp_reply_count';
                $cb_order_by = 'meta_value';
            } elseif ($orderby == 'freshness') {
                $cb_meta_key = '_bbp_last_active_time';
                $cb_order_by = 'meta_value';
            }
            if (!$number) {
                $number = 5;
            }
            $cb_qry = new WP_Query(array('post_type' => bbp_get_topic_post_type(), 'post_status' => array(bbp_get_public_status_id(), bbp_get_closed_status_id()), 'order' => 'DESC', 'posts_per_page' => $number, 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'meta_key' => $cb_meta_key, 'orderby' => $cb_order_by));
            echo $before_widget;
            echo $before_title . $title . $after_title;
            ?>
            <ul class="cb-bbp-recent-topics">

                <?php 
            while ($cb_qry->have_posts()) {
                $cb_qry->the_post();
                ?>

                    <li>

                        <?php 
                $cb_reply_id = bbp_get_reply_id($cb_qry->post->ID);
                $cb_reply_url = '<a class="bbp-reply-topic-title" href="' . esc_url(bbp_get_reply_url($cb_reply_id)) . '" title="' . esc_attr(bbp_get_reply_excerpt($cb_reply_id, 50)) . '">' . bbp_get_reply_topic_title($cb_reply_id) . '</a>';
                $cb_number_replies = bbp_get_topic_reply_count($cb_reply_id);
                $cb_author_avatar = bbp_get_reply_author_link(array('post_id' => $cb_reply_id, 'type' => 'avatar', 'size' => 60));
                $cb_author_name = bbp_get_reply_author_link(array('post_id' => $cb_reply_id, 'type' => 'name'));
                echo $cb_author_avatar . '<div class="cb-bbp-meta">' . $cb_reply_url . '<div class="cb-bbp-byline">' . __('Started by', 'cubell') . ' ' . $cb_author_name . ' <i class="icon-long-arrow-right"></i> ' . $cb_number_replies . ' replies</div></div>';
                ?>

                    </li>

                <?php 
            }
            ?>

            </ul>

<?php 
            echo $after_widget;
            // Reset the $post global
            wp_reset_postdata();
        }
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:54,代码来源:cb-bbp-recent-topics.php


示例3: notify_on_reply

 /**
  * Send a notification to subscribers
  *
  * @wp-filter bbp_new_reply 1
  */
 public function notify_on_reply($reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $reply_author = 0)
 {
     if ($this->handler === null) {
         return false;
     }
     global $wpdb;
     if (!bbp_is_subscriptions_active()) {
         return false;
     }
     $reply_id = bbp_get_reply_id($reply_id);
     $topic_id = bbp_get_topic_id($topic_id);
     $forum_id = bbp_get_forum_id($forum_id);
     if (!bbp_is_reply_published($reply_id)) {
         return false;
     }
     if (!bbp_is_topic_published($topic_id)) {
         return false;
     }
     $user_ids = bbp_get_topic_subscribers($topic_id, true);
     if (empty($user_ids)) {
         return false;
     }
     // Poster name
     $reply_author_name = apply_filters('bbsub_reply_author_name', bbp_get_reply_author_display_name($reply_id));
     do_action('bbp_pre_notify_subscribers', $reply_id, $topic_id, $user_ids);
     // Don't send notifications to the person who made the post
     $send_to_author = Falcon::get_option('bbsub_send_to_author', false);
     if (!$send_to_author && !empty($reply_author)) {
         $user_ids = array_filter($user_ids, function ($id) use($reply_author) {
             return (int) $id !== (int) $reply_author;
         });
     }
     // Get userdata for all users
     $user_ids = array_map(function ($id) {
         return get_userdata($id);
     }, $user_ids);
     // Sanitize the HTML into text
     $content = apply_filters('bbsub_html_to_text', bbp_get_reply_content($reply_id));
     // Build email
     $text = "%1\$s\n\n";
     $text .= "---\nReply to this email directly or view it online:\n%2\$s\n\n";
     $text .= "You are receiving this email because you subscribed to it. Login and visit the topic to unsubscribe from these emails.";
     $text = sprintf($text, $content, bbp_get_reply_url($reply_id));
     $text = apply_filters('bbsub_email_message', $text, $reply_id, $topic_id, $content);
     $subject = apply_filters('bbsub_email_subject', 'Re: [' . get_option('blogname') . '] ' . bbp_get_topic_title($topic_id), $reply_id, $topic_id);
     $options = array('id' => $topic_id, 'author' => $reply_author_name);
     $this->handler->send_mail($user_ids, $subject, $text, $options);
     do_action('bbp_post_notify_subscribers', $reply_id, $topic_id, $user_ids);
     return true;
 }
开发者ID:rmccue,项目名称:Falcon,代码行数:55,代码来源:bbPress.php


示例4: d4p_is_bbpress

 /**
  * Check if the current page is forum, topic or other bbPress page.
  *
  * @return bool true if the current page is the forum related
  */
 function d4p_is_bbpress()
 {
     $is = false;
     if (function_exists("bbp_get_forum_id")) {
         $is = bbp_get_forum_id() > 0 || bbp_get_reply_id() > 0 || bbp_get_topic_id() > 0;
         if (!$is) {
             global $template;
             $templates = array("single-reply-edit.php", "single-topic-edit.php");
             $file = pathinfo($template, PATHINFO_BASENAME);
             $is = in_array($file, $templates);
         }
     }
     return apply_filters('d4p_is_bbpress', $is);
 }
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:19,代码来源:shared.php


示例5: 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


示例6: append_message_trigger

 function append_message_trigger($author_link, $r)
 {
     //we need to make sure it is a reply
     if (!bbp_get_reply_id()) {
         return $author_link;
     }
     wp_enqueue_script('popoverasync', ig_uploader()->plugin_url . 'assets/popover/popoverasync.js', array('jquery', 'ig-bootstrap', 'jquery-frame-transport'));
     wp_enqueue_style('igu-uploader', ig_uploader()->plugin_url . 'assets/style.css');
     $new_links = explode($r['sep'], $author_link);
     $author_id = bbp_get_reply_author_id(bbp_get_reply_id($r['post_id']));
     $message_link = do_shortcode("[pm_user user_id={$author_id} class='btn btn-xs btn-primary']");
     $message_link = sprintf('<div style="%s">%s</div>', 'margin-top:5px', $message_link);
     array_splice($new_links, 1, 0, array($message_link));
     $new_links = implode($r['sep'], $new_links);
     //$logger = new IG_Logger('file', 'message_bbpress.txt');
     //$logger->log(var_export($new_links, true), IG_Logger::ERROR_LEVEL_DEBUG);
     return $new_links;
 }
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:18,代码来源:mm-bbpress-controller.php


示例7: widget

        function widget($args, $instance)
        {
            extract($args, EXTR_SKIP);
            $title = !empty($instance['title']) ? $instance['title'] : __('Recent Comments');
            $title = apply_filters('widget_title', $title, $instance, $this->id_base);
            $number = !empty($instance['number']) ? absint($instance['number']) : 5;
            if (!$number) {
                $number = 5;
            }
            $cb_qry = new WP_Query(array('post_type' => bbp_get_reply_post_type(), 'post_status' => array(bbp_get_public_status_id(), bbp_get_closed_status_id()), 'posts_per_page' => $number, 'ignore_sticky_posts' => true, 'no_found_rows' => true));
            echo $before_widget;
            echo $before_title . $title . $after_title;
            ?>
            <ul class="cb-bbp-recent-replies">

                <?php 
            while ($cb_qry->have_posts()) {
                $cb_qry->the_post();
                ?>

                    <li>

                        <?php 
                $cb_reply_id = bbp_get_reply_id($cb_qry->post->ID);
                $cb_reply_url = '<a class="bbp-reply-topic-title" href="' . esc_url(bbp_get_reply_url($cb_reply_id)) . '" title="' . esc_attr(bbp_get_reply_excerpt($cb_reply_id, 50)) . '">' . bbp_get_reply_topic_title($cb_reply_id) . '</a>';
                $cb_author_avatar = bbp_get_reply_author_link(array('post_id' => $cb_reply_id, 'type' => 'avatar', 'size' => 60));
                $cb_author_name = bbp_get_reply_author_link(array('post_id' => $cb_reply_id, 'type' => 'name'));
                echo $cb_author_avatar . '<div class="cb-bbp-meta">' . $cb_author_name . ' <i class="icon-long-arrow-right"></i> ' . $cb_reply_url . '<div class="cb-bbp-recent-replies-time">' . bbp_get_time_since(get_the_time('U')) . '</div></div>';
                ?>

                    </li>

                <?php 
            }
            ?>

            </ul>

        <?php 
            echo $after_widget;
            // Reset the $post global
            wp_reset_postdata();
        }
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:43,代码来源:cb-bbp-recent-replies.php


示例8: bbp_tab_index

							<?php 
    if (bbp_has_topics(array('show_stickies' => false, 'post_parent' => bbp_get_reply_forum_id(bbp_get_reply_id()), 'post__not_in' => array(bbp_get_reply_topic_id(bbp_get_reply_id()))))) {
        ?>

								<div>
									<input name="bbp_reply_move_option" id="bbp_reply_move_option_existing" type="radio" value="existing" tabindex="<?php 
        bbp_tab_index();
        ?>
" />
									<label for="bbp_reply_move_option_existing"><?php 
        _e('Use an existing topic in this forum:', 'firmasite');
        ?>
</label>

									<?php 
        bbp_dropdown(array('post_type' => bbp_get_topic_post_type(), 'post_parent' => bbp_get_reply_forum_id(bbp_get_reply_id()), 'selected' => -1, 'exclude' => bbp_get_reply_topic_id(bbp_get_reply_id()), 'select_id' => 'bbp_destination_topic', 'none_found' => __('No other topics found!', 'firmasite')));
        ?>

								</div>

							<?php 
    }
    ?>

						</fieldset>

						<div class="bbp-template-notice error alert alert-warning">
							<p><?php 
    _e('<strong>WARNING:</strong> This process cannot be undone.', 'firmasite');
    ?>
</p>
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:31,代码来源:form-reply-move.php


示例9: reply_update

 /**
  * Update the activity stream entry when a reply status changes
  *
  * @param int $post_id
  * @param obj $post
  * @uses get_post_type()
  * @uses bbp_get_reply_post_type()
  * @uses bbp_get_reply_id()
  * @uses bbp_is_reply_anonymous()
  * @uses bbp_get_public_status_id()
  * @uses bbp_get_closed_status_id()
  * @uses bbp_get_reply_topic_id()
  * @uses bbp_get_reply_forum_id()
  * @uses bbp_get_reply_author_id()
  * @return Bail early if not a reply, or reply is by anonymous user
  */
 public function reply_update($reply_id, $post)
 {
     // Bail early if not a reply
     if (get_post_type($post) != bbp_get_reply_post_type()) {
         return;
     }
     $reply_id = bbp_get_reply_id($reply_id);
     // Bail early if reply is by anonymous user
     if (bbp_is_reply_anonymous($reply_id)) {
         return;
     }
     $anonymous_data = array();
     // Action based on new status
     if ($post->post_status == bbp_get_public_status_id()) {
         // Validate reply data
         $topic_id = bbp_get_reply_topic_id($reply_id);
         $forum_id = bbp_get_reply_forum_id($reply_id);
         $reply_author_id = bbp_get_reply_author_id($reply_id);
         $this->reply_create($reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author_id);
     } else {
         $this->reply_delete($reply_id);
     }
 }
开发者ID:hscale,项目名称:webento,代码行数:39,代码来源:activity.php


示例10: get_the_time

	
	<header class="reply-header">
		<time class="reply-time" datetime="<?php 
echo get_the_time('Y-m-d\\TH:i');
?>
"><?php 
echo bp_core_time_since(strtotime(get_the_time('c')), current_time('timestamp'));
?>
</time>
		<?php 
apoc_report_post_button('reply');
?>
		
		<div class="reply-admin-links">
			<?php 
apoc_reply_admin_links(bbp_get_reply_id());
?>
			<a class="reply-permalink" href="<?php 
bbp_reply_url();
?>
">#<?php 
echo bbp_get_reply_position();
?>
</a>
		</div>
	</header>
	
	<section class="reply-body">
		<div class="reply-author">
			<?php 
echo $author->block;
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:30,代码来源:loop-single-reply.php


示例11: add_author_post_date_count_ip

    /**
     * Add post date, author post count and author ip to the author element.
     */
    public function add_author_post_date_count_ip()
    {
        ?>
		<div class="bbp-reply-post-date"><?php 
        bbp_reply_post_date(bbp_get_reply_id());
        ?>
</div>

		<div class="bbps-post-count"><?php 
        printf(__('Post count: %s', 'Avada'), bbp_get_user_reply_count_raw(bbp_get_reply_author_id()) + bbp_get_user_topic_count_raw(bbp_get_reply_author_id()));
        ?>
</div>

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

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

			<div class="bbp-reply-ip fusion-reply-id"><?php 
            bbp_author_ip(bbp_get_topic_id());
            ?>
</div>

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

		<?php 
        }
    }
开发者ID:agiper,项目名称:wordpress,代码行数:36,代码来源:class-avada-layout-bbpress.php


示例12: bbp_reply_form_fields

/**
 * Output the required hidden fields when creating/editing a reply
 *
 * @since bbPress (r2753)
 *
 * @uses bbp_is_reply_edit() To check if it's the reply edit page
 * @uses wp_nonce_field() To generate hidden nonce fields
 * @uses bbp_reply_id() To output the reply id
 * @uses bbp_topic_id() To output the topic id
 * @uses bbp_forum_id() To output the forum id
 */
function bbp_reply_form_fields()
{
    if (bbp_is_reply_edit()) {
        ?>

		<input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php 
        printf(__('Reply To: %s', 'bbpress'), bbp_get_topic_title());
        ?>
" maxlength="<?php 
        bbp_get_title_max_length();
        ?>
" />
		<input type="hidden" name="bbp_reply_id"    id="bbp_reply_id"    value="<?php 
        bbp_reply_id();
        ?>
" />
		<input type="hidden" name="action"          id="bbp_post_action" value="bbp-edit-reply" />

		<?php 
        if (current_user_can('unfiltered_html')) {
            wp_nonce_field('bbp-unfiltered-html-reply_' . bbp_get_reply_id(), '_bbp_unfiltered_html_reply', false);
        }
        ?>

		<?php 
        wp_nonce_field('bbp-edit-reply_' . bbp_get_reply_id());
    } else {
        ?>

		<input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php 
        printf(__('Reply To: %s', 'bbpress'), bbp_get_topic_title());
        ?>
" maxlength="<?php 
        bbp_get_title_max_length();
        ?>
" />
		<input type="hidden" name="bbp_topic_id"    id="bbp_topic_id"    value="<?php 
        bbp_topic_id();
        ?>
" />
		<input type="hidden" name="action"          id="bbp_post_action" value="bbp-new-reply" />

		<?php 
        if (current_user_can('unfiltered_html')) {
            wp_nonce_field('bbp-unfiltered-html-reply_' . bbp_get_topic_id(), '_bbp_unfiltered_html_reply', false);
        }
        ?>

		<?php 
        wp_nonce_field('bbp-new-reply');
        // Show redirect field if not viewing a specific topic
        if (bbp_is_query_name('bbp_single_topic')) {
            bbp_redirect_to_field(get_permalink());
        }
    }
}
开发者ID:rmccue,项目名称:bbPress,代码行数:67,代码来源:bbp-common-template.php


示例13: bbp_get_form_reply_to

/**
 * Return the value of reply to field
 *
 * @since bbPress (r4944)
 *
 * @uses bbp_get_reply_id() To validate the reply to
 * @uses apply_filters() Calls 'bbp_get_form_reply_to' with the reply to
 * @return string Value of reply to field
 */
function bbp_get_form_reply_to()
{
    // Set initial value
    $reply_to = 0;
    // Get $_REQUEST data
    if (isset($_REQUEST['bbp_reply_to'])) {
        $reply_to = (int) $_REQUEST['bbp_reply_to'];
    }
    // If empty, get from meta
    if (empty($reply_to)) {
        $reply_to = bbp_get_reply_to();
    }
    // Validate
    $reply_to = bbp_get_reply_id($reply_to);
    return (int) apply_filters('bbp_get_form_reply_to', $reply_to);
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:25,代码来源:template.php


示例14: apoc_report_post_button

/**
 * Generate post report buttons
 * @version 2.0
 */
function apoc_report_post_button($type)
{
    // Only let members report stuff
    if (!is_user_logged_in()) {
        return false;
    }
    // Get the data by context
    switch ($type) {
        // Forum reply
        case 'reply':
            $post_id = bbp_get_reply_id();
            $reported_user = bbp_get_reply_author();
            $post_number = bbp_get_reply_position();
            break;
            // Article comment
        // Article comment
        case 'comment':
            global $comment, $comment_count;
            $post_id = $comment->comment_ID;
            $reported_user = $comment->comment_author;
            $post_number = $comment_count['count'];
            break;
            // Private message
        // Private message
        case 'message':
            global $thread_template;
            $post_id = $thread_template->message->thread_id;
            $reported_user = $thread_template->message->sender_id;
            $post_number = $thread_template->current_message + 1;
            break;
    }
    // Echo the button
    $button = '<a class="report-post" title="Report This Post" data-id="' . $post_id . '" data-number="' . $post_number . '" data-user="' . $reported_user . '" data-type="' . $type . '"><i class="fa fa-warning"></i></a>';
    echo $button;
}
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:39,代码来源:comments.php


示例15: bbp_get_reply_position_raw

/**
 * Get the position of a reply by querying the DB directly for the replies
 * of a given topic.
 *
 * @since bbPress (r3933)
 *
 * @param int $reply_id
 * @param int $topic_id
 */
function bbp_get_reply_position_raw($reply_id = 0, $topic_id = 0)
{
    // Get required data
    $reply_id = bbp_get_reply_id($reply_id);
    $topic_id = !empty($topic_id) ? bbp_get_topic_id($topic_id) : bbp_get_reply_topic_id($reply_id);
    $reply_position = 0;
    // If reply is actually the first post in a topic, return 0
    if ($reply_id !== $topic_id) {
        // Make sure the topic has replies before running another query
        $reply_count = bbp_get_topic_reply_count($topic_id, false);
        if (!empty($reply_count)) {
            // Get reply id's
            $topic_replies = bbp_get_all_child_ids($topic_id, bbp_get_reply_post_type());
            if (!empty($topic_replies)) {
                // Reverse replies array and search for current reply position
                $topic_replies = array_reverse($topic_replies);
                $reply_position = array_search((string) $reply_id, $topic_replies);
                // Bump the position to compensate for the lead topic post
                $reply_position++;
            }
        }
    }
    return (int) $reply_position;
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:33,代码来源:functions.php


示例16: vortex_system_after_post

 function vortex_system_after_post($content)
 {
     $vortex_like_dislike = get_option("vortex_like_dislike");
     if (function_exists('bbp_get_reply_id')) {
         if (bbp_get_reply_id() != null) {
             $id = bbp_get_reply_id();
         } else {
             $id = get_the_ID();
         }
     } else {
         $id = get_the_ID();
     }
     if (!empty($vortex_like_dislike['v_exclude_category'])) {
         $array = $vortex_like_dislike['v_exclude_category'];
         if (has_category($array)) {
             return $content;
         }
     }
     if (!empty($vortex_like_dislike['v_exclude_post_types-p'])) {
         $array = $vortex_like_dislike['v_exclude_post_types-p'];
         if (in_array(get_post_type($id), $array)) {
             return $content;
         }
     }
     if ($vortex_like_dislike['v_button_show'][1] && is_page() && is_main_query()) {
         return $content . vortex_render_for_posts();
     } elseif ($vortex_like_dislike['v_button_show'][2] && is_main_query() && !is_page() && !is_singular()) {
         return $content . vortex_render_for_posts();
     } elseif ($vortex_like_dislike['v_button_show'][3] && is_singular('post')) {
         return $content . vortex_render_for_posts();
     } elseif ($vortex_like_dislike['v_button_show'][4] && !is_main_query()) {
         return $content . vortex_render_for_posts();
     } elseif ($vortex_like_dislike['v_button_show'][5] && is_singular() && !is_singular('post')) {
         return $content . vortex_render_for_posts();
     } else {
         return $content;
     }
 }
开发者ID:AlexAlexandru,项目名称:rating-system,代码行数:38,代码来源:posts-pages.php


示例17: bbp_current_user_can_access_create_reply_form

/**
 * Performs a series of checks to ensure the current user can create replies.
 *
 * @since 2.0.0 bbPress (r3127)
 *
 * @uses bbp_is_user_keymaster()
 * @uses bbp_is_topic_edit()
 * @uses current_user_can()
 * @uses bbp_get_topic_id()
 * @uses bbp_allow_anonymous()
 * @uses is_user_logged_in()
 *
 * @return bool
 */
function bbp_current_user_can_access_create_reply_form()
{
    // Users need to earn access
    $retval = false;
    // Always allow keymasters
    if (bbp_is_user_keymaster()) {
        $retval = true;
        // Looking at a single topic, topic is open, and forum is open
    } elseif ((bbp_is_single_topic() || is_page() || is_single()) && bbp_is_topic_open() && bbp_is_forum_open()) {
        $retval = bbp_current_user_can_publish_replies();
        // User can edit this topic
    } elseif (bbp_is_reply_edit()) {
        $retval = current_user_can('edit_reply', bbp_get_reply_id());
    }
    // Allow access to be filtered
    return (bool) apply_filters('bbp_current_user_can_access_create_reply_form', (bool) $retval);
}
开发者ID:CompositeUK,项目名称:clone.bbPress,代码行数:31,代码来源:template.php


示例18: bbp_get_form_reply_status_dropdown

/**
 * Returns reply status downdown
 *
 * This dropdown is only intended to be seen by users with the 'moderate'
 * capability. Because of this, no additional capablitiy checks are performed
 * within this function to check available reply statuses.
 *
 * @since 2.6.0 bbPress (r5399)
 *
 * @param $args This function supports these arguments:
 *  - select_id: Select id. Defaults to bbp_reply_status
 *  - tab: Deprecated. Tabindex
 *  - reply_id: Reply id
 *  - selected: Override the selected option
 */
function bbp_get_form_reply_status_dropdown($args = array())
{
    // Parse arguments against default values
    $r = bbp_parse_args($args, array('select_id' => 'bbp_reply_status', 'select_class' => 'bbp_dropdown', 'tab' => false, 'reply_id' => 0, 'selected' => false), 'reply_status_dropdown');
    // No specific selected value passed
    if (empty($r['selected'])) {
        // Post value is passed
        if (bbp_is_reply_form_post_request() && isset($_POST[$r['select_id']])) {
            $r['selected'] = sanitize_key($_POST[$r['select_id']]);
            // No Post value was passed
        } else {
            // Edit reply
            if (bbp_is_reply_edit()) {
                $r['reply_id'] = bbp_get_reply_id($r['reply_id']);
                $r['selected'] = bbp_get_reply_status($r['reply_id']);
                // New reply
            } else {
                $r['selected'] = bbp_get_public_status_id();
            }
        }
    }
    // Used variables
    $tab = !empty($r['tab']) ? ' tabindex="' . (int) $r['tab'] . '"' : '';
    // Start an output buffer, we'll finish it after the select loop
    ob_start();
    ?>

		<select name="<?php 
    echo esc_attr($r['select_id']);
    ?>
" id="<?php 
    echo esc_attr($r['select_id']);
    ?>
_select" class="<?php 
    echo esc_attr($r['select_class']);
    ?>
"<?php 
    echo $tab;
    ?>
>

			<?php 
    foreach (bbp_get_reply_statuses($r['reply_id']) as $key => $label) {
        ?>

				<option value="<?php 
        echo esc_attr($key);
        ?>
"<?php 
        selected($key, $r['selected']);
        ?>
><?php 
        echo esc_html($label);
        ?>
</option>

			<?php 
    }
    ?>

		</select>

		<?php 
    // Return the results
    return apply_filters('bbp_get_form_reply_status_dropdown', ob_get_clean(), $r);
}
开发者ID:CompositeUK,项目名称:clone.bbPress,代码行数:81,代码来源:template.php


示例19: bbp_template_include_theme_compat

/**
 * Reset main query vars and filter 'the_content' to output a bbPress
 * template part as needed.
 *
 * @since bbPress (r3032)
 * @param string $template
 * @uses bbp_is_single_user() To check if page is single user
 * @uses bbp_get_single_user_template() To get user template
 * @uses bbp_is_single_user_edit() To check if page is single user edit
 * @uses bbp_get_single_user_edit_template() To get user edit template
 * @uses bbp_is_single_view() To check if page is single view
 * @uses bbp_get_single_view_template() To get view template
 * @uses bbp_is_forum_edit() To check if page is forum edit
 * @uses bbp_get_forum_edit_template() To get forum edit template
 * @uses bbp_is_topic_merge() To check if page is topic merge
 * @uses bbp_get_topic_merge_template() To get topic merge template
 * @uses bbp_is_topic_split() To check if page is topic split
 * @uses bbp_get_topic_split_template() To get topic split template
 * @uses bbp_is_topic_edit() To check if page is topic edit
 * @uses bbp_get_topic_edit_template() To get topic edit template
 * @uses bbp_is_reply_edit() To check if page is reply edit
 * @uses bbp_get_reply_edit_template() To get reply edit template
 * @uses bbp_set_theme_compat_template() To set the global theme compat template
 */
function bbp_template_include_theme_compat($template = '')
{
    // Bail if the template already matches a bbPress template. This includes
    // archive-* and single-* WordPress post_type matches (allowing
    // themes to use the expected format) as well as all bbPress-specific
    // template files for users, topics, forums, etc...
    if (!empty(bbpress()->theme_compat->bbpress_template)) {
        return $template;
    }
    /** Users *************************************************************/
    if (bbp_is_single_user_edit() || bbp_is_single_user()) {
        // Reset post
        bbp_theme_compat_reset_post(array('ID' => 0, 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => '', 'post_title' => esc_attr(bbp_get_displayed_user_field('display_name')), 'post_status' => bbp_get_public_status_id(), 'is_archive' => false, 'comment_status' => 'closed'));
        /** Forums ************************************************************/
        // Forum archive
    } elseif (bbp_is_forum_archive()) {
        // Reset post
        bbp_theme_compat_reset_post(array('ID' => 0, 'post_title' => bbp_get_forum_archive_title(), 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => bbp_get_forum_post_type(), 'post_status' => bbp_get_public_status_id(), 'is_archive' => true, 'comment_status' => 'closed'));
        // Single Forum
    } elseif (bbp_is_forum_edit() || bbp_is_single_forum()) {
        // Reset post
        bbp_theme_compat_reset_post(array('ID' => bbp_get_forum_id(), 'post_title' => bbp_get_forum_title(), 'post_author' => bbp_get_forum_author_id(), 'post_date' => 0, 'post_content' => get_post_field('post_content', bbp_get_forum_id()), 'post_type' => bbp_get_forum_post_type(), 'post_status' => bbp_get_forum_visibility(), 'is_single' => true, 'comment_status' => 'closed'));
        /** Topics ************************************************************/
        // Topic archive
    } elseif (bbp_is_topic_archive()) {
        // Reset post
        bbp_theme_compat_reset_post(array('ID' => 0, 'post_title' => bbp_get_topic_archive_title(), 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => bbp_get_topic_post_type(), 'post_status' => bbp_get_public_status_id(), 'is_archive' => true, 'comment_status' => 'closed'));
        // Single Topic
    } elseif (bbp_is_topic_edit() || bbp_is_single_topic()) {
        // Reset post
        bbp_theme_compat_reset_post(array('ID' => bbp_get_topic_id(), 'post_title' => bbp_get_topic_title(), 'post_author' => bbp_get_topic_author_id(), 'post_date' => 0, 'post_content' => get_post_field('post_content', bbp_get_topic_id()), 'post_type' => bbp_get_topic_post_type(), 'post_status' => bbp_get_topic_status(), 'is_single' => true, 'comment_status' => 'closed'));
        /** Replies ***********************************************************/
        // Reply archive
    } elseif (is_post_type_archive(bbp_get_reply_post_type())) {
        // Reset post
        bbp_theme_compat_reset_post(array('ID' => 0, 'post_title' => __('Replies', 'bbpress'), 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => bbp_get_reply_post_type(), 'post_status' => bbp_get_public_status_id(), 'comment_status' => 'closed'));
        // Single Reply
    } elseif (bbp_is_reply_edit() || bbp_is_single_reply()) {
        // Reset post
        bbp_theme_compat_reset_post(array('ID' => bbp_get_reply_id(), 'post_title' => bbp_get_reply_title(), 'post_author' => bbp_get_reply_author_id(), 'post_date' => 0, 'post_content' => get_post_field('post_content', bbp_get_reply_id()), 'post_type' => bbp_get_reply_post_type(), 'post_status' => bbp_get_reply_status(), 'comment_status' => 'closed'));
        /** Views *************************************************************/
    } elseif (bbp_is_single_view()) {
        // Reset post
        bbp_theme_compat_reset_post(array('ID' => 0, 'post_title' => bbp_get_view_title(), 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => '', 'post_status' => bbp_get_public_status_id(), 'comment_status' => 'closed'));
        /** Topic Tags ********************************************************/
        // Topic Tag Edit
    } elseif (bbp_is_topic_tag_edit() || bbp_is_topic_tag()) {
        // Stash the current term in a new var
        set_query_var('bbp_topic_tag', get_query_var('term'));
        // Reset the post with our new title
        bbp_theme_compat_reset_post(array('ID' => 0, 'post_author' => 0, 'post_date' => 0, 'post_content' => '', 'post_type' => '', 'post_title' => sprintf(__('Topic Tag: %s', 'bbpress'), '<span>' . bbp_get_topic_tag_name() . '</span>'), 'post_status' => bbp_get_public_status_id(), 'comment_status' => 'closed'));
    }
    /**
     * If we are relying on bbPress's built in theme compatibility to load
     * the proper content, we need to intercept the_content, replace the
     * output, and display ours instead.
     *
     * To do this, we first remove all filters from 'the_content' and hook
     * our own function into it, which runs a series of checks to determine
     * the context, and then uses the built in shortcodes to output the
     * correct results from inside an output buffer.
     *
     * Uses bbp_get_theme_compat_templates() to provide fall-backs that
     * should be coded without superfluous mark-up and logic (prev/next
     * navigation, comments, date/time, etc...)
     * 
     * Hook into the 'bbp_get_bbpress_template' to override the array of
     * possible templates, or 'bbp_bbpress_template' to override the result.
     */
    if (bbp_is_theme_compat_active()) {
        // Remove all filters from the_content
        bbp_remove_all_filters('the_content');
        // Add a filter on the_content late, which we will later remove
        add_filter('the_content', 'bbp_replace_the_content');
        // Find the appropriate template file
        $template = bbp_get_theme_compat_templates();
//.........这里部分代码省略.........
开发者ID:hscale,项目名称:webento,代码行数:101,代码来源:theme-compat.php


示例20: insert_balance_reply

 /**
  * Insert Balance
  * @since 0.1
  * @version 1.2.1
  */
 public function insert_balance_reply()
 {
     $reply_id = bbp_get_reply_id();
     // Skip Anonymous replies
     if (bbp_is_reply_anonymous($reply_id)) {
         return;
     }
     // Get reply author
     $user_id = bbp_get_reply_author_id($reply_id);
     // Check for exclusions and guests
     if ($this->core->exclude_user($user_id) || $user_id == 0) {
         return;
     }
     $balance = $this->core->get_users_cred($user_id, $this->mycred_type);
     $layout = $this->core->plural() . ': ' . $this->core->format_creds($balance);
     echo apply_filters('mycred_bbp_reply_balance', '<div class="users-mycred-balance">' . $layout . '</div>', $layout, $user_id, $this);
 }
开发者ID:kfwebdev,项目名称:wp-atd,代码行数:22,代码来源:mycred-hook-bbPress.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bbp_get_reply_permalink函数代码示例发布时间:2022-05-24
下一篇:
PHP bbp_get_reply_forum_id函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap