Changeset 4602
- Timestamp:
- 07/04/2011 04:59:01 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-notifications.php
r4558 r4602 47 47 $ud = bp_core_get_core_userdata( $receiver_user_id ); 48 48 $to = $ud->user_email; 49 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );49 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 50 50 $subject = '[' . $sitename . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name ); 51 51 … … 93 93 $ud = bp_core_get_core_userdata( $original_activity->user_id ); 94 94 $to = $ud->user_email; 95 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );95 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 96 96 $subject = '[' . $sitename . '] ' . sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name ); 97 97 … … 135 135 $ud = bp_core_get_core_userdata( $parent_comment->user_id ); 136 136 $to = $ud->user_email; 137 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );137 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 138 138 $subject = '[' . $sitename . '] ' . sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name ); 139 139 -
trunk/bp-blogs/bp-blogs-functions.php
r4596 r4602 292 292 $blog_id = $wpdb->blogid; 293 293 else 294 $blog_id = BP_ROOT_BLOG;294 $blog_id = bp_get_root_blog_id(); 295 295 296 296 if ( empty( $role ) ) { -
trunk/bp-blogs/bp-blogs-widgets.php
r4466 r4602 9 9 global $wpdb, $bp; 10 10 11 if ( bp_is_active( 'activity' ) && (int)$wpdb->blogid == BP_ROOT_BLOG)11 if ( bp_is_active( 'activity' ) && (int)$wpdb->blogid == bp_get_root_blog_id() ) 12 12 add_action('widgets_init', create_function('', 'return register_widget("BP_Blogs_Recent_Posts_Widget");') ); 13 13 } -
trunk/bp-core/admin/bp-core-update.php
r4559 r4602 777 777 $active_components['blogs'] = 1; 778 778 779 // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on780 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != BP_ROOT_BLOG) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )781 switch_to_blog( BP_ROOT_BLOG);779 // Make sure that the pages are created on the bp_get_root_blog_id(), no matter which Dashboard the setup is being run on 780 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) ) 781 switch_to_blog( bp_get_root_blog_id() ); 782 782 783 783 // Move bp-pages data from the blog options table to site options … … 789 789 bp_update_option( 'bp-pages', $existing_pages ); 790 790 791 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != BP_ROOT_BLOG) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )791 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) ) 792 792 restore_current_blog(); 793 793 … … 831 831 check_admin_referer( 'bpwizard_pages' ); 832 832 833 // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on834 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != BP_ROOT_BLOG) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )835 switch_to_blog( BP_ROOT_BLOG);833 // Make sure that the pages are created on the bp_get_root_blog_id(), no matter which Dashboard the setup is being run on 834 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) ) 835 switch_to_blog( bp_get_root_blog_id() ); 836 836 837 837 // Delete any existing pages … … 844 844 bp_update_option( 'bp-pages', $blog_pages ); 845 845 846 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != BP_ROOT_BLOG) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )846 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) ) 847 847 restore_current_blog(); 848 848 … … 958 958 check_admin_referer( 'bpwizard_theme' ); 959 959 960 if ( is_multisite() && BP_ROOT_BLOG!= get_current_blog_id() )961 switch_to_blog( BP_ROOT_BLOG);960 if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() ) 961 switch_to_blog( bp_get_root_blog_id() ); 962 962 963 963 switch ( $_POST['theme'] ) { -
trunk/bp-core/bp-core-adminbar.php
r4586 r4602 57 57 $wp_admin_bar->add_menu( array( 58 58 'id' => 'bp-root-blog', 59 'title' => get_blog_option( BP_ROOT_BLOG, 'blogname' ),59 'title' => get_blog_option( bp_get_root_blog_id(), 'blogname' ), 60 60 'href' => bp_get_root_domain() 61 61 ) ); … … 72 72 'parent' => 'bp-root-blog', 73 73 'title' => __( 'Admin Dashboard', 'buddypress' ), 74 'href' => get_admin_url( BP_ROOT_BLOG)74 'href' => get_admin_url( bp_get_root_blog_id() ) 75 75 ) ); 76 76 -
trunk/bp-core/bp-core-avatars.php
r4462 r4602 642 642 643 643 // If multisite, and current blog does not match root blog, make adjustments 644 if ( is_multisite() && BP_ROOT_BLOG!= get_current_blog_id() )645 $basedir = get_blog_option( BP_ROOT_BLOG, 'upload_path' );644 if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() ) 645 $basedir = get_blog_option( bp_get_root_blog_id(), 'upload_path' ); 646 646 } 647 647 … … 669 669 670 670 // If multisite, and current blog does not match root blog, make adjustments 671 if ( is_multisite() && BP_ROOT_BLOG!= get_current_blog_id() )672 $baseurl = trailingslashit( get_blog_option( BP_ROOT_BLOG, 'home' ) ) . get_blog_option( BP_ROOT_BLOG, 'upload_path' );671 if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() ) 672 $baseurl = trailingslashit( get_blog_option( bp_get_root_blog_id(), 'home' ) ) . get_blog_option( bp_get_root_blog_id(), 'upload_path' ); 673 673 } 674 674 -
trunk/bp-core/bp-core-buddybar.php
r4600 r4602 379 379 global $bp; 380 380 381 echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '</a>';381 echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>'; 382 382 } 383 383 -
trunk/bp-core/bp-core-catchuri.php
r4584 r4602 37 37 // on multiple blogs 38 38 if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && is_multisite() ) { 39 if ( BP_ROOT_BLOG!= (int) $wpdb->blogid )39 if ( bp_get_root_blog_id() != (int) $wpdb->blogid ) 40 40 return false; 41 41 } … … 67 67 68 68 // Running off blog other than root 69 if ( is_multisite() && !is_subdomain_install() && ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != BP_ROOT_BLOG) ) {69 if ( is_multisite() && !is_subdomain_install() && ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != bp_get_root_blog_id() ) ) { 70 70 71 71 // Any subdirectory names must be removed from $bp_uri. -
trunk/bp-core/bp-core-cssjs.php
r4141 r4602 35 35 global $wpdb; 36 36 37 if ( is_multisite() && $wpdb->blogid != BP_ROOT_BLOG)37 if ( is_multisite() && $wpdb->blogid != bp_get_root_blog_id() ) 38 38 return false; 39 39 -
trunk/bp-core/bp-core-filters.php
r4596 r4602 36 36 */ 37 37 function bp_core_email_from_name_filter() { 38 return apply_filters( 'bp_core_email_from_name_filter', wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES ) );38 return apply_filters( 'bp_core_email_from_name_filter', wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ) ); 39 39 } 40 40 add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' ); … … 72 72 return $themes; 73 73 74 if ( $wpdb->blogid == BP_ROOT_BLOG) {74 if ( $wpdb->blogid == bp_get_root_blog_id() ) { 75 75 $themes['bp-default'] = 1; 76 76 } … … 127 127 global $bp, $wpdb; 128 128 129 if ( is_multisite() && $wpdb->blogid != BP_ROOT_BLOG)129 if ( is_multisite() && $wpdb->blogid != bp_get_root_blog_id() ) 130 130 return $redirect_to; 131 131 -
trunk/bp-core/bp-core-functions.php
r4596 r4602 12 12 * @since 1.3 13 13 * 14 * @uses bp_get_ option_blog_id()14 * @uses bp_get_root_blog_id() 15 15 * @param str $option_name The option to be retrieved 16 16 * @param str $default Optional. Default value to be returned if the option isn't set … … 18 18 */ 19 19 function bp_get_option( $option_name, $default = '' ) { 20 $value = get_blog_option( bp_get_ option_blog_id( $option_name), $option_name, $default );20 $value = get_blog_option( bp_get_root_blog_id(), $option_name, $default ); 21 21 22 22 return apply_filters( 'bp_get_option', $value ); … … 32 32 * @since 1.3 33 33 * 34 * @uses bp_get_ option_blog_id()34 * @uses bp_get_root_blog_id() 35 35 * @param str $option_name The option key to be set 36 36 * @param str $value The value to be set 37 37 */ 38 38 function bp_update_option( $option_name, $value ) { 39 // update_blog_option() does not return anything on success/failure, so neither can we 40 update_blog_option( bp_get_option_blog_id( $option_name ), $option_name, $value ); 39 update_blog_option( bp_get_root_blog_id(), $option_name, $value ); 41 40 } 42 41 … … 50 49 * @since 1.3 51 50 * 52 * @uses bp_get_ option_blog_id()51 * @uses bp_get_root_blog_id() 53 52 * @param str $option_name The option key to be set 54 53 */ 55 54 function bp_delete_option( $option_name ) { 56 // update_blog_option() does not return anything on success/failure, so neither can we 57 delete_blog_option( bp_get_option_blog_id( $option_name ), $option_name ); 58 } 59 60 /** 61 * Retrieve the filterable blog_id of the blog where the option is question is saved 62 * 63 * Since BP 1.3, BuddyPress has stored all of its settings in blog options tables, as opposed to 64 * sitemeta. This makes it easier for non-standard setups (like BP_ENABLE_MULTIBLOG and 65 * multinetwork BP) to save and access options in a consistent and logical way. 66 * 67 * By default, nearly all settings are stored in the options table of BP_ROOT_BLOG. The one 68 * exception is when BP_ENABLE_MULTIBLOG is enabled. In this case, bp-pages - the list of pages that 69 * are associated with BP top-level components - must be specific to each blog in the network. If 70 * you are building a plugin that requires an option (either a BP-native option, or your own custom 71 * option) to be specific to each blog in a network, filter 'bp_blog_specific_options' and add your 72 * option's name. This will allow you to use bp_get_option() and bp_update_option() seamlessly. 73 * 74 * @package BuddyPress 75 * @since 1.3 76 * 77 * @see bp_get_option() 78 * @see bp_update_option() 79 * @uses apply_filters() Filter bp_get_option_blog_id to change this setting 80 * @return int $blog_id 81 */ 82 function bp_get_option_blog_id( $option_name ) { 83 $blog_specific_options = apply_filters( 'bp_blog_specific_options', array( 84 'bp-pages' 85 ) ); 86 87 if ( in_array( $option_name, $blog_specific_options ) ) { 88 if ( defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ) { 89 $blog_id = get_current_blog_id(); 90 } else { 91 $blog_id = BP_ROOT_BLOG; 92 } 93 } else { 94 $blog_id = BP_ROOT_BLOG; 95 } 96 97 return apply_filters( 'bp_get_option_blog_id', $blog_id ); 55 delete_blog_option( bp_get_root_blog_id(), $option_name ); 98 56 } 99 57 … … 126 84 $is_enable_multiblog = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? true : false; 127 85 128 $page_blog_id = $is_enable_multiblog ? get_current_blog_id() : BP_ROOT_BLOG;86 $page_blog_id = $is_enable_multiblog ? get_current_blog_id() : bp_get_root_blog_id(); 129 87 130 88 if ( isset( $ms_page_ids[$page_blog_id] ) ) { … … 142 100 * 143 101 * bp-pages data is stored in site_options (falls back to options on non-MS), in an array keyed by 144 * blog_id. This allows you to change your BP_ROOT_BLOGand go through the setup process again.102 * blog_id. This allows you to change your bp_get_root_blog_id() and go through the setup process again. 145 103 * 146 104 * @package BuddyPress Core … … 170 128 if ( $page_ids = bp_core_get_page_meta() ) { 171 129 172 $posts_table_name = is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ? $wpdb->get_blog_prefix( BP_ROOT_BLOG) . 'posts' : $wpdb->posts;130 $posts_table_name = is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ? $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts' : $wpdb->posts; 173 131 $page_ids_sql = implode( ',', (array)$page_ids ); 174 132 $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' " ) ); … … 513 471 global $wpdb; 514 472 515 if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) 516 $domain = get_home_url( $wpdb->blogid ); 517 else 518 $domain = get_home_url( BP_ROOT_BLOG ); 473 $domain = get_home_url( bp_get_root_blog_id() ); 519 474 520 475 return apply_filters( 'bp_core_get_root_domain', $domain ); … … 1097 1052 1098 1053 /** 1099 * Is this BP_ROOT_BLOG?1054 * Is this the root blog ID? 1100 1055 * 1101 1056 * @package BuddyPress … … 1103 1058 * 1104 1059 * @param int $blog_id Optional. Defaults to the current blog id. 1105 * @return bool $is_root_blog Returns true if this is BP_ROOT_BLOG. 1106 */ 1107 function bp_is_root_blog( $blog_id = false ) { 1108 $is_root_blog = true; 1109 1110 if ( !$blog_id ) 1060 * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id(). 1061 */ 1062 function bp_is_root_blog( $blog_id = 0 ) { 1063 1064 // Assume false 1065 $is_root_blog = false; 1066 1067 // Use current blog if no ID is passed 1068 if ( empty( $blog_id ) ) 1111 1069 $blog_id = get_current_blog_id(); 1112 1070 1113 if ( $blog_id != BP_ROOT_BLOG ) 1114 $is_root_blog = false; 1115 1116 return apply_filters( 'bp_is_root_blog', $is_root_blog ); 1071 // Compare to root blog ID 1072 if ( $blog_id == bp_get_root_blog_id() ) 1073 $is_root_blog = true; 1074 1075 return apply_filters( 'bp_is_root_blog', (bool) $is_root_blog ); 1076 } 1077 1078 /** 1079 * Is this bp_get_root_blog_id()? 1080 * 1081 * @package BuddyPress 1082 * @since 1.3 1083 * 1084 * @param int $blog_id Optional. Defaults to the current blog id. 1085 * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id(). 1086 */ 1087 function bp_get_root_blog_id( $blog_id = false ) { 1088 1089 // Define on which blog ID BuddyPress should run 1090 if ( !defined( 'BP_ROOT_BLOG' ) ) { 1091 1092 // Root blog is the main site on this network 1093 if ( is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ) { 1094 $current_site = get_current_site(); 1095 $root_blog_id = $current_site->blog_id; 1096 1097 // Root blog is every site on this network 1098 } elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) { 1099 $root_blog_id = get_current_blog_id(); 1100 1101 // Root blog is the only blog on this network 1102 } elseif( !is_multisite() ) { 1103 $root_blog_id = 1; 1104 } 1105 1106 define( 'BP_ROOT_BLOG', $root_blog_id ); 1107 1108 // Root blog is defined 1109 } else { 1110 $root_blog_id = BP_ROOT_BLOG; 1111 } 1112 1113 return apply_filters( 'bp_get_root_blog_id', (int) $root_blog_id ); 1117 1114 } 1118 1115 -
trunk/bp-core/bp-core-template.php
r4596 r4602 169 169 $root_blog_offset = false; 170 170 if ( $localize_time ) 171 $root_blog_offset = get_blog_option( BP_ROOT_BLOG, 'gmt_offset' );171 $root_blog_offset = get_blog_option( bp_get_root_blog_id(), 'gmt_offset' ); 172 172 173 173 // Calculate offset time -
trunk/bp-core/bp-core-wpabstraction.php
r4559 r4602 33 33 if ( !function_exists( 'switch_to_blog' ) ) { 34 34 function switch_to_blog() { 35 return 1;35 return bp_get_root_blog_id(); 36 36 } 37 37 } … … 39 39 if ( !function_exists( 'restore_current_blog' ) ) { 40 40 function restore_current_blog() { 41 return 1;41 return bp_get_root_blog_id(); 42 42 } 43 43 } -
trunk/bp-forums/bp-forums-admin.php
r4559 r4602 190 190 $file .= "\n" . '$bb->custom_user_meta_table = \'' . $wpdb->usermeta . '\';'; 191 191 $file .= "\n\n" . '$bb->uri = \'' . BP_PLUGIN_URL . '/bp-forums/bbpress/\';'; 192 $file .= "\n" . '$bb->name = \'' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . ' ' . __( 'Forums', 'buddypress' ) . '\';';192 $file .= "\n" . '$bb->name = \'' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . ' ' . __( 'Forums', 'buddypress' ) . '\';'; 193 193 194 194 if ( is_multisite() ) 195 $file .= "\n" . '$bb->wordpress_mu_primary_blog_id = ' . BP_ROOT_BLOG. ';';195 $file .= "\n" . '$bb->wordpress_mu_primary_blog_id = ' . bp_get_root_blog_id() . ';'; 196 196 197 197 if ( defined( 'AUTH_SALT' ) ) -
trunk/bp-forums/bp-forums-bbpress-sa.php
r4211 r4602 84 84 // Set a site id if there isn't one already 85 85 if ( !isset( $bb->site_id ) ) 86 $bb->site_id = BP_ROOT_BLOG;86 $bb->site_id = bp_get_root_blog_id(); 87 87 88 88 // Check if the tables are installed, if not, install them -
trunk/bp-friends/bp-friends-notifications.php
r4558 r4602 19 19 // Set up and send the message 20 20 $to = $ud->user_email; 21 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );21 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 22 22 $subject = '[' . $sitename . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name ); 23 23 … … 61 61 // Set up and send the message 62 62 $to = $ud->user_email; 63 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );63 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 64 64 $subject = '[' . $sitename . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name ); 65 65 -
trunk/bp-groups/bp-groups-notifications.php
r4558 r4602 5 5 6 6 $group = new BP_Groups_Group( $group_id ); 7 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );7 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 8 8 $subject = '[' . $sitename . '] ' . __( 'Group Details Updated', 'buddypress' ); 9 9 … … 112 112 // Set up and send the message 113 113 $to = $ud->user_email; 114 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );114 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 115 115 116 116 if ( $accepted ) { … … 172 172 // Set up and send the message 173 173 $to = $ud->user_email; 174 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );174 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 175 175 $subject = '[' . $sitename . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name ); 176 176 … … 222 222 // Set up and send the message 223 223 $to = $invited_ud->user_email; 224 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );224 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 225 225 $subject = '[' . $sitename . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ); 226 226 … … 284 284 $ud = bp_core_get_core_userdata( $receiver_user_id ); 285 285 $to = $ud->user_email; 286 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );286 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 287 287 $subject = '[' . $sitename . '] ' . sprintf( __( '%1$s mentioned you in the group "%2$s"', 'buddypress' ), $poster_name, $group->name ); 288 288 -
trunk/bp-loader.php
r4556 r4602 28 28 // Define on which blog ID BuddyPress should run 29 29 if ( !defined( 'BP_ROOT_BLOG' ) ) { 30 if ( is_multisite() ) { 30 31 // Root blog is the main site on this network 32 if ( is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ) { 31 33 $current_site = get_current_site(); 32 34 $root_blog_id = $current_site->blog_id; 33 } else { 35 36 // Root blog is every site on this network 37 } elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) { 38 $root_blog_id = get_current_blog_id(); 39 40 // Root blog is the only blog on this network 41 } elseif( !is_multisite() ) { 34 42 $root_blog_id = 1; 35 43 } … … 104 112 // Switch the user to the new bp-default if they are using the old 105 113 // bp-default on activation. 106 if ( 'bp-sn-parent' == get_blog_option( BP_ROOT_BLOG, 'template' ) && 'bp-default' == get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) )114 if ( 'bp-sn-parent' == get_blog_option( bp_get_root_blog_id(), 'template' ) && 'bp-default' == get_blog_option( bp_get_root_blog_id(), 'stylesheet' ) ) 107 115 switch_theme( 'bp-default', 'bp-default' ); 108 116 -
trunk/bp-members/bp-members-actions.php
r4400 r4602 49 49 foreach ( (array) $blogs as $key => $details ) { 50 50 // Do not mark the main or current root blog as spam 51 if ( 1 == $details->userblog_id || BP_ROOT_BLOG== $details->userblog_id )51 if ( 1 == $details->userblog_id || bp_get_root_blog_id() == $details->userblog_id ) 52 52 continue; 53 53 -
trunk/bp-members/bp-members-buddybar.php
r4565 r4602 49 49 50 50 // Hide on root blog 51 if ( $wpdb->blogid == BP_ROOT_BLOG|| !bp_is_active( 'blogs' ) )51 if ( $wpdb->blogid == bp_get_root_blog_id() || !bp_is_active( 'blogs' ) ) 52 52 return false; 53 53 -
trunk/bp-messages/bp-messages-notifications.php
r4558 r4602 25 25 // Set up and send the message 26 26 $email_to = $ud->user_email; 27 $sitename = wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ), ENT_QUOTES );27 $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); 28 28 $email_subject = '[' . $sitename . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), $sender_name ); 29 29
Note: See TracChangeset
for help on using the changeset viewer.