Skip to:
Content

BuddyPress.org

Ticket #2600: 2600-1.patch

File 2600-1.patch, 3.7 KB (added by boonebgorges, 13 years ago)
  • bp-core/bp-core-templatetags.php

     
    17411741function bp_is_user_groups() {
    17421742        global $bp;
    17431743
    1744         if ( $bp->groups->slug == $bp->current_component )
     1744        if ( $bp->groups->mid_slug == $bp->current_component )
    17451745                return true;
    17461746
    17471747        return false;
  • bp-core/bp-core-catchuri.php

     
    139139
    140140                unset( $uri_chunks );
    141141        }
    142        
     142
    143143        // Search doesn't have an associated page, so we check for it separately
    144144        if ( !empty( $bp_uri[0] ) && BP_SEARCH_SLUG == $bp_uri[0] )
    145145                $matches[] = 1;
  • bp-groups.php

     
    99
    1010        if ( !defined( 'BP_GROUPS_SLUG' ) )
    1111                define ( 'BP_GROUPS_SLUG', $bp->pages->groups->slug );
     12       
     13        if ( !defined( 'BP_GROUPS_MID_SLUG' ) ) {
     14                if ( strpos( BP_GROUPS_SLUG, '/' ) ) {
     15                        define( 'BP_GROUPS_MID_SLUG', 'groups' );
     16                } else {
     17                        define( 'BP_GROUPS_MID_SLUG', BP_GROUPS_SLUG );
     18                }
     19        }
    1220
    1321        /* For internal identification */
    1422        $bp->groups->id = 'groups';
    1523        $bp->groups->name = $bp->pages->groups->name;
    1624        $bp->groups->slug = BP_GROUPS_SLUG;
     25        $bp->groups->mid_slug = BP_GROUPS_MID_SLUG;
    1726
    1827        $bp->groups->table_name           = $bp->table_prefix . 'bp_groups';
    1928        $bp->groups->table_name_members   = $bp->table_prefix . 'bp_groups_members';
     
    7180        }
    7281
    7382        /* Add 'Groups' to the main navigation */
    74         bp_core_new_nav_item( array( 'name' => sprintf( __( 'Groups <span>(%d)</span>', 'buddypress' ), groups_total_groups_for_user() ), 'slug' => $bp->groups->name, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups', 'item_css_id' => $bp->groups->id ) );
     83        bp_core_new_nav_item( array( 'name' => sprintf( __( 'Groups <span>(%d)</span>', 'buddypress' ), groups_total_groups_for_user() ), 'slug' => $bp->groups->mid_slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups', 'item_css_id' => $bp->groups->id ) );
    7584
    76         $groups_link = $bp->loggedin_user->domain . $bp->groups->name . '/';
     85        $groups_link = $bp->loggedin_user->domain . $bp->groups->mid_slug . '/';
    7786
    7887        /* Add the subnav items to the groups nav item */
    79         bp_core_new_subnav_item( array( 'name' => __( 'My Groups', 'buddypress' ), 'slug' => 'my-groups', 'parent_url' => $groups_link, 'parent_slug' => $bp->groups->name, 'screen_function' => 'groups_screen_my_groups', 'position' => 10, 'item_css_id' => 'groups-my-groups' ) );
    80         bp_core_new_subnav_item( array( 'name' => __( 'Invites', 'buddypress' ), 'slug' => 'invites', 'parent_url' => $groups_link, 'parent_slug' => $bp->groups->name, 'screen_function' => 'groups_screen_group_invites', 'position' => 30, 'user_has_access' => bp_is_my_profile() ) );
     88        bp_core_new_subnav_item( array( 'name' => __( 'My Groups', 'buddypress' ), 'slug' => 'my-groups', 'parent_url' => $groups_link, 'parent_slug' => $bp->groups->mid_slug, 'screen_function' => 'groups_screen_my_groups', 'position' => 10, 'item_css_id' => 'groups-my-groups' ) );
     89        bp_core_new_subnav_item( array( 'name' => __( 'Invites', 'buddypress' ), 'slug' => 'invites', 'parent_url' => $groups_link, 'parent_slug' => $bp->groups->mid_slug, 'screen_function' => 'groups_screen_group_invites', 'position' => 30, 'user_has_access' => bp_is_my_profile() ) );
    8190
    8291        if ( $bp->current_component == $bp->groups->slug ) {
    8392