Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/10/2011 06:32:02 AM (14 years ago)
Author:
djpaul
Message:

Tidy up whitespace. Fixes #3466, props cnorris23

File:
1 edited

Legend:

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

    r4933 r4961  
    130130function bp_core_get_directory_pages() {
    131131    global $wpdb, $bp;
    132    
     132
    133133    // Set pages as standard class
    134134    $pages = new stdClass;
     
    979979function bp_core_get_root_options() {
    980980    global $wpdb;
    981    
     981
    982982    // These options come from the root blog options table
    983983    $root_blog_options = apply_filters( 'bp_core_site_options', array(
    984    
     984
    985985    // BuddyPress core settings
    986986    'bp-deactivated-components'       => serialize( array( ) ),
     
    995995    'bb-config-location'              => ABSPATH,
    996996    'hide-loggedout-adminbar'         => '0',
    997    
     997
    998998    // Useful WordPress settings
    999999    'registration'                    => '0',
    10001000    'avatar_default'                  => 'mysteryman'
    10011001    ) );
    1002    
     1002
    10031003    $root_blog_option_keys  = array_keys( $root_blog_options );
    10041004    $blog_options_keys      = implode( "', '", (array) $root_blog_option_keys );
    10051005    $blog_options_query     = sprintf( "SELECT option_name AS name, option_value AS value FROM {$wpdb->options} WHERE option_name IN ('%s')", $blog_options_keys );
    10061006    $root_blog_options_meta = $wpdb->get_results( $blog_options_query );
    1007    
     1007
    10081008    // On Multisite installations, some options must always be fetched from sitemeta
    10091009    if ( is_multisite() ) {
     
    10131013            'fileupload_maxk' => '1500'
    10141014        ) );
    1015        
     1015
    10161016        $network_option_keys    = array_keys( $network_options );
    10171017        $sitemeta_options_keys  = implode( "','", (array) $network_option_keys );
    10181018        $sitemeta_options_query = sprintf( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ('%s')", $sitemeta_options_keys );
    10191019        $network_options_meta   = $wpdb->get_results( $sitemeta_options_query );
    1020        
     1020
    10211021        // Sitemeta comes second in the merge, so that network 'registration' value wins
    10221022        $root_blog_options_meta = array_merge( $root_blog_options_meta, $network_options_meta );
    10231023    }
    1024    
     1024
    10251025    // Missing some options, so do some one-time fixing
    10261026    if ( empty( $root_blog_options_meta ) || ( count( $root_blog_options_meta ) < count( $root_blog_option_keys ) ) ) {
    1027    
     1027
    10281028    // Unset the query - We'll be resetting it soon
    10291029    unset( $root_blog_options_meta );
    1030    
     1030
    10311031    // Loop through options
    10321032    foreach ( $root_blog_options as $old_meta_key => $old_meta_default ) {
    10331033        // Clear out the value from the last time around
    10341034        unset( $old_meta_value );
    1035        
     1035
    10361036        // Get old site option
    10371037        if ( is_multisite() )
    10381038            $old_meta_value = get_site_option( $old_meta_key );
    1039        
     1039
    10401040        // No site option so look in root blog
    10411041        if ( empty( $old_meta_value ) )
    10421042            $old_meta_value = bp_get_option( $old_meta_key, $old_meta_default );
    1043        
     1043
    10441044        // Update the root blog option
    10451045        bp_update_option( $old_meta_key, $old_meta_value );
    1046        
     1046
    10471047        // Update the global array
    10481048        $root_blog_options_meta[$old_meta_key] = $old_meta_value;
    10491049    }
    1050    
     1050
    10511051    // We're all matched up
    10521052    } else {
     
    10541054        foreach ( $root_blog_options_meta as $root_blog_option )
    10551055            $root_blog_options[$root_blog_option->name] = $root_blog_option->value;
    1056        
     1056
    10571057        // Copy the options no the return val
    10581058        $root_blog_options_meta = $root_blog_options;
    1059        
     1059
    10601060        // Clean up our temporary copy
    10611061        unset( $root_blog_options );
    10621062    }
    1063    
     1063
    10641064    return apply_filters( 'bp_core_get_root_options', $root_blog_options_meta );
    10651065}
     
    10911091        $bp->add_root[] = $slug;
    10921092    }
    1093    
     1093
    10941094    // Make sure that this component is registered as requiring a top-level directory
    10951095    if ( isset( $bp->{$slug} ) ) {
Note: See TracChangeset for help on using the changeset viewer.