Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/31/2009 05:51:29 PM (17 years ago)
Author:
apeatling
Message:

Enabled support for users to appear in the root by defining 'BP_ENABLE_ROOT_PROFILES' as true in your wp-config.php file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-catchuri.php

    r1723 r1739  
    2929    global $current_component, $current_action, $action_variables;
    3030    global $displayed_user_id;
    31     global $is_member_page, $is_new_friend;
     31    global $is_member_page;
    3232    global $bp_unfiltered_uri;
    3333    global $bp, $current_blog;
     
    9999
    100100    /* Catch a member page and set the current member ID */
    101     if ( $bp_uri[0] == BP_MEMBERS_SLUG || in_array( 'wp-load.php', $bp_uri ) ) {
    102         $is_member_page = true;
    103         $is_root_component = true;
    104 
    105         // We are within a member page, set up user id globals
    106         $displayed_user_id = bp_core_get_displayed_userid( $bp_uri[1] );
     101    if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) ) {
     102        if ( $bp_uri[0] == BP_MEMBERS_SLUG || in_array( 'wp-load.php', $bp_uri ) ) {
     103            $is_member_page = true;
     104            $is_root_component = true;
     105
     106            // We are within a member page, set up user id globals
     107            $displayed_user_id = bp_core_get_displayed_userid( $bp_uri[1] );
    107108               
    108         unset($bp_uri[0]);
    109         unset($bp_uri[1]);
     109            unset($bp_uri[0]);
     110            unset($bp_uri[1]);
    110111       
    111         // if the get variable 'new' is set this the first visit to a new friends profile.
    112         // this means we need to delete friend acceptance notifications, so we set a flag of is_new_friend.
    113         if ( isset($_GET['new']) ) {
    114             $is_new_friend = 1;
    115             unset($bp_uri[2]);
    116         }
    117        
    118         /* Reset the keys by merging with an empty array */
    119         $bp_uri = array_merge( array(), $bp_uri );
    120     }
    121 
     112            /* Reset the keys by merging with an empty array */
     113            $bp_uri = array_merge( array(), $bp_uri );
     114        }
     115    } else {
     116        if ( get_userdatabylogin( $bp_uri[0] ) || in_array( 'wp-load.php', $bp_uri ) ) {
     117            $is_member_page = true;
     118            $is_root_component = true;
     119
     120            // We are within a member page, set up user id globals
     121            $displayed_user_id = bp_core_get_displayed_userid( $bp_uri[0] );
     122               
     123            unset($bp_uri[0]);
     124
     125            /* Reset the keys by merging with an empty array */
     126            $bp_uri = array_merge( array(), $bp_uri );
     127        }
     128    }
     129   
    122130    if ( !isset($is_root_component) )
    123131        $is_root_component = in_array( $bp_uri[0], $bp->root_components );
     
    193201   
    194202    $page = $bp_path;
    195 
     203   
    196204    /* Don't hijack any URLs on blog pages */
    197205    if ( !$bp_skip_blog_check ) {
     
    199207            return false;
    200208    }
    201    
     209
    202210    /* Make sure this is not reported as a 404 */
    203211    if ( !$bp_no_status_set ) {
     
    208216            $wp_query->is_page = true;
    209217    }
     218
    210219
    211220    if ( $located_template = locate_template( array( $page . '.php' ) ) ) {
Note: See TracChangeset for help on using the changeset viewer.