/**
 * Filter the activity loop.
 *
 * Specifically, when on the activity directory and clicking on the "Followed
 * Sites" tab.
 *
 * @param str $qs The querystring for the BP loop
 * @param str $object The current object for the querystring
 * @return str Modified querystring
 */
function bp_follow_blogs_add_activity_scope_filter($qs, $object)
{
    // not on the blogs object? stop now!
    if ($object != 'activity') {
        return $qs;
    }
    // parse querystring into an array
    $r = wp_parse_args($qs);
    if (bp_is_current_action(constant('BP_FOLLOW_BLOGS_USER_ACTIVITY_SLUG'))) {
        $r['scope'] = 'followblogs';
    }
    if (!isset($r['scope'])) {
        return $qs;
    }
    if ('followblogs' !== $r['scope']) {
        return $qs;
    }
    // get blog IDs that the user is following
    $following_ids = bp_get_following_ids(array('user_id' => bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id(), 'follow_type' => 'blogs'));
    // if $following_ids is empty, pass a negative number so no blogs can be found
    $following_ids = empty($following_ids) ? -1 : $following_ids;
    $args = array('user_id' => 0, 'object' => 'blogs', 'primary_id' => $following_ids);
    // make sure we add a separator if we have an existing querystring
    if (!empty($qs)) {
        $qs .= '&';
    }
    // add our follow parameters to the end of the querystring
    $qs .= build_query($args);
    // support BP Groupblog
    // We need to filter the WHERE SQL conditions to do this
    if (function_exists('bp_groupblog_init')) {
        add_filter('bp_activity_get_where_conditions', 'bp_follow_blogs_groupblog_activity_where_conditions', 10, 2);
    }
    return $qs;
}
예제 #2
0
/**
 * Process user deletion requests.
 *
 * Note: No longer called here. See the Settings component.
 */
function bp_core_action_delete_user()
{
    $userID = bp_displayed_user_id();
    echo "Buddypress:";
    echo $userID;
    $now = current_time('mysql');
    $args = array('date_query' => array('after' => '5 minute ago', 'before' => $now, 'inclusive' => true), 'post_id' => $postID, 'user_id' => $userID, 'count' => true);
    $userActivityCount = get_comments($args);
    if (!bp_current_user_can('bp_moderate') || bp_is_my_profile() || !bp_displayed_user_id() || $userActivityCount != 0) {
        return false;
    }
    if (bp_is_current_component('admin') && bp_is_current_action('delete-user') && $userActivityCount == 0) {
        // Check the nonce.
        check_admin_referer('delete-user');
        $errors = false;
        $style = "<style> #account-delete-form .submit{ display:none !important;} </style>";
        if ($userActivityCount != 0) {
            $errors = true;
            return $style;
        }
        do_action('bp_core_before_action_delete_user', $errors);
        if (bp_core_delete_account(bp_displayed_user_id()) || $userActivityCount == 0) {
            bp_core_add_message(sprintf(__('%s has been deleted from the system.', 'buddypress'), bp_get_displayed_user_fullname()));
        } else {
            bp_core_add_message(sprintf(__('There was an error deleting %s from the system. Please try again.', 'buddypress'), bp_get_displayed_user_fullname()), 'error');
            $errors = true;
        }
        do_action('bp_core_action_delete_user', $errors);
        if ($errors) {
            bp_core_redirect(bp_displayed_user_domain());
        } else {
            bp_core_redirect(bp_loggedin_user_domain());
        }
    }
}
/**
 * When a site admin selects "Mark as Spammer/Not Spammer" from the admin menu
 * this action will fire and mark or unmark the user and their blogs as spam.
 * Must be a site admin for this function to run.
 *
 * @package BuddyPress Core
 * @param int $user_id Optional user ID to mark as spam
 * @global object $nxtdb Global NXTClass Database object
 */
