?> <?php if (bp_activity_user_can_delete()) { ?> <a href="<?php bp_activity_comment_delete_link(); ?> " class="delete acomment-delete confirm bp-secondary-action" rel="nofollow"><?php _e('Delete', 'buddypress'); ?> </a> <?php } ?> <?php do_action('bp_activity_comment_options'); ?> </div> <?php bp_activity_recurse_comments(bp_activity_current_comment()); ?> </li> <?php do_action('bp_after_activity_comment');
/** * Set up some globals used in the activity comment loop when AJAX is used. * * @since BuddyPress (2.0.0) * * @see bp_blogs_setup_activity_loop_globals() */ function bp_blogs_setup_comment_loop_globals_on_ajax() { // not AJAX? stop now! if ( ! defined( 'DOING_AJAX' ) ) { return; } if ( false === (bool) constant( 'DOING_AJAX' ) ) { return; } // get the parent activity item $comment = bp_activity_current_comment(); $parent_activity = new BP_Activity_Activity( $comment->item_id ); // setup the globals bp_blogs_setup_activity_loop_globals( $parent_activity ); }
/** * Determine whether a comment can be made on an activity reply item. * * @since BuddyPress (1.5.0) * * @param object $comment Activity comment. * @return bool $can_comment True if comment can receive comments, otherwise * false. */ function bp_activity_can_comment_reply($comment = '') { // Assume activity can be commented on $can_comment = true; // Check that comment exists if (empty($comment)) { $comment = bp_activity_current_comment(); } if (!empty($comment)) { // Fall back on current comment in activity loop $comment_depth = isset($comment->depth) ? intval($comment->depth) : bp_activity_get_comment_depth(); // Threading is turned on, so check the depth if (get_option('thread_comments')) { $can_comment = (bool) ($comment_depth < get_option('thread_comments_depth')); // No threading for comment replies if no threading for comments } else { $can_comment = false; } } /** * Filters whether a comment can be made on an activity reply item. * * @since BuddyPress (1.5.0) * * @param bool $can_comment Status on if activity reply can be commented on. * @param string $comment Current comment being checked on. */ return (bool) apply_filters('bp_activity_can_comment_reply', $can_comment, $comment); }
/** * Adds a "mark as spam" button to each activity COMMENT item for site admins. * * This function is intended to be used inside the activity stream loop. * * @since BuddyPress (1.6) */ public function add_activity_comment_spam_button() { if (!bp_activity_user_can_mark_spam()) { return; } // By default, only handle activity updates and activity comments. $current_comment = bp_activity_current_comment(); if (empty($current_comment) || !in_array($current_comment->type, BP_Akismet::get_activity_types())) { return; } bp_button(array('block_self' => false, 'component' => 'activity', 'id' => 'activity_make_spam_' . bp_get_activity_comment_id(), 'link_class' => 'bp-secondary-action spam-activity-comment confirm', 'link_href' => wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_comment_id() . '/?cid=' . bp_get_activity_comment_id(), 'bp_activity_akismet_spam_' . bp_get_activity_comment_id()), 'link_text' => __('Spam', 'buddypress'), 'wrapper' => false)); }
/** * Determine whether a comment can be made on an activity reply item. * * @since BuddyPress (1.5.0) * * @param object $comment Activity comment. * @return bool $can_comment True if comment can receive comments, otherwise * false. */ function bp_activity_can_comment_reply($comment = '') { // Assume activity can be commented on $can_comment = true; // Check that comment exists if (empty($comment)) { $comment = bp_activity_current_comment(); } if (!empty($comment)) { // Fall back on current comment in activity loop $comment_depth = isset($comment->depth) ? intval($comment->depth) : bp_activity_get_comment_depth(); // Threading is turned on, so check the depth if (get_option('thread_comments')) { $can_comment = (bool) ($comment_depth < get_option('thread_comments_depth')); // No threading for comment replies if no threading for comments } else { $can_comment = false; } } return (bool) apply_filters('bp_activity_can_comment_reply', $can_comment, $comment); }