Changeset 1250 for trunk/bp-core/bp-core-catchuri.php
- Timestamp:
- 03/25/2009 04:01:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-catchuri.php
r1226 r1250 33 33 global $bp; 34 34 35 $path = apply_filters( 'bp_uri', $_SERVER['REQUEST_URI'] ); 36 35 if ( strpos( $_SERVER['REQUEST_URI'], 'bp-core-ajax-handler.php' ) ) 36 $path = bp_core_referrer(); 37 else 38 $path = clean_url( $_SERVER['REQUEST_URI'] ); 39 40 $path = apply_filters( 'bp_uri', $path ); 41 37 42 // Firstly, take GET variables off the URL to avoid problems, 38 43 // they are still registered in the global $_GET variable */ … … 79 84 } 80 85 } 81 86 82 87 /* Reset the keys by merging with an empty array */ 83 88 $bp_uri = array_merge( array(), $bp_uri ); 84 89 $bp_unfiltered_uri = $bp_uri; 85 90 86 91 /* Catch a member page and set the current member ID */ 87 if ( $bp_uri[0] == MEMBERS_SLUG && !empty( $bp_uri[1]) ) {92 if ( $bp_uri[0] == MEMBERS_SLUG || in_array( 'bp-core-ajax-handler.php', $bp_uri ) ) { 88 93 $is_member_page = true; 89 94 $is_root_component = true; … … 106 111 } 107 112 108 /* This is used to determine where the component and action indexes should start */109 $root_components = $bp->root_components;110 111 113 if ( !isset($is_root_component) ) 112 $is_root_component = in_array( $bp_uri[0], $ root_components );114 $is_root_component = in_array( $bp_uri[0], $bp->root_components ); 113 115 114 116 if ( 'no' == VHOST && !$is_root_component ) { … … 139 141 //var_dump($current_component, $current_action, $action_variables); 140 142 } 141 add_action( ' wp', 'bp_core_set_uri_globals', 1);143 add_action( 'plugins_loaded', 'bp_core_set_uri_globals', 3 ); 142 144 143 145 /** … … 254 256 255 257 function bp_core_force_buddypress_theme( $template ) { 256 global $current_component, $current_action; 257 global $is_member_page; 258 259 // The theme filter does not recognize any globals, where as the stylesheet filter does. 260 // We have to set up the globals to use manually. 261 bp_core_set_uri_globals(); 262 263 $member_theme = get_site_option('active-member-theme'); 258 global $is_member_page, $bp; 259 260 $member_theme = get_site_option( 'active-member-theme' ); 264 261 265 262 if ( empty( $member_theme ) ) 266 263 $member_theme = 'buddypress-member'; 267 264 265 if ( $is_member_page ) { 266 267 add_filter( 'theme_root', 'bp_core_set_member_theme_root' ); 268 add_filter( 'theme_root_uri', 'bp_core_set_member_theme_root_uri' ); 269 270 return $member_theme; 271 } else { 272 return $template; 273 } 274 } 275 add_filter( 'template', 'bp_core_force_buddypress_theme', 1, 1 ); 276 277 function bp_core_force_buddypress_stylesheet( $stylesheet ) { 278 global $is_member_page; 279 280 $member_theme = get_site_option( 'active-member-theme' ); 281 282 if ( empty( $member_theme ) ) 283 $member_theme = 'buddypress-member'; 284 268 285 if ( $is_member_page ) { 269 286 add_filter( 'theme_root', 'bp_core_set_member_theme_root' ); … … 272 289 return $member_theme; 273 290 } else { 274 return $template;275 }276 }277 add_filter( 'template', 'bp_core_force_buddypress_theme', 1, 1 );278 279 function bp_core_force_buddypress_stylesheet( $stylesheet ) {280 global $bp, $is_member_page;281 282 $member_theme = get_site_option('active-member-theme');283 284 if ( empty( $member_theme ) )285 $member_theme = 'buddypress-member';286 287 if ( $is_member_page ) {288 add_filter( 'theme_root', 'bp_core_set_member_theme_root' );289 add_filter( 'theme_root_uri', 'bp_core_set_member_theme_root_uri' );290 291 return $member_theme;292 } else {293 291 return $stylesheet; 294 292 }
Note: See TracChangeset
for help on using the changeset viewer.