Changeset 3464
- Timestamp:
- 11/21/2010 04:58:53 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r3463 r3464 15 15 if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) ) 16 16 require( WP_PLUGIN_DIR . '/bp-custom.php' ); 17 18 /* Define on which blog ID BuddyPress should run */19 if ( !defined( 'BP_ROOT_BLOG' ) )20 define( 'BP_ROOT_BLOG', 1 );21 17 22 18 /* Define the user and usermeta table names, useful if you are using custom or shared tables. */ -
trunk/bp-core/admin/bp-core-upgrade.php
r3463 r3464 825 825 $options = array( 826 826 'bp-db-version' => $this->current_version, 827 'bp-deactivated-components' => $disabled 827 'bp-deactivated-components' => $disabled, 828 'avatar-default' => get_option( 'avatar-default' ) 828 829 ); 829 830 bp_core_activate_site_options( $options ); -
trunk/bp-core/bp-core-catchuri.php
r3439 r3464 195 195 196 196 // Remove the username from action variables if this is not a VHOST install 197 if ( defined( 'VHOST' ) && 'no' == VHOST && !$is_root_component)197 if ( defined( 'VHOST' ) && 'no' == VHOST && empty( $is_root_component ) ) 198 198 array_shift($bp_uri); 199 199 -
trunk/bp-loader.php
r3463 r3464 12 12 define( 'BP_VERSION', '1.3-bleeding' ); 13 13 define( 'BP_DB_VERSION', 1225 ); 14 15 // Define on which blog ID BuddyPress should run 16 if ( !defined( 'BP_ROOT_BLOG' ) ) 17 define( 'BP_ROOT_BLOG', 1 ); 14 18 15 19 /*** … … 89 93 global $bp, $wpdb; 90 94 91 $options = apply_filters( 'bp_core_site_options', array( 95 // These options come from the options table in WP single, and sitemeta in MS 96 $site_options = apply_filters( 'bp_core_site_options', array( 92 97 'bp-deactivated-components', 93 98 'bp-blogs-first-install', … … 103 108 'hide-loggedout-adminbar', 104 109 105 /* Useful WordPress settings used often */ 106 'user-avatar-default', 110 // Useful WordPress settings used often 107 111 'tags_blog_id', 108 112 'registration', 109 113 'fileupload_maxk' 110 114 ) ); 115 116 // These options always come from the options table of BP_ROOT_BLOG 117 $root_blog_options = apply_filters( 'bp_core_root_blog_options', array( 118 'avatar_default' 119 ) ); 111 120 112 $meta_keys = "'" . implode( "','", (array)$ options ) ."'";121 $meta_keys = "'" . implode( "','", (array)$site_options ) ."'"; 113 122 114 123 if ( is_multisite() ) 115 $ meta = $wpdb->get_results( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ({$meta_keys}) AND site_id = {$wpdb->siteid}" );124 $site_meta = $wpdb->get_results( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ({$meta_keys}) AND site_id = {$wpdb->siteid}" ); 116 125 else 117 $meta = $wpdb->get_results( "SELECT option_name AS name, option_value AS value FROM {$wpdb->options} WHERE option_name IN ({$meta_keys})" ); 126 $site_meta = $wpdb->get_results( "SELECT option_name AS name, option_value AS value FROM {$wpdb->options} WHERE option_name IN ({$meta_keys})" ); 127 128 $root_blog_meta_keys = "'" . implode( "','", (array)$root_blog_options ) ."'"; 129 130 $root_blog_meta_table = BP_ROOT_BLOG == 1 ? $wpdb->base_prefix . 'options' : $wpdb->base_prefix . BP_ROOT_BLOG . '_options'; 131 $root_blog_meta = $wpdb->get_results( $wpdb->prepare( "SELECT option_name AS name, option_value AS value FROM {$root_blog_meta_table} WHERE option_name IN ({$root_blog_meta_keys})" ) ); 118 132 119 133 $site_options = array(); 120 if ( !empty( $meta ) ) { 121 foreach( (array)$meta as $meta_item ) 122 $site_options[$meta_item->name] = $meta_item->value; 134 foreach( array( $site_meta, $root_blog_meta ) as $meta ) { 135 if ( !empty( $meta ) ) { 136 foreach( (array)$meta as $meta_item ) 137 $site_options[$meta_item->name] = $meta_item->value; 138 } 123 139 } 124 125 140 return apply_filters( 'bp_core_get_site_options', $site_options ); 126 141 }
Note: See TracChangeset
for help on using the changeset viewer.