/**
 * Adds the User Admin top-level menu to user pages
 *
 * @package BuddyPress
 * @since 1.5
 */
function bp_members_admin_bar_user_admin_menu()
{
    global $bp, $wp_admin_bar;
    // Only show if viewing a user
    if (!bp_is_user()) {
        return false;
    }
    // Don't show this menu to non site admins or if you're viewing your own profile
    if (!current_user_can('edit_users') || bp_is_my_profile()) {
        return false;
    }
    // User avatar
    $avatar = bp_core_fetch_avatar(array('item_id' => $bp->displayed_user->id, 'email' => $bp->displayed_user->userdata->user_email, 'width' => 16, 'height' => 16));
    // Unique ID for the 'My Account' menu
    $bp->user_admin_menu_id = !empty($avatar) ? 'user-admin-with-avatar' : 'user-admin';
    // Add the top-level User Admin button
    $wp_admin_bar->add_menu(array('id' => $bp->user_admin_menu_id, 'title' => $avatar . bp_get_displayed_user_fullname(), 'href' => bp_displayed_user_domain()));
    // User Admin > Edit this user's profile
    $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => 'edit-profile', 'title' => __("Edit Profile", 'buddypress'), 'href' => bp_get_members_component_link('profile', 'edit')));
    // User Admin > Edit this user's avatar
    $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => 'change-avatar', 'title' => __("Edit Avatar", 'buddypress'), 'href' => bp_get_members_component_link('profile', 'change-avatar')));
    // User Admin > Spam/unspam
    if (!bp_core_is_user_spammer(bp_displayed_user_id())) {
        $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => 'spam-user', 'title' => __('Mark as Spammer', 'buddypress'), 'href' => wp_nonce_url(bp_displayed_user_domain() . 'admin/mark-spammer/', 'mark-unmark-spammer'), 'meta' => array('onclick' => 'confirm(" ' . __('Are you sure you want to mark this user as a spammer?', 'buddypress') . '");')));
    } else {
        $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => 'unspam-user', 'title' => __('Not a Spammer', 'buddypress'), 'href' => wp_nonce_url(bp_displayed_user_domain() . 'admin/unmark-spammer/', 'mark-unmark-spammer'), 'meta' => array('onclick' => 'confirm(" ' . __('Are you sure you want to mark this user as not a spammer?', 'buddypress') . '");')));
    }
    // User Admin > Delete Account
    $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => 'delete-user', 'title' => __('Delete Account', 'buddypress'), 'href' => wp_nonce_url(bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user'), 'meta' => array('onclick' => 'confirm(" ' . __("Are you sure you want to delete this user's account?", 'buddypress') . '");')));
}
/**
 * Setup profile / BuddyBar navigation.
 *
 * This function was moved from {@link BP_Follow_Component} in v1.3.0 due
 * to the users module being toggleable.
 *
 * @since 1.3.0
 */
function bp_follow_user_setup_nav($main_nav = array(), $sub_nav = array())
{
    global $bp;
    // If we're in the admin area and we're using the WP toolbar, we don't need
    // to run the rest of this method
    if (defined('WP_NETWORK_ADMIN') && bp_use_wp_admin_bar()) {
        return;
    }
    // Need to change the user ID, so if we're not on a member page, $counts variable is still calculated
    $user_id = bp_is_user() ? bp_displayed_user_id() : bp_loggedin_user_id();
    $counts = bp_follow_total_follow_counts(array('user_id' => $user_id));
    // BuddyBar compatibility
    $domain = bp_displayed_user_domain() ? bp_displayed_user_domain() : bp_loggedin_user_domain();
    /** FOLLOWERS NAV ************************************************/
    bp_core_new_nav_item(array('name' => sprintf(__('Following <span>%d</span>', 'bp-follow'), $counts['following']), 'slug' => $bp->follow->following->slug, 'position' => $bp->follow->params['adminbar_myaccount_order'], 'screen_function' => 'bp_follow_screen_following', 'default_subnav_slug' => 'following', 'item_css_id' => 'members-following'));
    /** FOLLOWING NAV ************************************************/
    bp_core_new_nav_item(array('name' => sprintf(__('Followers <span>%d</span>', 'bp-follow'), $counts['followers']), 'slug' => $bp->follow->followers->slug, 'position' => apply_filters('bp_follow_followers_nav_position', 62), 'screen_function' => 'bp_follow_screen_followers', 'default_subnav_slug' => 'followers', 'item_css_id' => 'members-followers'));
    /** ACTIVITY SUBNAV **********************************************/
    // Add activity sub nav item
    if (bp_is_active('activity') && apply_filters('bp_follow_show_activity_subnav', true)) {
        bp_core_new_subnav_item(array('name' => _x('Following', 'Activity subnav tab', 'bp-follow'), 'slug' => constant('BP_FOLLOWING_SLUG'), 'parent_url' => trailingslashit($domain . bp_get_activity_slug()), 'parent_slug' => bp_get_activity_slug(), 'screen_function' => 'bp_follow_screen_activity_following', 'position' => 21, 'item_css_id' => 'activity-following'));
    }
    // BuddyBar compatibility
    add_action('bp_adminbar_menus', 'bp_follow_group_buddybar_items');
}
 function setup_nav()
 {
     global $bp;
     $link = bp_displayed_user_id() ? bp_displayed_user_domain() : bp_loggedin_user_domain();
     $reshare_nav = array('name' => __('Reshares', 'bp-reshare'), 'link' => $link . bp_get_activity_slug() . '/reshares/', 'slug' => 'reshares', 'css_id' => 'activity-reshares', 'user_has_access' => true, 'position' => 50, 'screen_function' => false);
     $bp->bp_options_nav['activity']['reshares'] = $reshare_nav;
 }
 /**
  * Setup BuddyBar navigation
  *
  * @global BuddyPress $bp The one true BuddyPress instance
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     global $bp;
     /**
      * Blog/post/comment menus should not appear on single WordPress setups.
      * Although comments and posts made by users will still show on their
      * activity stream.
      */
     if (!is_multisite()) {
         return false;
     }
     $sub_nav = array();
     // Add 'Sites' to the main navigation
     $main_nav = array('name' => sprintf(__('Sites <span>%d</span>', 'buddypress'), bp_blogs_total_blogs_for_user()), 'slug' => $this->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-sites', 'item_css_id' => $this->id);
     // Determine user to use
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     $parent_url = trailingslashit($user_domain . bp_get_blogs_slug());
     $sub_nav[] = array('name' => __('My Sites', 'buddypress'), 'slug' => 'my-sites', 'parent_url' => $parent_url, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_my_blogs', 'position' => 10);
     // Setup navigation
     parent::setup_nav($main_nav, $sub_nav);
 }
 /**
  * Set up component navigation.
  *
  * @since 1.9.0
  *
  * @see BP_Component::setup_nav() for a description of arguments.
  *
  * @param array $main_nav Optional. See BP_Component::setup_nav() for
  *                        description.
  * @param array $sub_nav  Optional. See BP_Component::setup_nav() for
  *                        description.
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     // Determine user to use.
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     $access = bp_core_can_edit_settings();
     $slug = bp_get_notifications_slug();
     $notifications_link = trailingslashit($user_domain . $slug);
     // Only grab count if we're on a user page and current user has access.
     if (bp_is_user() && bp_user_has_access()) {
         $count = bp_notifications_get_unread_notification_count(bp_displayed_user_id());
         $class = 0 === $count ? 'no-count' : 'count';
         $nav_name = sprintf(_x('Notifications <span class="%s">%s</span>', 'Profile screen nav', 'buddypress'), esc_attr($class), bp_core_number_format($count));
     } else {
         $nav_name = _x('Notifications', 'Profile screen nav', 'buddypress');
     }
     // Add 'Notifications' to the main navigation.
     $main_nav = array('name' => $nav_name, 'slug' => $slug, 'position' => 30, 'show_for_displayed_user' => $access, 'screen_function' => 'bp_notifications_screen_unread', 'default_subnav_slug' => 'unread', 'item_css_id' => $this->id);
     // Add the subnav items to the notifications nav item.
     $sub_nav[] = array('name' => _x('Unread', 'Notification screen nav', 'buddypress'), 'slug' => 'unread', 'parent_url' => $notifications_link, 'parent_slug' => $slug, 'screen_function' => 'bp_notifications_screen_unread', 'position' => 10, 'item_css_id' => 'notifications-my-notifications', 'user_has_access' => $access);
     $sub_nav[] = array('name' => _x('Read', 'Notification screen nav', 'buddypress'), 'slug' => 'read', 'parent_url' => $notifications_link, 'parent_slug' => $slug, 'screen_function' => 'bp_notifications_screen_read', 'position' => 20, 'user_has_access' => $access);
     parent::setup_nav($main_nav, $sub_nav);
 }
/**
 * Add the User Admin top-level menu to user pages.
 *
 * @since 1.5.0
 */
function bp_members_admin_bar_user_admin_menu()
{
    global $wp_admin_bar;
    // Only show if viewing a user
    if (!bp_is_user()) {
        return false;
    }
    // Don't show this menu to non site admins or if you're viewing your own profile
    if (!current_user_can('edit_users') || bp_is_my_profile()) {
        return false;
    }
    $bp = buddypress();
    // Unique ID for the 'My Account' menu
    $bp->user_admin_menu_id = 'user-admin';
    // Add the top-level User Admin button
    $wp_admin_bar->add_menu(array('id' => $bp->user_admin_menu_id, 'title' => __('Edit Member', 'buddypress'), 'href' => bp_displayed_user_domain()));
    if (bp_is_active('xprofile')) {
        // User Admin > Edit this user's profile
        $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => $bp->user_admin_menu_id . '-edit-profile', 'title' => __("Edit Profile", 'buddypress'), 'href' => bp_get_members_component_link('profile', 'edit')));
        // User Admin > Edit this user's avatar
        if (buddypress()->avatar->show_avatars) {
            $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => $bp->user_admin_menu_id . '-change-avatar', 'title' => __("Edit Profile Photo", 'buddypress'), 'href' => bp_get_members_component_link('profile', 'change-avatar')));
        }
    }
    if (bp_is_active('settings')) {
        // User Admin > Spam/unspam
        $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => $bp->user_admin_menu_id . '-user-capabilities', 'title' => __('User Capabilities', 'buddypress'), 'href' => bp_displayed_user_domain() . 'settings/capabilities/'));
        // User Admin > Delete Account
        $wp_admin_bar->add_menu(array('parent' => $bp->user_admin_menu_id, 'id' => $bp->user_admin_menu_id . '-delete-user', 'title' => __('Delete Account', 'buddypress'), 'href' => bp_displayed_user_domain() . 'settings/delete-account/'));
    }
}
 /**
  * Setup BuddyBar navigation
  */
 function setup_nav()
 {
     // Define local variable
     $sub_nav = array();
     // Add the settings navigation item
     $main_nav = array('name' => __('Settings', 'buddypress'), 'slug' => $this->slug, 'position' => 100, 'show_for_displayed_user' => bp_core_can_edit_settings(), 'screen_function' => 'bp_settings_screen_general', 'default_subnav_slug' => 'general');
     // Determine user to use
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     $settings_link = trailingslashit($user_domain . $this->slug);
     // Add General Settings nav item
     $sub_nav[] = array('name' => __('General', 'buddypress'), 'slug' => 'general', 'parent_url' => $settings_link, 'parent_slug' => $this->slug, 'screen_function' => 'bp_settings_screen_general', 'position' => 10, 'user_has_access' => bp_core_can_edit_settings());
     // Add Notifications nav item
     $sub_nav[] = array('name' => __('Notifications', 'buddypress'), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => $this->slug, 'screen_function' => 'bp_settings_screen_notification', 'position' => 20, 'user_has_access' => bp_core_can_edit_settings());
     // Add Spam Account nav item
     if (bp_current_user_can('bp_moderate')) {
         $sub_nav[] = array('name' => __('Capabilities', 'buddypress'), 'slug' => 'capabilities', 'parent_url' => $settings_link, 'parent_slug' => $this->slug, 'screen_function' => 'bp_settings_screen_capabilities', 'position' => 80, 'user_has_access' => !bp_is_my_profile());
     }
     // Add Delete Account nav item
     if (!bp_disable_account_deletion() || bp_current_user_can('delete_users')) {
         $sub_nav[] = array('name' => __('Delete Account', 'buddypress'), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => $this->slug, 'screen_function' => 'bp_settings_screen_delete_account', 'position' => 90, 'user_has_access' => bp_is_my_profile() || !is_super_admin(bp_displayed_user_id()));
     }
     parent::setup_nav($main_nav, $sub_nav);
 }
 /**
  * Set up navigation.
  *
  * @param array $main_nav Array of main nav items.
  * @param array $sub_nav  Array of sub nav items.
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     // Determine user to use
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     $access = bp_core_can_edit_settings();
     $slug = bp_get_settings_slug();
     $settings_link = trailingslashit($user_domain . $slug);
     // Add the settings navigation item
     $main_nav = array('name' => __('Settings', 'buddypress'), 'slug' => $slug, 'position' => 100, 'show_for_displayed_user' => $access, 'screen_function' => 'bp_settings_screen_general', 'default_subnav_slug' => 'general');
     // Add General Settings nav item
     $sub_nav[] = array('name' => __('General', 'buddypress'), 'slug' => 'general', 'parent_url' => $settings_link, 'parent_slug' => $slug, 'screen_function' => 'bp_settings_screen_general', 'position' => 10, 'user_has_access' => $access);
     // Add Email nav item. Formerly called 'Notifications', we
     // retain the old slug and function names for backward compat
     $sub_nav[] = array('name' => __('Email', 'buddypress'), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => $slug, 'screen_function' => 'bp_settings_screen_notification', 'position' => 20, 'user_has_access' => $access);
     // Add Spam Account nav item
     if (bp_current_user_can('bp_moderate')) {
         $sub_nav[] = array('name' => __('Capabilities', 'buddypress'), 'slug' => 'capabilities', 'parent_url' => $settings_link, 'parent_slug' => $slug, 'screen_function' => 'bp_settings_screen_capabilities', 'position' => 80, 'user_has_access' => !bp_is_my_profile());
     }
     // Add Delete Account nav item
     if (!bp_disable_account_deletion() && bp_is_my_profile() || bp_current_user_can('delete_users')) {
         $sub_nav[] = array('name' => __('Delete Account', 'buddypress'), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => $slug, 'screen_function' => 'bp_settings_screen_delete_account', 'position' => 90, 'user_has_access' => !is_super_admin(bp_displayed_user_id()));
     }
     parent::setup_nav($main_nav, $sub_nav);
 }
Beispiel #9
0
 /**
  * Setup BuddyBar navigation
  * Sets up user tabs
  * 
  */
 public function setup_nav($main_nav = array(), $main_nav = array())
 {
     // Define local variables
     $sub_nav = array();
     $screen = BuddyBlog_Screens::get_instance();
     //instance of the blog screen
     $total_posts = 0;
     if (bp_is_my_profile()) {
         $total_posts = buddyblog_get_total_posted(bp_displayed_user_id());
     } else {
         $total_posts = buddyblog_get_total_published_posts(bp_displayed_user_id());
     }
     //
     // Add 'Blog' to the main navigation
     $main_nav = array('name' => sprintf(__('Blog <span>%d</span>', 'buddyblog'), $total_posts), 'slug' => $this->slug, 'position' => 70, 'screen_function' => array($screen, 'my_posts'), 'default_subnav_slug' => BUDDYBLOG_ARCHIVE_SLUG, 'item_css_id' => $this->id);
     //whether to link to logged in user or displayed user
     if (!bp_is_my_profile()) {
         $blog_link = trailingslashit(bp_displayed_user_domain() . $this->slug);
     } else {
         $blog_link = trailingslashit(bp_loggedin_user_domain() . $this->slug);
     }
     // Add the Group Invites nav item
     $sub_nav[] = array('name' => __('Posts', 'buddyblog'), 'slug' => BUDDYBLOG_ARCHIVE_SLUG, 'parent_url' => $blog_link, 'parent_slug' => $this->slug, 'screen_function' => array($screen, 'my_posts'), 'position' => 30);
     $sub_nav[] = array('name' => __('New Post', 'buddyblog'), 'slug' => 'edit', 'parent_url' => $blog_link, 'parent_slug' => $this->slug, 'screen_function' => array($screen, 'new_post'), 'user_has_access' => bp_is_my_profile(), 'position' => 30);
     parent::setup_nav($main_nav, $sub_nav);
 }
 /**
  * Setup BuddyBar navigation
  *
  * @global BuddyPress $bp The one true BuddyPress instance
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     $sub_nav = array();
     $name = sprintf(__('Messages <span>%s</span>', 'buddypress'), bp_get_total_unread_messages_count());
     // Add 'Messages' to the main navigation
     $main_nav = array('name' => $name, 'slug' => $this->slug, 'position' => 50, 'show_for_displayed_user' => false, 'screen_function' => 'messages_screen_inbox', 'default_subnav_slug' => 'inbox', 'item_css_id' => $this->id);
     // Determine user to use
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     // Link to user messages
     $messages_link = trailingslashit($user_domain . $this->slug);
     // Add the subnav items to the profile
     $sub_nav[] = array('name' => __('Inbox', 'buddypress'), 'slug' => 'inbox', 'parent_url' => $messages_link, 'parent_slug' => $this->slug, 'screen_function' => 'messages_screen_inbox', 'position' => 10, 'user_has_access' => bp_core_can_edit_settings());
     $sub_nav[] = array('name' => __('Sent', 'buddypress'), 'slug' => 'sentbox', 'parent_url' => $messages_link, 'parent_slug' => $this->slug, 'screen_function' => 'messages_screen_sentbox', 'position' => 20, 'user_has_access' => bp_core_can_edit_settings());
     $sub_nav[] = array('name' => __('Compose', 'buddypress'), 'slug' => 'compose', 'parent_url' => $messages_link, 'parent_slug' => $this->slug, 'screen_function' => 'messages_screen_compose', 'position' => 30, 'user_has_access' => bp_core_can_edit_settings());
     if (bp_current_user_can('bp_moderate')) {
         $sub_nav[] = array('name' => __('Notices', 'buddypress'), 'slug' => 'notices', 'parent_url' => $messages_link, 'parent_slug' => $this->slug, 'screen_function' => 'messages_screen_notices', 'position' => 90, 'user_has_access' => bp_current_user_can('bp_moderate'));
     }
     parent::setup_nav($main_nav, $sub_nav);
 }
 public function setup_nav($main = array(), $sub = array())
 {
     $bp = buddypress();
     $component = 'members';
     $component_id = mpp_get_current_component_id();
     if (!mpp_is_enabled($component, $component_id)) {
         //allow to disable user galleries in case they don't want it
         return false;
     }
     $view_helper = MPP_Gallery_Screens::get_instance();
     // Add 'Gallery' to the user's main navigation
     $main_nav = array('name' => sprintf(__('Gallery <span>%d</span>', 'mediapress'), mpp_get_total_gallery_for_user()), 'slug' => $this->slug, 'position' => 86, 'screen_function' => array($view_helper, 'user_galleries'), 'default_subnav_slug' => 'my-galleries', 'item_css_id' => $this->id);
     if (bp_is_user()) {
         $user_domain = bp_displayed_user_domain();
     } else {
         $user_domain = bp_loggedin_user_domain();
     }
     $gallery_link = trailingslashit($user_domain . $this->slug);
     //with a trailing slash
     // Add the My Gallery nav item
     $sub_nav[] = array('name' => __('My Gallery', 'mediapress'), 'slug' => 'my-galleries', 'parent_url' => $gallery_link, 'parent_slug' => $this->slug, 'screen_function' => array($view_helper, 'my_galleries'), 'position' => 10, 'item_css_id' => 'gallery-my-gallery');
     if (mpp_user_can_create_gallery($component, get_current_user_id())) {
         // Add the Create gallery link to gallery nav
         $sub_nav[] = array('name' => __('Create a Gallery', 'mediapress'), 'slug' => 'create', 'parent_url' => $gallery_link, 'parent_slug' => $this->slug, 'screen_function' => array($view_helper, 'my_galleries'), 'user_has_access' => bp_is_my_profile(), 'position' => 20);
     }
     if (mpp_component_has_type_filters_enabled($component, $component_id)) {
         $i = 10;
         $supported_types = mpp_component_get_supported_types($component);
         foreach ($supported_types as $type) {
             if (!mpp_is_active_type($type)) {
                 continue;
             }
             $type_object = mpp_get_type_object($type);
             $sub_nav[] = array('name' => $type_object->label, 'slug' => 'type/' . $type, 'parent_url' => $gallery_link, 'parent_slug' => $this->slug, 'screen_function' => array($view_helper, 'my_galleries'), 'position' => 20 + $i);
             $i = $i + 10;
             //increment the position
         }
     }
     // Add the Upload link to gallery nav
     /*$sub_nav[] = array(
           'name'				=> __( 'Upload', 'mediapress'),
           'slug'				=> 'upload',
           'parent_url'		=> $gallery_link,
           'parent_slug'		=> $this->slug,
           'screen_function'	=> array( $view_helper, 'upload_media' ),
           'user_has_access'	=> bp_is_my_profile(),
           'position'			=> 30
       );*/
     parent::setup_nav($main_nav, $sub_nav);
     //disallow these names in various lists
     //we have yet to implement it
     $this->forbidden_names = apply_filters('mpp_forbidden_names', array('gallery', 'galleries', 'my-gallery', 'create', 'delete', 'upload', 'add', 'edit', 'admin', 'request', 'upload', 'tags', 'audio', 'video', 'photo'));
     //use this to extend the valid status
     $this->valid_status = apply_filters('mpp_valid_gallery_status', array_keys(mpp_get_active_statuses()));
     do_action('mpp_setup_nav');
     // $bp->gallery->current_gallery->user_has_access
 }
