Skip to:
Content

BuddyPress.org

Ticket #627: patch.patch

File patch.patch, 2.1 KB (added by GIGALinux, 16 years ago)
  • bp-core.php

     
    1616/* Place your custom code (actions/filters) in a file called bp-custom.php and it will be loaded before anything else. */
    1717if ( file_exists( WPMU_PLUGIN_DIR . '/bp-custom.php' ) )
    1818        require( WPMU_PLUGIN_DIR . '/bp-custom.php' );
     19       
     20/* On which blog BuddyPress runs */
     21define( 'BP_ROOT_BLOG', apply_filters( 'bp_root_blog', 3 ) );
    1922
    2023/* Load the language file */
    2124if ( file_exists( WPMU_PLUGIN_DIR . '/bp-languages/buddypress-' . get_locale() . '.mo' ) )
     
    7376        global $action_variables;
    7477       
    7578        $current_user = wp_get_current_user();
     79       
     80        /* The blog id of the BuddyPress installation */
     81        $bp->root_id = BP_ROOT_BLOG;
    7682
    7783        /* The domain for the root of the site where the main blog resides */   
    7884        $bp->root_domain = bp_core_get_root_domain();
     
    356362 * @return $domain The domain URL for the blog.
    357363 */
    358364function bp_core_get_root_domain() {
    359         switch_to_blog(1);
     365        switch_to_blog(BP_ROOT_BLOG);
    360366        $domain = site_url();
    361367        restore_current_blog();
    362368       
     
    658664        global $userdata;
    659665       
    660666        if ( $uid == $userdata->ID )
    661                 return 'You';
     667                return __( 'You', 'buddypress' );
    662668       
    663669        if ( !$ud = get_userdata($uid) )
    664670                return false;
     
    10891095 * @uses bp_core_get_userlink_by_email() Fetches a userlink via email address.
    10901096 */
    10911097function bp_core_get_site_path() {
    1092         global $wpdb;
     1098        global $current_site;
    10931099       
    1094         return $wpdb->get_var( $wpdb->prepare( "SELECT path FROM {$wpdb->base_prefix}site WHERE id = 1") );
     1100        return $current_site->path;
    10951101}
    10961102
    10971103function bp_core_redirect( $location, $status = 302 ) {
  • bp-core/bp-core-catchuri.php

     
    3333        global $bp, $current_blog;
    3434       
    3535        /* Only catch URI's on the root blog */
    36         if ( 1 != (int) $current_blog->blog_id )
     36        if ( BP_ROOT_BLOG != (int) $current_blog->blog_id )
    3737                return false;
    3838       
    3939        if ( strpos( $_SERVER['REQUEST_URI'], 'bp-core-ajax-handler.php' ) )