Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/09/2008 06:52:13 PM (17 years ago)
Author:
apeatling
Message:

Added complete support for existing blog networks. Please see mailing list for complete overview on the new "home base" features.

File:
1 edited

Legend:

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

    r304 r309  
    7676    $action_variables = array_merge( array(), $action_variables );
    7777
    78     /* catch 'blog' */
    79     if ( $current_component == 'blog' )
    80         bp_catch_uri( 'blog' );
    8178}
    8279add_action( 'wp', 'bp_core_set_uri_globals', 0 );
     
    110107 */
    111108function bp_core_do_catch_uri() {
    112     global $bp_path;
     109    global $bp_path, $bp, $wpdb;
    113110
    114111    $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.');
    115116
    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" );
    120131            }
    121132        }
    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;
    128137    }
    129138}
Note: See TracChangeset for help on using the changeset viewer.