Beispiel #12
0
function bebop_get_feed_url()
{
    global $this_bp_feed;
    if (!empty($this_bp_feed)) {
        return bp_displayed_user_domain() . bp_get_activity_slug() . '/' . $this_bp_feed;
    } else {
        return false;
    }
}
/**
 * Build two sub menu items, the first is showing by default
 * @author Nacho Abejaro
 */
function bp_profile_submenu_posts()
{
    global $bp;
    $publishCount = get_user_posts_count('publish');
    $pendingCount = get_user_posts_count('pending');
    $draftCount = get_user_posts_count('draft');
    bp_core_new_subnav_item(array('name' => __('Published', 'agora-functions') . '<span>' . $publishCount . '</span>', 'slug' => 'mypublished', 'parent_url' => bp_displayed_user_domain() . $bp->bp_nav['myposts']['slug'] . '/', 'parent_slug' => $bp->bp_nav['myposts']['slug'], 'position' => 10, 'screen_function' => 'mb_author_posts'));
    bp_core_new_subnav_item(array('name' => __('Pending Review', 'agora-functions') . '<span>' . $pendingCount . '</span>', 'slug' => 'myunder-review', 'parent_url' => bp_displayed_user_domain() . $bp->bp_nav['myposts']['slug'] . '/', 'parent_slug' => $bp->bp_nav['myposts']['slug'], 'position' => 20, 'screen_function' => 'mb_author_pending'));
    bp_core_new_subnav_item(array('name' => __('Drafts', 'agora-functions') . '<span>' . $draftCount . '</span>', 'slug' => 'mydrafts', 'parent_url' => bp_displayed_user_domain() . $bp->bp_nav['myposts']['slug'] . '/', 'parent_slug' => $bp->bp_nav['myposts']['slug'], 'position' => 30, 'screen_function' => 'mb_author_drafts'));
}
 /**
  * Set up the navigation.
  *
  * @since 1.0.0
  * @access public
  *
  * @param array $main_nav Optional. See BP_Component::setup_nav().
  * @param array $sub_nav Optional. See BP_Component::setup_nav().
  */
 function setup_nav($main_nav = array(), $sub_nav = array())
 {
     $count = Mute::get_count(bp_displayed_user_id());
     $class = $count === 0 ? 'no-count' : 'count';
     $main_nav = array('name' => sprintf(__('Mute <span class="%s">%s</span>', 'buddypress-mute'), esc_attr($class), number_format_i18n($count)), 'position' => 80, 'default_subnav_slug' => 'all', 'slug' => $this->slug, 'item_css_id' => $this->id, 'show_for_displayed_user' => bp_core_can_edit_settings(), 'screen_function' => 'bp_mute_all_screen');
     $sub_nav[] = array('name' => __('All', 'buddypress-mute'), 'slug' => 'all', 'position' => 10, 'parent_slug' => $this->slug, 'parent_url' => trailingslashit(bp_displayed_user_domain() . $this->slug), 'user_has_access' => bp_core_can_edit_settings(), 'screen_function' => 'bp_mute_all_screen');
     if (bp_is_active('friends')) {
         $sub_nav[] = array('name' => __('Friends', 'buddypress-mute'), 'slug' => 'friends', 'position' => 20, 'parent_slug' => $this->slug, 'parent_url' => trailingslashit(bp_displayed_user_domain() . $this->slug), 'user_has_access' => bp_core_can_edit_settings(), 'screen_function' => 'bp_mute_friends_screen');
     }
     parent::setup_nav($main_nav, $sub_nav);
 }
 /**
  * Set up component navigation, and register display callbacks.
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     // Only grab count if we're on a user page.
     $count = 0;
     if (bp_is_user()) {
         $count = $this->humcore_get_user_deposit_count();
     }
     $class = 0 === $count ? 'no-count' : 'count';
     $nav_name = sprintf(__('Deposits <span class="%s">%s</span>', 'humcore_domain'), esc_attr($class), number_format_i18n($count));
     $main_nav = array('name' => $nav_name, 'slug' => $this->slug, 'position' => 35, 'default_subnav_slug' => 'my-deposits', 'screen_function' => array($this, 'screen_function'));
     /** BuddyPress needs to have at least one subnav item, even if
      * it's redundant
      */
     $sub_nav[] = array('name' => __('Deposits', 'humcore_domain'), 'slug' => 'my-deposits', 'parent_slug' => 'deposits', 'parent_url' => bp_displayed_user_domain() . 'deposits/');
     parent::setup_nav($main_nav, $sub_nav);
 }
