Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/06/2009 03:07:48 AM (17 years ago)
Author:
apeatling
Message:

Converted $bp as an array to $bp as an object. See this post for more info: http://buddypress.org/forums/topic.php?id=1125

File:
1 edited

Legend:

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

    r1017 r1021  
    1515 *
    1616 * The URI's are broken down as follows:
    17  *   - http:// example.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
    18  *   - OUTSIDE ROOT: http:// example.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
     17 *   - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
     18 *   - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
    1919 *
    2020 *      Example:
    21  *    - http://example.com/members/andy/profile/edit/group/5/
     21 *    - http://domain.com/members/andy/profile/edit/group/5/
    2222 *    - $current_component: string 'profile'
    2323 *    - $current_action: string 'edit'
     
    2828function bp_core_set_uri_globals() {
    2929        global $current_component, $current_action, $action_variables;
    30         global $current_userid;
     30        global $displayed_user_id;
    3131        global $is_member_page, $is_new_friend;
    3232        global $bp_unfiltered_uri;
     
    8585
    8686        /* Catch a member page and set the current member ID */
    87         if ( $bp_uri[0] == MEMBERS_SLUG && $bp_uri[1] != '' ) {
     87        if ( $bp_uri[0] == MEMBERS_SLUG && !empty( $bp_uri[1] ) ) {
    8888                $is_member_page = true;
    8989                $is_root_component = true;
    9090               
    9191                // We are within a member page, set up user id globals
    92                 $current_userid = bp_core_get_current_userid( $bp_uri[1] );
     92                $displayed_user_id = bp_core_get_displayed_userid( $bp_uri[1] );
    9393                               
    9494                unset($bp_uri[0]);
     
    105105                $bp_uri = array_merge( array(), $bp_uri );
    106106        }
    107        
     107
    108108        /* This is used to determine where the component and action indexes should start */
    109         $root_components = $bp['root_components'];
     109        $root_components = $bp->root_components;
    110110       
    111111        if ( !isset($is_root_component) )
     
    160160
    161161        $bp_path = $pages;
    162        
     162
    163163        if ( !bp_is_blog_page() )
    164164                remove_action( 'template_redirect', 'redirect_canonical' );
     
    227227               
    228228        // If this user does not exist, redirect to the root domain.
    229         if ( !$bp['current_userid'] && $bp_unfiltered_uri[0] == MEMBERS_SLUG && isset($bp_unfiltered_uri[1]) )
    230                 bp_core_redirect( $bp['root_domain'] );
     229        if ( !$bp->displayed_user->id && $bp_unfiltered_uri[0] == MEMBERS_SLUG && isset($bp_unfiltered_uri[1]) )
     230                bp_core_redirect( $bp->root_domain );
    231231
    232232        if ( !$bp_path && !bp_is_blog_page() ) {
    233233                if ( is_user_logged_in() ) {
    234                         wp_redirect( $bp['loggedin_domain'] );
     234                        wp_redirect( $bp->loggedin_user->domain );
    235235                } else {
    236236                        wp_redirect( site_url( 'wp-login.php?redirect_to=' . site_url() . $_SERVER['REQUEST_URI'] ) );
     
    264264        $member_theme = get_site_option('active-member-theme');
    265265       
    266         if ( $member_theme == '' )
     266        if ( empty( $member_theme ) )
    267267                $member_theme = 'buddypress-member';
    268268       
     
    283283        $member_theme = get_site_option('active-member-theme');
    284284       
    285         if ( $member_theme == '' )
     285        if ( empty( $member_theme ) )
    286286                $member_theme = 'buddypress-member';
    287287
     
    297297add_filter( 'stylesheet', 'bp_core_force_buddypress_stylesheet', 1, 1 );
    298298
    299 
    300 
    301299?>
Note: See TracChangeset for help on using the changeset viewer.