function bp_core_action_set_spammer_status($user_id = 0)
{
    // Use displayed user if it's not yourself
    if (empty($user_id)) {
        $user_id = bp_displayed_user_id();
    }
    if (bp_is_current_component('admin') && in_array(bp_current_action(), array('mark-spammer', 'unmark-spammer'))) {
        // Check the nonce
        check_admin_referer('mark-unmark-spammer');
        // To spam or not to spam
        $status = bp_is_current_action('mark-spammer') ? 'spam' : 'ham';
        // The heavy lifting
        bp_core_process_spammer_status($user_id, $status);
        // Add feedback message. @todo - Error reporting
        if ('spam' == $status) {
            bp_core_add_message(__('User marked as spammer. Spam users are visible only to site admins.', 'buddypress'));
        } else {
            bp_core_add_message(__('User removed as spammer.', 'buddypress'));
        }
        // Deprecated. Use bp_core_process_spammer_status.
        $is_spam = 'spam' == $status;
        do_action('bp_core_action_set_spammer_status', bp_displayed_user_id(), $is_spam);
        // Redirect back to where we came from
        bp_core_redirect(nxt_get_referer());
    }
}
예제 #4
0
/**
 * Enqueue the CSS for messages autocomplete.
 *
 * @todo Why do we call wp_print_styles()?
 */
function messages_add_autocomplete_css()
{
    if (bp_is_messages_component() && bp_is_current_action('compose')) {
        wp_enqueue_style('bp-messages-autocomplete');
        wp_print_styles();
    }
}
/**
 * Catch and process Remove Friendship requests.
 *
 * @since 1.0.1
 */
function friends_action_remove_friend()
{
    if (!bp_is_friends_component() || !bp_is_current_action('remove-friend')) {
        return false;
    }
    if (!($potential_friend_id = (int) bp_action_variable(0))) {
        return false;
    }
    if ($potential_friend_id == bp_loggedin_user_id()) {
        return false;
    }
    $friendship_status = BP_Friends_Friendship::check_is_friend(bp_loggedin_user_id(), $potential_friend_id);
    if ('is_friend' == $friendship_status) {
        if (!check_admin_referer('friends_remove_friend')) {
            return false;
        }
        if (!friends_remove_friend(bp_loggedin_user_id(), $potential_friend_id)) {
            bp_core_add_message(__('Friendship could not be canceled.', 'buddypress'), 'error');
        } else {
            bp_core_add_message(__('Friendship canceled', 'buddypress'));
        }
    } elseif ('is_friends' == $friendship_status) {
        bp_core_add_message(__('You are not yet friends with this user', 'buddypress'), 'error');
    } else {
        bp_core_add_message(__('You have a pending friendship request with this user', 'buddypress'), 'error');
    }
    bp_core_redirect(wp_get_referer());
    return false;
}
 /**
  * Are we looking at something that needs group theme compatibility?
  *
  * @since 1.7.0
  */
 public function is_group()
 {
     // Bail if not looking at a group.
     if (!bp_is_groups_component()) {
         return;
     }
     // Group Directory.
     if (!bp_current_action() && !bp_current_item()) {
         bp_update_is_directory(true, 'groups');
         /**
          * Fires at the start of the group theme compatibility setup.
          *
          * @since 1.1.0
          */
         do_action('groups_directory_groups_setup');
         add_filter('bp_get_buddypress_template', array($this, 'directory_template_hierarchy'));
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'directory_content'));
         // Creating a group.
     } elseif (bp_is_groups_component() && bp_is_current_action('create')) {
         add_filter('bp_get_buddypress_template', array($this, 'create_template_hierarchy'));
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'create_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'create_content'));
         // Group page.
     } elseif (bp_is_single_item()) {
         add_filter('bp_get_buddypress_template', array($this, 'single_template_hierarchy'));
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'single_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'single_content'));
     }
 }
function bp_checkins_is_group_places_area()
{
    if (bp_is_groups_component() && bp_is_single_item() && bp_is_current_action('checkins') && bp_action_variable(0) == 'places') {
        return true;
    } else {
        return false;
    }
}
예제 #8
0
function bp_reshare_is_user_profile_reshares()
{
    if (bp_is_activity_component() && bp_displayed_user_id() && bp_is_current_action('reshares')) {
        return true;
    } else {
        return false;
    }
}
예제 #9
0
function messages_add_autocomplete_css()
{
    if (bp_is_messages_component() && bp_is_current_action('compose')) {
        $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
        wp_enqueue_style('bp-messages-autocomplete', buddypress()->plugin_url . "bp-messages/css/autocomplete/jquery.autocompletefb{$min}.css", array(), bp_get_version());
        wp_print_styles();
    }
}
예제 #10
0
function bp_chekins_allow_comments($retval, $open, $post_id)
{
    if (bp_is_current_component('checkins') && bp_is_current_action('place') && bp_action_variable(0)) {
        return $open;
    } else {
        return $retval;
    }
}
/**
 * Are we dealing with blog categories pages?
 * @return type 
 */