/**
 * 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');
    }
}
 /**
  * Create a tab on member profile pages
  */
 public function profile_tab()
 {
     // Determine user to use
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     $parent_url = trailingslashit($user_domain . $this->slug);
     $nav_text = __('Papers', 'social-paper');
     // create primary nav
     bp_core_new_nav_item(array('name' => $nav_text, 'slug' => $this->slug, 'item_css_id' => 'user-papers', 'show_for_displayed_user' => true, 'site_admin_only' => false, 'position' => $this->position, 'screen_function' => 'cacsp_profile_screen', 'default_subnav_slug' => $this->published_slug));
     // create subnav items
     bp_core_new_subnav_item(array('name' => __('Published', 'social-paper'), 'slug' => $this->published_slug, 'parent_url' => $parent_url, 'parent_slug' => $this->slug, 'screen_function' => 'cacsp_profile_screen_published', 'position' => 10));
     bp_core_new_subnav_item(array('name' => __('Drafts', 'social-paper'), 'slug' => $this->drafts_slug, 'parent_url' => $parent_url, 'parent_slug' => $this->slug, 'screen_function' => 'cacsp_profile_screen_draft', 'position' => 10, 'user_has_access' => bp_core_can_edit_settings()));
 }
 function add_profile_cover()
 {
     $output = '';
     if (bp_is_my_profile() || is_super_admin()) {
         if (bpcp_get_image()) {
             $message = __("Change Cover", 'bpcp');
         } else {
             $message = __("Add Cover", 'bpcp');
         }
         $output .= '<div class="profile-cover-action">';
         $output .= '<a href="' . bp_displayed_user_domain() . 'profile/change-cover/" class="button">' . $message . '</a>';
         $output .= '</div>';
     }
     $default_cover = bp_get_option('bpcp-profile-default');
     if (bpcp_get_image() || $default_cover) {
         $output .= '<div class="profile-cover-inner"></div>';
     }
     echo $output;
 }
 /**
  * Set up component navigation.
  *
  * @since BuddyPress (1.5.0)
  *
  * @see BP_Component::setup_nav() for a description of arguments.
  *
  * @param array $main_nav Optional. See BP_Component::setup_nav() for
  *        description.
  * @param array $sub_nav Optional. See BP_Component::setup_nav() for
  *        description.
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     if (bp_displayed_user_id() === 0 || bp_displayed_user_id() === get_current_user_id()) {
         return;
     }
     // Determine user to use
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     }
     $mutual_friends_link = trailingslashit($user_domain . BP_MUTUAL_FRIENDS_SLUG);
     // Add 'Friends' to the main navigation
     // Add 'Friends' to the main navigation
     $count = bp_mutual_friend_total_count();
     $class = 0 === $count ? 'no-count' : 'count';
     $main_nav = array('name' => sprintf(__('Mutual Friends <span class="%s">%s</span>', 'buddypress'), esc_attr($class), bp_core_number_format($count)), 'slug' => BP_MUTUAL_FRIENDS_SLUG, 'position' => 65, 'screen_function' => 'bp_mutual_friends_screen', 'default_subnav_slug' => 'my-mutual-friends', 'item_css_id' => 'members');
     // Add the subnav items to the mutual-friends nav item
     $sub_nav[] = array('name' => _x('Mutual Friends', 'Friends screen sub nav', 'buddypress'), 'slug' => 'my-mutual-friends', 'parent_url' => $mutual_friends_link, 'parent_slug' => BP_MUTUAL_FRIENDS_SLUG, 'screen_function' => 'bp_my_mutual_friends_screen', 'position' => 10);
     parent::setup_nav($main_nav, $sub_nav);
 }
Beispiel #20
0
/**
 * Add the 'pending email change' message to the settings page.
 *
 * @since BuddyPress (2.1.0)
 */
