Changeset 1021 for trunk/bp-core/bp-core-catchuri.php
- Timestamp:
- 02/06/2009 03:07:48 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-catchuri.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-catchuri.php
r1017 r1021 15 15 * 16 16 * 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] / ... 19 19 * 20 20 * Example: 21 * - http:// example.com/members/andy/profile/edit/group/5/21 * - http://domain.com/members/andy/profile/edit/group/5/ 22 22 * - $current_component: string 'profile' 23 23 * - $current_action: string 'edit' … … 28 28 function bp_core_set_uri_globals() { 29 29 global $current_component, $current_action, $action_variables; 30 global $ current_userid;30 global $displayed_user_id; 31 31 global $is_member_page, $is_new_friend; 32 32 global $bp_unfiltered_uri; … … 85 85 86 86 /* 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] ) ) { 88 88 $is_member_page = true; 89 89 $is_root_component = true; 90 90 91 91 // 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] ); 93 93 94 94 unset($bp_uri[0]); … … 105 105 $bp_uri = array_merge( array(), $bp_uri ); 106 106 } 107 107 108 108 /* 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; 110 110 111 111 if ( !isset($is_root_component) ) … … 160 160 161 161 $bp_path = $pages; 162 162 163 163 if ( !bp_is_blog_page() ) 164 164 remove_action( 'template_redirect', 'redirect_canonical' ); … … 227 227 228 228 // 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 ); 231 231 232 232 if ( !$bp_path && !bp_is_blog_page() ) { 233 233 if ( is_user_logged_in() ) { 234 wp_redirect( $bp ['loggedin_domain']);234 wp_redirect( $bp->loggedin_user->domain ); 235 235 } else { 236 236 wp_redirect( site_url( 'wp-login.php?redirect_to=' . site_url() . $_SERVER['REQUEST_URI'] ) ); … … 264 264 $member_theme = get_site_option('active-member-theme'); 265 265 266 if ( $member_theme == '')266 if ( empty( $member_theme ) ) 267 267 $member_theme = 'buddypress-member'; 268 268 … … 283 283 $member_theme = get_site_option('active-member-theme'); 284 284 285 if ( $member_theme == '')285 if ( empty( $member_theme ) ) 286 286 $member_theme = 'buddypress-member'; 287 287 … … 297 297 add_filter( 'stylesheet', 'bp_core_force_buddypress_stylesheet', 1, 1 ); 298 298 299 300 301 299 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)