function bcg_is_component()
{
    $bp = buddypress();
    if (bp_is_current_component($bp->groups->slug) && bp_is_current_action(BCG_SLUG)) {
        return true;
    }
    return false;
}
예제 #12
0
function messages_add_autocomplete_css()
{
    if (bp_is_messages_component() && bp_is_current_action('compose')) {
        if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
            wp_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), bp_get_version());
        } else {
            wp_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.css', array(), bp_get_version());
        }
        wp_print_styles();
    }
}
예제 #13
0
/**
 * Load the "Create a Blog" screen.
 */
function bp_blogs_screen_create_a_blog()
{
    if (!is_multisite() || !bp_is_blogs_component() || !bp_is_current_action('create')) {
        return false;
    }
    if (!is_user_logged_in() || !bp_blog_signup_enabled()) {
        return false;
    }
    do_action('bp_blogs_screen_create_a_blog');
    bp_core_load_template(apply_filters('bp_blogs_template_create_a_blog', 'blogs/create'));
}
예제 #14
0
function messages_add_autocomplete_css()
{
    global $bp;
    if (bp_is_messages_component() && bp_is_current_action('compose')) {
        if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
            nxt_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), '20110723');
        } else {
            nxt_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.css', array(), '20110723');
        }
        nxt_print_styles();
    }
}
예제 #15
0
/**
 * Sets up and displays the screen output for the sub nav item "portfolio/edit/%d"
 */
function bp_portfolio_screen_edit()
{
    if (bp_is_portfolio_component() and bp_is_current_action('edit') and bp_displayed_user_id() == bp_loggedin_user_id()) {
        if (isset($_POST['edit'])) {
            // Check to see if the project belong to the logged_in user
            global $project;
            $project_id = bp_action_variable();
            $project = new BP_Portfolio_Item();
            $project->get(array('id' => $project_id));
            if ($project->query->post->post_author != bp_loggedin_user_id()) {
                bp_core_add_message(__('There was an error recording the project, please try again', 'bp-portfolio'), 'error');
                bp_core_load_template(apply_filters('bp_portfolio_template_screen_add', BP_PORTFOLIO_TEMPLATE . '/personal'));
            }
            // Check the nonce
            if (!wp_verify_nonce($_POST['_wpnonce'], 'project_form_nonce')) {
                bp_core_add_message(__('There was an error recording the project, please try again', 'bp-portfolio'), 'error');
                bp_core_load_template(apply_filters('bp_portfolio_template_screen_add', BP_PORTFOLIO_TEMPLATE . '/personal'));
            }
            if (empty($_POST['title-input']) or empty($_POST['url-input']) or empty($_POST['description'])) {
                bp_core_add_message(__('All fields are required', 'bp-portfolio'), 'error');
                $project_id = bp_action_variable();
                global $project;
                $project = new BP_Portfolio_Item();
                $project->get(array('id' => $project_id));
            } else {
                // Edit the post
                $posts = array('id' => bp_action_variable(), 'author_id' => bp_loggedin_user_id(), 'title' => $_POST['title-input'], 'description' => $_POST['description'], 'url' => $_POST['url-input']);
                // Is that a capture has been sent ?
                if (isset($_FILES['screenshot-input']) and $_FILES['screenshot-input']['error'] == 0) {
                    $posts['screenshot'] = $_FILES['screenshot-input'];
                }
                if ($item = bp_portfolio_save_item($posts)) {
                    bp_core_add_message(__('Project has been edited', 'bp-portfolio'));
                    bp_core_redirect(bp_core_get_user_domain(bp_loggedin_user_id()) . bp_get_portfolio_slug());
                } else {
                    bp_core_add_message(__('There was an error recording the item, please try again', 'bp-portfolio'), 'error');
                }
            }
        } else {
            // Create a global $project, so template will know that this is the edit page
            if ($project_id = bp_action_variable()) {
                global $project;
                $project_id = bp_action_variable();
                $project = new BP_Portfolio_Item();
                $project->get(array('id' => $project_id));
                if ($project->query->post->post_author == bp_loggedin_user_id()) {
                    bp_core_load_template(apply_filters('bp_portfolio_template_screen_one', BP_PORTFOLIO_TEMPLATE . '/add'));
                }
            }
        }
    }
}
/**
 * Enqueue the CSS for messages autocomplete.
 *
 * @todo Why do we call wp_print_styles()?
 */