function bp_settings_pending_email_notice()
{
    $pending_email = bp_get_user_meta(bp_displayed_user_id(), 'pending_email_change', true);
    if (empty($pending_email['newemail'])) {
        return;
    }
    if (bp_get_displayed_user_email() == $pending_email['newemail']) {
        return;
    }
    ?>

	<div id="message" class="bp-template-notice error">
		<p><?php 
    printf(__('There is a pending change of your email address to <code>%1$s</code>.<br />Check your email (<code>%2$s</code>) for the verification link. <a href="%3$s">Cancel</a>', 'buddypress'), $pending_email['newemail'], bp_get_displayed_user_email(), esc_url(bp_displayed_user_domain() . bp_get_settings_slug() . '/?dismiss_email_change=1'));
    ?>
</p>
	</div>

	<?php 
}
 /**
  * Setup BuddyBar navigation
  *
  * @global BuddyPress $bp The one true BuddyPress instance
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     global $bp;
     $sub_nav = array();
     // Add 'Friends' to the main navigation
     $main_nav = array('name' => sprintf(__('Friends <span>%d</span>', 'buddypress'), friends_get_total_friend_count()), 'slug' => $this->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends', 'item_css_id' => $bp->friends->id);
     // Determine user to use
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     $friends_link = trailingslashit($user_domain . bp_get_friends_slug());
     // Add the subnav items to the friends nav item
     $sub_nav[] = array('name' => __('Friendships', 'buddypress'), 'slug' => 'my-friends', 'parent_url' => $friends_link, 'parent_slug' => bp_get_friends_slug(), 'screen_function' => 'friends_screen_my_friends', 'position' => 10, 'item_css_id' => 'friends-my-friends');
     $sub_nav[] = array('name' => __('Requests', 'buddypress'), 'slug' => 'requests', 'parent_url' => $friends_link, 'parent_slug' => bp_get_friends_slug(), 'screen_function' => 'friends_screen_requests', 'position' => 20, 'user_has_access' => bp_core_can_edit_settings());
     parent::setup_nav($main_nav, $sub_nav);
 }
function messages_action_bulk_delete()
{
    if (!bp_is_messages_component() || !bp_is_action_variable('bulk-delete', 0)) {
        return false;
    }
    $thread_ids = $_POST['thread_ids'];
    if (!$thread_ids || !messages_check_thread_access($thread_ids)) {
        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;
        }
        if (!messages_delete_thread($thread_ids)) {
            bp_core_add_message(__('There was an error deleting messages.', 'buddypress'), 'error');
        } else {
            bp_core_add_message(__('Messages deleted.', 'buddypress'));
        }
        bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action()));
    }
}
function wpmudev_chat_buddypress_settings_setup_nav()
{
    global $wpmudev_chat;
    $slug_parent = 'settings';
    $slug_page = 'chat';
    // Set thsi so when we get to wp_footer it knows we need to load the JS/CSS for the Friends display.
    $wpmudev_chat->_chat_plugin_settings['blocked_urls']['front'] = false;
    // Determine user to use
    if (bp_displayed_user_domain()) {
        $user_domain = bp_displayed_user_domain();
    } elseif (bp_loggedin_user_domain()) {
        $user_domain = bp_loggedin_user_domain();
    } else {
        return;
    }
    //echo "user_domain=[". $user_domain ."]<br />";
    $settings_link = trailingslashit($user_domain . $slug_parent);
    //echo "settings_link=[". $settings_link ."]<br />";
    $sub_nav = array('name' => __('Chat', $wpmudev_chat->translation_domain), 'slug' => $slug_page, 'parent_url' => $settings_link, 'parent_slug' => $slug_parent, 'screen_function' => 'wpmudev_chat_settings_screen_chat_proc', 'position' => 30, 'user_has_access' => bp_core_can_edit_settings());
    bp_core_new_subnav_item($sub_nav);
}
Beispiel #24
0
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     global $blog_id;
     //check multisite or normal mode for correct permission checking
     if (is_multisite() && $blog_id != BP_ROOT_BLOG) {
         //FIXME MS mode doesn't seem to recognize cross subsite caps, using the proper functions, for now we use switch_blog.
         $current_blog = $blog_id;
         switch_to_blog(BP_ROOT_BLOG);
         $can_manage_events = current_user_can_for_blog(BP_ROOT_BLOG, 'edit_events');
         $can_manage_locations = current_user_can_for_blog(BP_ROOT_BLOG, 'edit_locations');
         $can_manage_bookings = current_user_can_for_blog(BP_ROOT_BLOG, 'manage_bookings');
         switch_to_blog($current_blog);
     } else {
         $can_manage_events = current_user_can('edit_events');
         $can_manage_locations = current_user_can('edit_locations');
         $can_manage_bookings = current_user_can('manage_bookings');
     }
     /* Add 'Events' to the main user profile navigation */
     $main_nav = array('name' => __('Events', 'events-manager'), 'slug' => em_bp_get_slug(), 'position' => 80, 'screen_function' => 'bp_em_events', 'default_subnav_slug' => 'profile');
     $em_link = trailingslashit(bp_displayed_user_domain() . em_bp_get_slug());
     /* Create SubNav Items */
     $sub_nav[] = array('name' => __('My Profile', 'events-manager'), 'slug' => 'profile', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_events', 'position' => 10);
     $sub_nav[] = array('name' => __('Events I\'m Attending', 'events-manager'), 'slug' => 'attending', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_attending', 'position' => 20, 'user_has_access' => bp_is_my_profile());
     if ($can_manage_events) {
         $sub_nav[] = array('name' => __('My Events', 'events-manager'), 'slug' => 'my-events', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_my_events', 'position' => 30, 'user_has_access' => bp_is_my_profile());
     }
     if ($can_manage_locations && get_option('dbem_locations_enabled')) {
         $sub_nav[] = array('name' => __('My Locations', 'events-manager'), 'slug' => 'my-locations', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_my_locations', 'position' => 40, 'user_has_access' => bp_is_my_profile());
     }
     if ($can_manage_bookings && get_option('dbem_rsvp_enabled')) {
         $sub_nav[] = array('name' => __('My Event Bookings', 'events-manager'), 'slug' => 'my-bookings', 'parent_slug' => em_bp_get_slug(), 'parent_url' => $em_link, 'screen_function' => 'bp_em_my_bookings', 'position' => 50, 'user_has_access' => bp_is_my_profile());
     }
     if (bp_is_active('groups')) {
         /* Create Profile Group Sub-Nav */
         $sub_nav[] = array('name' => __('Events', 'events-manager'), 'slug' => 'group-events', 'parent_slug' => bp_get_groups_slug(), 'parent_url' => trailingslashit(bp_displayed_user_domain() . bp_get_groups_slug()), 'screen_function' => 'bp_em_my_group_events', 'position' => 60, 'user_has_access' => bp_is_my_profile());
     }
     parent::setup_nav($main_nav, $sub_nav);
     add_action('bp_init', array(&$this, 'setup_group_nav'));
 }
 function setup_nav($main_nav = array(), $sub_nav = array())
 {
     $directWorkflow = isDirectWorkflow();
     $main_nav = array('name' => __('My articles', 'social-articles'), 'slug' => SA_SLUG, 'position' => 100, 'screen_function' => 'social_articles_screen', 'default_subnav_slug' => 'articles');
     $user_domain = bp_is_user() ? bp_displayed_user_domain() : bp_loggedin_user_domain();
     $social_articles_link = trailingslashit($user_domain . SA_SLUG);
     $user_id = bp_is_user() ? bp_displayed_user_id() : bp_loggedin_user_id();
     if (bp_displayed_user_id() == bp_loggedin_user_id()) {
         $publishCount = custom_get_user_posts_count('publish');
         $pendingCount = custom_get_user_posts_count('pending');
         $draftCount = custom_get_user_posts_count('draft');
         $sub_nav[] = array('name' => sprintf(__("Published", "social-articles") . '<span>%d</span>', $publishCount), 'slug' => 'articles', 'parent_url' => $social_articles_link, 'parent_slug' => SA_SLUG, 'screen_function' => 'my_articles_screen', 'position' => 10);
         if (!$directWorkflow) {
             $sub_nav[] = array('name' => sprintf(__("Under Review", "social-articles") . '<span>%d</span>', $pendingCount), 'slug' => 'under-review', 'parent_url' => $social_articles_link, 'parent_slug' => SA_SLUG, 'screen_function' => 'pending_articles_screen', 'position' => 20);
         }
         $sub_nav[] = array('name' => sprintf(__("Draft", "social-articles") . '<span>%d</span>', $draftCount), 'slug' => 'draft', 'parent_url' => $social_articles_link, 'parent_slug' => SA_SLUG, 'screen_function' => 'draft_articles_screen', 'position' => 30);
         $sub_nav[] = array('name' => __('New article', 'social-articles'), 'slug' => 'new', 'parent_url' => $social_articles_link, 'parent_slug' => SA_SLUG, 'screen_function' => 'new_article_screen', 'position' => 40);
     }
     if ($this->check_visibility()) {
         parent::setup_nav($main_nav, $sub_nav);
     }
 }
 /**
  * Set up component navigation.
  *
  * @since BuddyPress (1.5.0)
  *
  * @see BP_Component::setup_nav() for a description of arguments.
  *
  * @param array $main_nav Optional. See BP_Component::setup_nav() for
  *                        description.
  * @param array $sub_nav  Optional. See BP_Component::setup_nav() for
  *                        description.
  */
 public function setup_nav($main_nav = array(), $sub_nav = array())
 {
     // Determine user to use
     if (bp_displayed_user_domain()) {
         $user_domain = bp_displayed_user_domain();
     } elseif (bp_loggedin_user_domain()) {
         $user_domain = bp_loggedin_user_domain();
     } else {
         return;
     }
     $access = bp_core_can_edit_settings();
     $slug = bp_get_friends_slug();
     $friends_link = trailingslashit($user_domain . $slug);
     // Add 'Friends' to the main navigation
     $count = friends_get_total_friend_count();
     $class = 0 === $count ? 'no-count' : 'count';
     $main_nav = array('name' => sprintf(__('Friends <span class="%s">%s</span>', 'buddypress'), esc_attr($class), bp_core_number_format($count)), 'slug' => $slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends', 'item_css_id' => $this->id);
     // Add the subnav items to the friends nav item
     $sub_nav[] = array('name' => _x('Friendships', 'Friends screen sub nav', 'buddypress'), 'slug' => 'my-friends', 'parent_url' => $friends_link, 'parent_slug' => $slug, 'screen_function' => 'friends_screen_my_friends', 'position' => 10, 'item_css_id' => 'friends-my-friends');
     $sub_nav[] = array('name' => _x('Requests', 'Friends screen sub nav', 'buddypress'), 'slug' => 'requests', 'parent_url' => $friends_link, 'parent_slug' => $slug, 'screen_function' => 'friends_screen_requests', 'position' => 20, 'user_has_access' => $access);
     parent::setup_nav($main_nav, $sub_nav);
 }
/**
 * 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());
        }
    }
}
/**
 * Handles the setting of user capabilities, spamming, hamming, role, etc...
 */
function bp_settings_action_capabilities()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Bail if no submit action
    if (!isset($_POST['capabilities-submit'])) {
        return;
    }
    // Bail if not in settings
    if (!bp_is_settings_component() || !bp_is_current_action('capabilities')) {
        return false;
    }
    // 404 if there are any additional action variables attached
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    // Only super admins can currently spam users (but they can't spam
    // themselves)
    if (!is_super_admin() || bp_is_my_profile()) {
        return;
    }
    // Nonce check
    check_admin_referer('capabilities');
    do_action('bp_settings_capabilities_before_save');
    /** Spam **************************************************************/
    $is_spammer = !empty($_POST['user-spammer']) ? true : false;
    if (bp_is_user_spammer(bp_displayed_user_id()) != $is_spammer) {
        $status = true == $is_spammer ? 'spam' : 'ham';
        bp_core_process_spammer_status(bp_displayed_user_id(), $status);
        do_action('bp_core_action_set_spammer_status', bp_displayed_user_id(), $status);
    }
    /** Other *************************************************************/
    do_action('bp_settings_capabilities_after_save');
    // Redirect to the root domain
    bp_core_redirect(bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/');
}
/**
 * Display a Friends search form.
 *
 * No longer used in BuddyPress.
 *
 * @todo Deprecate
 */
function bp_friend_search_form()
{
    $action = bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/search/';
    $label = __('Filter Friends', 'buddypress');
    ?>

		<form action="<?php 
    echo $action;
    ?>
" id="friend-search-form" method="post">

			<label for="friend-search-box" id="friend-search-label"><?php 
    echo $label;
    ?>
</label>
			<input type="search" name="friend-search-box" id="friend-search-box" value="<?php 
    echo $value;
    ?>
"<?php 
    echo $disabled;
    ?>
 />

			<?php 
    wp_nonce_field('friends_search', '_wpnonce_friend_search');
    ?>

			<input type="hidden" name="initiator" id="initiator" value="<?php 
    echo esc_attr(bp_displayed_user_id());
    ?>
" />

		</form>

	<?php 
}
/**
 * Displays group header tabs
 *
 * @package BuddyPress
 * @todo Deprecate?
 */
function bp_groups_header_tabs()
{
    global $bp;
    ?>

	<li<?php 
    if (!bp_action_variable(0) || bp_is_action_variable('recently-active', 0)) {
        ?>
 class="current"<?php 
    }
    ?>
><a href="<?php 
    echo trailingslashit(bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/recently-active');
    ?>
"><?php 
    _e('Recently Active', 'buddypress');
    ?>
</a></li>
	<li<?php 
    if (bp_is_action_variable('recently-joined', 0)) {
        ?>
 class="current"<?php 
    }
    ?>
><a href="<?php 
    echo trailingslashit(bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/recently-joined');
    ?>
"><?php 
    _e('Recently Joined', 'buddypress');
    ?>
</a></li>
	<li<?php 
    if (bp_is_action_variable('most-popular', 0)) {
        ?>
 class="current"<?php 
    }
    ?>
><a href="<?php 
    echo trailingslashit(bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/most-popular');
    ?>
"><?php 
    _e('Most Popular', 'buddypress');
    ?>
</a></li>
	<li<?php 
    if (bp_is_action_variable('admin-of', 0)) {
        ?>
 class="current"<?php 
    }
    ?>
><a href="<?php 
    echo trailingslashit(bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/admin-of');
    ?>
"><?php 
    _e('Administrator Of', 'buddypress');
    ?>
</a></li>
	<li<?php 
    if (bp_is_action_variable('mod-of', 0)) {
        ?>
 class="current"<?php 
    }
    ?>
><a href="<?php 
    echo trailingslashit(bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/mod-of');
    ?>
"><?php 
    _e('Moderator Of', 'buddypress');
    ?>
</a></li>
	<li<?php 
    if (bp_is_action_variable('alphabetically')) {
        ?>
 class="current"<?php 
    }
    ?>
><a href="<?php 
    echo trailingslashit(bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/alphabetically');
    ?>
"><?php 
    _e('Alphabetically', 'buddypress');
    ?>
</a></li>

<?php 
    do_action('groups_header_tabs');
}