Changeset 309 for trunk/bp-core/bp-core-catchuri.php
- Timestamp:
- 09/09/2008 06:52:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-catchuri.php
r304 r309 76 76 $action_variables = array_merge( array(), $action_variables ); 77 77 78 /* catch 'blog' */79 if ( $current_component == 'blog' )80 bp_catch_uri( 'blog' );81 78 } 82 79 add_action( 'wp', 'bp_core_set_uri_globals', 0 ); … … 110 107 */ 111 108 function bp_core_do_catch_uri() { 112 global $bp_path ;109 global $bp_path, $bp, $wpdb; 113 110 114 111 $pages = $bp_path; 112 113 if ( $wpdb->blogid == get_usermeta( $bp['current_userid'], 'home_base' ) ) { 114 if ( !file_exists( TEMPLATEPATH . "/header.php" ) || !file_exists( TEMPLATEPATH . "/footer.php" ) ) 115 wp_die( 'Please make sure your BuddyPress enabled theme includes a header.php and footer.php file.'); 115 116 116 if ( is_array( $pages ) ) { 117 foreach( $pages as $page ) { 118 if ( file_exists( TEMPLATEPATH . "/" . $page . ".php" ) ) { 119 require( TEMPLATEPATH . "/" . $page . ".php" ); die; 117 do_action( 'get_header' ); 118 load_template( TEMPLATEPATH . "/header.php" ); 119 120 if ( is_array( $pages ) ) { 121 foreach( $pages as $page ) { 122 if ( file_exists( TEMPLATEPATH . "/" . $page . ".php" ) ) { 123 load_template( TEMPLATEPATH . "/" . $page . ".php" ); 124 } 125 } 126 } else { 127 if ( file_exists( TEMPLATEPATH . "/" . $pages . ".php" ) ) { 128 load_template( TEMPLATEPATH . "/" . $pages . ".php" ); 129 } else { 130 load_template( TEMPLATEPATH . "/index.php" ); 120 131 } 121 132 } 122 } else { 123 if ( file_exists( TEMPLATEPATH . "/" . $pages . ".php" ) ) { 124 require( TEMPLATEPATH . "/" . $pages . ".php" ); die; 125 } else { 126 require( TEMPLATEPATH . "/index.php" ); die; 127 } 133 134 do_action( 'get_footer' ); 135 load_template( TEMPLATEPATH . "/footer.php" ); 136 die; 128 137 } 129 138 }
Note: See TracChangeset
for help on using the changeset viewer.