function messages_add_autocomplete_css()
{
    if (bp_is_messages_component() && bp_is_current_action('compose')) {
        $min = bp_core_get_minified_asset_suffix();
        $url = buddypress()->plugin_url . 'bp-messages/css/';
        wp_enqueue_style('bp-messages-autocomplete', "{$url}autocomplete/jquery.autocompletefb{$min}.css", array(), bp_get_version());
        wp_style_add_data('bp-messages-autocomplete', 'rtl', true);
        if ($min) {
            wp_style_add_data('bp-messages-autocomplete', 'suffix', $min);
        }
        wp_print_styles();
    }
}
예제 #17
0
/**
 * Delte an item 
 */
function bp_portfolio_item_delete()
{
    if (bp_is_portfolio_component() and bp_is_current_action('delete') and bp_displayed_user_id() == bp_loggedin_user_id()) {
        if ($project_id = bp_action_variable() and wp_verify_nonce($_REQUEST['_wpnonce'], 'delete_project')) {
            if (bp_portfolio_delete_item($project_id)) {
                bp_core_add_message(__('Project deleted !', 'bp-portfolio'));
            } else {
                bp_core_add_message(__('An error occured, please try again.', 'bp-portfolio'), 'error');
            }
        } else {
            bp_core_add_message(__('An error occured, please try again.', 'bp-portfolio'), 'error');
        }
        bp_core_redirect(bp_core_get_user_domain(bp_loggedin_user_id()) . bp_get_portfolio_slug());
    }
}
function thatcamp_new_group_rss_catcher()
{
    global $wp_query;
    $feed_template = false;
    if (bp_is_groups_component() && bp_is_current_action('feed')) {
        $feed_template = 'rss-newest-groups.php';
    }
    if (!$feed_template) {
        return;
    }
    $wp_query->is_404 = false;
    status_header(200);
    include __DIR__ . '/includes/' . $feed_template;
    die;
}
/**
 * Load the "Create a Blog" screen.
 */
function bp_blogs_screen_create_a_blog()
{
    if (!is_multisite() || !bp_is_blogs_component() || !bp_is_current_action('create')) {
        return false;
    }
    if (!is_user_logged_in() || !bp_blog_signup_enabled()) {
        return false;
    }
    /**
     * Fires right before the loading of the Create A Blog screen template file.
     *
     * @since 1.0.0
     */
    do_action('bp_blogs_screen_create_a_blog');
    bp_core_load_template(apply_filters('bp_blogs_template_create_a_blog', 'blogs/create'));
}
function messages_screen_conversation()
{
    // Bail if not viewing a single message
    if (!bp_is_messages_component() || !bp_is_current_action('view')) {
        return false;
    }
    $thread_id = (int) bp_action_variable(0);
    if (empty($thread_id) || !messages_is_valid_thread($thread_id) || !messages_check_thread_access($thread_id) && !bp_current_user_can('bp_moderate')) {
        bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug()));
    }
    // Load up BuddyPress one time
    $bp = buddypress();
    // Decrease the unread count in the nav before it's rendered
    $bp->bp_nav[$bp->messages->slug]['name'] = sprintf(__('Messages <span>%s</span>', 'buddypress'), bp_get_total_unread_messages_count());
    do_action('messages_screen_conversation');
    bp_core_load_template(apply_filters('messages_template_view_message', 'members/single/home'));
}
/**
 * Check to see if a high five is being given, and if so, save it.
 *
 * Hooked to bp_actions, this function will fire before the screen function. We use our function
 * bp_is_example_component(), along with the bp_is_current_action() and bp_is_action_variable()
 * functions, to detect (based on the requested URL) whether the user has clicked on "send high
 * five". If so, we do a bit of simple logic to see what should happen next.
 *
 * @package BuddyPress_Skeleton_Component
 * @since 1.6
 */
