Changeset 4630
- Timestamp:
- 07/09/2011 07:14:50 PM (14 years ago)
- Location:
- trunk/bp-core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-catchuri.php
r4628 r4630 34 34 $bp->action_variables = $bp->displayed_user->id = ''; 35 35 36 // Only catch URI's on the root blog if we are not running 37 // on multiple blogs 38 if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && is_multisite() ) { 39 if ( bp_get_root_blog_id() != (int) $wpdb->blogid ) 40 return false; 36 // Don't catch URIs on non-root blogs unless multiblog mode is on 37 if ( !bp_is_root_blog() && !bp_is_multiblog_mode() ) { 38 return false; 41 39 } 42 40 … … 67 65 68 66 // Running off blog other than root 69 if ( is_multisite() && !is_subdomain_install() && ( defined( 'BP_ENABLE_MULTIBLOG') || 1 != bp_get_root_blog_id() ) ) {67 if ( is_multisite() && !is_subdomain_install() && ( bp_is_multiblog_mode() || 1 != bp_get_root_blog_id() ) ) { 70 68 71 69 // Any subdirectory names must be removed from $bp_uri. -
trunk/bp-core/bp-core-functions.php
r4628 r4630 81 81 82 82 // Upgrading from an earlier version of BP pre-1.3 83 if ( !isset( $page_ids['members'] ) && $ms_page_ids = get_site_option( 'bp-pages' ) ) { 84 $is_enable_multiblog = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? true : false; 85 86 $page_blog_id = $is_enable_multiblog ? get_current_blog_id() : bp_get_root_blog_id(); 83 if ( !isset( $page_ids['members'] ) && $ms_page_ids = get_site_option( 'bp-pages' ) ) { 84 $page_blog_id = bp_is_multiblog_mode() ? get_current_blog_id() : bp_get_root_blog_id(); 87 85 88 86 if ( isset( $ms_page_ids[$page_blog_id] ) ) { … … 128 126 if ( $page_ids = bp_core_get_page_meta() ) { 129 127 130 $posts_table_name = is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG') ? $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts' : $wpdb->posts;128 $posts_table_name = bp_is_multiblog_mode() ? $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts' : $wpdb->posts; 131 129 $page_ids_sql = implode( ',', (array)$page_ids ); 132 130 $page_names = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' " ) ); … … 191 189 $do_network_admin = false; 192 190 193 if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG) )191 if ( is_multisite() && !bp_is_multiblog_mode() ) 194 192 $do_network_admin = true; 195 193 … … 1091 1089 1092 1090 // Root blog is the main site on this network 1093 if ( is_multisite() && ! defined( 'BP_ENABLE_MULTIBLOG') ) {1091 if ( is_multisite() && !bp_is_multiblog_mode() ) { 1094 1092 $current_site = get_current_site(); 1095 1093 $root_blog_id = $current_site->blog_id; 1096 1094 1097 // Root blog is every site on this network1098 } elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG') ) {1095 // Root blog is whatever the current site is (could be any site on the network) 1096 } elseif ( is_multisite() && bp_is_multiblog_mode() ) { 1099 1097 $root_blog_id = get_current_blog_id(); 1100 1098 … … 1213 1211 } 1214 1212 1213 /** 1214 * Are we running multiblog mode? 1215 * 1216 * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WP Multisite. "Multiblog" is 1217 * a BP setup that allows BP content to be viewed in the theme, and with the URL, of every blog 1218 * on the network. Thus, instead of having all 'boonebgorges' links go to 1219 * http://example.com/members/boonebgorges 1220 * on the root blog, each blog will have its own version of the same profile content, eg 1221 * http://site2.example.com/members/boonebgorges (for subdomains) 1222 * http://example.com/site2/members/boonebgorges (for subdirectories) 1223 * 1224 * Multiblog mode is disabled by default, meaning that all BP content must be viewed on the root 1225 * blog. 1226 * 1227 * @package BuddyPress 1228 * @since 1.3 1229 * 1230 * @uses apply_filters() Filter 'bp_is_multiblog_mode' to alter 1231 * @return bool False when multiblog mode is disabled (default); true when enabled 1232 */ 1233 function bp_is_multiblog_mode() { 1234 return apply_filters( 'bp_is_multiblog_mode', is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ); 1235 } 1236 1215 1237 /** Global Manipulators *******************************************************/ 1216 1238
Note: See TracChangeset
for help on using the changeset viewer.