function bp_example_high_five_save()
{
    if (bp_is_example_component() && bp_is_current_action('screen-one') && bp_is_action_variable('send-h5', 0)) {
        // The logged in user has clicked on the 'send high five' link
        if (bp_is_my_profile()) {
            // Don't let users high five themselves
            bp_core_add_message(__('No self-fives! :)', 'bp-example'), 'error');
        } else {
            if (bp_example_send_highfive(bp_displayed_user_id(), bp_loggedin_user_id())) {
                bp_core_add_message(__('High-five sent!', 'bp-example'));
            } else {
                bp_core_add_message(__('High-five could not be sent.', 'bp-example'), 'error');
            }
        }
        bp_core_redirect(bp_displayed_user_domain() . bp_get_example_slug() . '/screen-one');
    }
}
예제 #22
0
 /**
  * Sets up the current view when viewing a user page
  *
  * @since 1.2
  */
 function get_current_view($view, $item_type)
 {
     if ($item_type == 'user') {
         if (!bp_current_action()) {
             // An empty $bp->action_variables[0] means that you're looking at a list
             $view = 'list';
         } else {
             if (bp_is_current_action(BP_DOCS_CATEGORY_SLUG)) {
                 // Category view
                 $view = 'category';
             } else {
                 if (bp_is_current_action(BP_DOCS_CREATE_SLUG)) {
                     // Create new doc
                     $view = 'create';
                 } else {
                     if (!bp_action_variable(0)) {
                         // $bp->action_variables[1] is the slug for this doc. If there's no
                         // further chunk, then we're attempting to view a single item
                         $view = 'single';
                     } else {
                         if (bp_is_action_variable(BP_DOCS_EDIT_SLUG, 0)) {
                             // This is an edit page
                             $view = 'edit';
                         } else {
                             if (bp_is_action_variable(BP_DOCS_DELETE_SLUG, 0)) {
                                 // This is an delete request
                                 $view = 'delete';
                             } else {
                                 if (bp_is_action_variable(BP_DOCS_HISTORY_SLUG, 0)) {
                                     // This is a history request
                                     $view = 'history';
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return $view;
 }
function messages_action_delete_message()
{
    if (!bp_is_messages_component() || bp_is_current_action('notices') || !bp_is_action_variable('delete', 0)) {
        return false;
    }
    $thread_id = bp_action_variable(1);
    if (!$thread_id || !is_numeric($thread_id) || !messages_check_thread_access($thread_id)) {
        bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action()));
    } else {
        if (!check_admin_referer('messages_delete_thread')) {
            return false;
        }
        // Delete message
        if (!messages_delete_thread($thread_id)) {
            bp_core_add_message(__('There was an error deleting that message.', 'buddypress'), 'error');
        } else {
            bp_core_add_message(__('Message deleted.', 'buddypress'));
        }
        bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action()));
    }
}
예제 #24
0
/**
 * Process user deletion requests.
 *
 * Note: No longer called here. See the Settings component.
 */
function bp_core_action_delete_user()
{
    if (!bp_current_user_can('bp_moderate') || bp_is_my_profile() || !bp_displayed_user_id()) {
        return false;
    }
    if (bp_is_current_component('admin') && bp_is_current_action('delete-user')) {
        // Check the nonce
        check_admin_referer('delete-user');
        $errors = false;
        do_action('bp_core_before_action_delete_user', $errors);
        if (bp_core_delete_account(bp_displayed_user_id())) {
            bp_core_add_message(sprintf(__('%s has been deleted from the system.', 'buddypress'), bp_get_displayed_user_fullname()));
        } else {
            bp_core_add_message(sprintf(__('There was an error deleting %s from the system. Please try again.', 'buddypress'), bp_get_displayed_user_fullname()), 'error');
            $errors = true;
        }
        do_action('bp_core_action_delete_user', $errors);
        if ($errors) {
            bp_core_redirect(bp_displayed_user_domain());
        } else {
            bp_core_redirect(bp_loggedin_user_domain());
        }
    }
}
예제 #25
0
파일: forums.php 프로젝트: schiz/scrollax
				<option value="unreplied"><?php 
_e('Unreplied', 'buddypress');
?>
</option>

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

			</select>
		</li>
	</ul>
</div><!-- .item-list-tabs -->

<?php 
if (bp_is_current_action('favorites')) {
    locate_template(array('members/single/forums/topics.php'), true);
} else {
    do_action('bp_before_member_forums_content');
    ?>

	<div class="forums myforums">

		<?php 
    locate_template(array('forums/forums-loop.php'), true);
    ?>

	</div>

	<?php 
    do_action('bp_after_member_forums_content');
/**
 * Handles the deleting of a user
 */
function bp_settings_action_delete_account()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Bail if no submit action
    if (!isset($_POST['delete-account-understand'])) {
        return;
    }
    // Bail if not in settings
    if (!bp_is_settings_component() || !bp_is_current_action('delete-account')) {
        return false;
    }
    // 404 if there are any additional action variables attached
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    // Bail if account deletion is disabled
    if (bp_disable_account_deletion() && !bp_current_user_can('delete_users')) {
        return false;
    }
    // Nonce check
    check_admin_referer('delete-account');
    // Get username now because it might be gone soon!
    $username = bp_get_displayed_user_fullname();
    // delete the users account
    if (bp_core_delete_account(bp_displayed_user_id())) {
        // Add feedback ater deleting a user
        bp_core_add_message(sprintf(__('%s was successfully deleted.', 'buddypress'), $username), 'success');
        // Redirect to the root domain
        bp_core_redirect(bp_get_root_domain());
    }
}
예제 #27
0
 function _register()
 {
     global $bp;
     // If admin/create names and slugs are not provided, they fall back on the main
     // name and slug for the extension
     if (!$this->admin_name) {
         $this->admin_name = $this->name;
     }
     if (!$this->admin_slug) {
         $this->admin_slug = $this->slug;
     }
     if (!$this->create_name) {
         $this->create_name = $this->name;
     }
     if (!$this->create_slug) {
         $this->create_slug = $this->slug;
     }
     if (!empty($this->enable_create_step)) {
         // Insert the group creation step for the new group extension
         $bp->groups->group_creation_steps[$this->create_slug] = array('name' => $this->create_name, 'slug' => $this->create_slug, 'position' => $this->create_step_position);
         // Attach the group creation step display content action
         add_action('groups_custom_create_steps', array(&$this, 'create_screen'));
         // Attach the group creation step save content action
         add_action('groups_create_group_step_save_' . $this->create_slug, array(&$this, 'create_screen_save'));
     }
     // When we are viewing a single group, add the group extension nav item
     if (bp_is_group()) {
         if ($this->visibility == 'public' || $this->visibility != 'public' && $bp->groups->current_group->user_has_access) {
             if ($this->enable_nav_item) {
                 bp_core_new_subnav_item(array('name' => !$this->nav_item_name ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => $bp->groups->current_group->slug, 'parent_url' => bp_get_group_permalink($bp->groups->current_group), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array(&$this, '_display_hook'), 'user_has_access' => $this->enable_nav_item));
                 // When we are viewing the extension display page, set the title and options title
                 if (bp_is_current_action($this->slug)) {
                     add_action('bp_template_content_header', create_function('', 'echo "' . esc_attr($this->name) . '";'));
                     add_action('bp_template_title', create_function('', 'echo "' . esc_attr($this->name) . '";'));
                 }
             }
             // Hook the group home widget
             if (!bp_current_action() && bp_is_current_action('home')) {
                 add_action($this->display_hook, array(&$this, 'widget_display'));
             }
         }
     }
     // Construct the admin edit tab for the new group extension
     if (!empty($this->enable_edit_item) && bp_is_item_admin()) {
         add_action('groups_admin_tabs', create_function('$current, $group_slug', '$selected = ""; if ( "' . esc_attr($this->admin_slug) . '" == $current ) $selected = " class=\\"current\\""; echo "<li{$selected}><a href=\\"' . trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr($this->admin_slug)) . '\\">' . esc_attr($this->admin_name) . '</a></li>";'), 10, 2);
         // Catch the edit screen and forward it to the plugin template
         if (bp_is_groups_component() && bp_is_current_action('admin') && bp_is_action_variable($this->admin_slug, 0)) {
             // Check whether the user is saving changes
             $this->edit_screen_save();
             add_action('groups_custom_edit_steps', array(&$this, 'edit_screen'));
             if ('' != locate_template(array('groups/single/home.php'), false)) {
                 bp_core_load_template(apply_filters('groups_template_group_home', 'groups/single/home'));
             } else {
                 add_action('bp_template_content_header', create_function('', 'echo "<ul class=\\"content-header-nav\\">"; bp_group_admin_tabs(); echo "</ul>";'));
                 add_action('bp_template_content', array(&$this, 'edit_screen'));
                 bp_core_load_template(apply_filters('bp_core_template_plugin', '/groups/single/plugins'));
             }
         }
     }
 }
function buatp_fields_exclution($fields, $id)
{
    global $bp;
    $settings_basic = get_option('buatp_basic_setting', true);
    $settings_profile_data = get_option('buatp_profile_data_setting', true);
    if (!$settings_basic['buatp_default_type_selection'] || $_POST['action'] == 'append_conditional_fields') {
        return $fields;
    }
    $field_name = $settings_basic['buatp_type_field_selection'];
    $field_id = buatp_get_field_id_by_name($field_name);
    $type_names = buatp_get_all_types($field_id);
    foreach ((array) $type_names as $val) {
        if (bp_is_current_action('edit') || bp_is_current_action('public')) {
            $user_id = $bp->displayed_user->id;
            if (is_super_admin($bp->loggedin_user->id)) {
                return $fields;
            }
            $user_type = buatp_get_field_data($settings_basic['buatp_type_field_selection'], $user_id);
            if ($user_type == $val['name']) {
                $excludes_arr = (array) $settings_profile_data['buatp_exclude_fields_for_' . $val['id']];
            }
        }
        if ('request-details' == bp_get_current_signup_step()) {
            $excludes_arr = array_merge((array) $excludes_arr, (array) $settings_profile_data['buatp_exclude_fields_for_' . $val['id']]);
        }
    }
    if ($settings_basic['buatp_can_user_change_type'] == 'false' && !is_super_admin($bp->loggedin_user->id) && bp_get_current_signup_step() != 'request-details' && apply_filters('buatp_show_type_field_condition', true) && $bp->current_action == 'edit' && $bp->current_component == 'profile') {
        $excludes_arr = array_merge((array) $excludes_arr, array($field_name));
    }
    $excludes = array();
    foreach ((array) $excludes_arr as $names) {
        $excludes[$i++] = buatp_get_field_id_by_name($names);
    }
    $field_info = $fields;
    foreach ((array) $field_info as $index => $field) {
        if (in_array($field->id, $excludes)) {
            unset($fields[$index]);
        }
    }
    return apply_filters('buatp_fields_exclution', array_merge((array) $fields));
}
예제 #29
0
					<?php 
    do_action('bp_member_blog_order_options');
    ?>

				</select>
			</li>

		<?php 
}
?>

	</ul>
</div>

<?php 
if (bp_is_current_action('requests')) {
    locate_template(array('members/single/friends/requests.php'), true);
} else {
    do_action('bp_before_member_friends_content');
    ?>

	<div class="members friends">

		<?php 
    locate_template(array('members/members-loop.php'), true);
    ?>

	</div><!-- .members.friends -->

	<?php 
    do_action('bp_after_member_friends_content');
예제 #30
0
 *
 * @package Wonderflux
 * @subpackage BuddyPress template files
 */
?>

<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
	<ul>
		<?php 
if (bp_is_my_profile()) {
    bp_get_options_nav();
}
?>

		<?php 
if (!bp_is_current_action('invites')) {
    ?>

			<li id="groups-order-select" class="last filter">

				<label for="groups-order-by"><?php 
    _e('Order By:', 'wonderflux');
    ?>
</label>
				<select id="groups-order-by">
					<option value="active"><?php 
    _e('Last Active', 'wonderflux');
    ?>
</option>
					<option value="popular"><?php 
    _e('Most Members', 'wonderflux');