Changeset 4203
- Timestamp:
- 04/14/2011 01:36:19 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-update.php
r4198 r4203 253 253 return false; 254 254 255 $active_components = get_site_option( 'bp-active-components' ); 256 255 257 if ( defined( 'BP_BLOGS_SLUG' ) ) 256 258 $blogs_slug = constant( 'BP_BLOGS_SLUG' ); … … 277 279 </script> 278 280 279 <p><?php printf( __( 'BuddyPress has detected a recent change to WordPress Multisite, which allows members of your community to have their own WordPress blogs. You can enable or disable this feature at any time at <a href="%s">Network Options</a>.', 'buddypress' ), admin_url( 'ms-options.php' ) ); ?></p>280 281 <p><?php _ e( "Please select the WordPress page you would like to use to display the blog directory. You can either choose an existing page or let BuddyPress auto-create a page for you. If you'd like to manually create pages, please go ahead and do that now, you can come back to this step onceyou are finished.", 'buddypress' ) ?></p>281 <p><?php printf( __( 'BuddyPress has detected a recent change to WordPress Multisite, which allows members of your community to have their own WordPress blogs. You can enable or disable this feature at any time at <a href="%s">Network Options</a>.', 'buddypress' ), network_admin_url( 'settings.php' ) ); ?></p> 282 283 <p><?php __( "Please select the WordPress page you would like to use to display the blog directory. You can either choose an existing page or let BuddyPress auto-create a page for you. If you'd like, you can go to manually create pages now, and return to this step when you are finished.", 'buddypress' ) ?></p> 282 284 283 285 <p><strong><?php _e( 'Please Note:', 'buddypress' ) ?></strong> <?php _e( "If you have manually added BuddyPress navigation links in your theme you may need to remove these from your header.php to avoid duplicate links.", 'buddypress' ) ?></p> … … 306 308 307 309 <div class="radio"> 308 <input type="radio" name="bp_components[b p-blogs.php]" value="1"<?php if ( !isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 309 <input type="radio" name="bp_components[b p-blogs.php]" value="0"<?php if ( isset( $disabled_components['bp-blogs.php'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?>310 <input type="radio" name="bp_components[blogs]" value="1"<?php if ( isset( $active_components['blogs'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Enabled', 'buddypress' ) ?> 311 <input type="radio" name="bp_components[blogs]" value="0"<?php if ( !isset( $active_components['blogs'] ) ) : ?> checked="checked" <?php endif; ?>/> <?php _e( 'Disabled', 'buddypress' ) ?> 310 312 </div> 311 313 … … 333 335 334 336 if ( !function_exists( 'bp_core_admin_component_options' ) ) 335 require ( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-admin.php' ); 336 337 $disabled_components = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) ); ?> 337 require ( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-admin.php' ); ?> 338 338 339 339 <p><?php _e( "BuddyPress bundles several individual social components together, each one adding a distinct feature. This first step decides which features are enabled on your site; all features are enabled by default. Don't worry, you can change your mind at any point in the future.", 'buddypress' ); ?></p> … … 364 364 $existing_pages = get_option( 'bp-pages' ); 365 365 366 // Get disabledcomponents367 $ disabled_components = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );366 // Get active components 367 $active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) ); 368 368 369 369 // Check for defined slugs … … 417 417 </tr> 418 418 419 <?php if ( !isset( $disabled_components['bp-activity.php'] ) ) : ?>419 <?php if ( isset( $active_components['activity'] ) ) : ?> 420 420 421 421 <tr valign="top"> … … 432 432 <?php endif; ?> 433 433 434 <?php if ( !isset( $disabled_components['bp-groups.php'] ) ) : ?>434 <?php if ( isset( $active_components['groups'] ) ) : ?> 435 435 436 436 <tr valign="top"> … … 447 447 <?php endif; ?> 448 448 449 <?php if ( !isset( $disabled_components['bp-forums.php'] ) ) : ?>449 <?php if ( isset( $active_components['forums'] ) ) : ?> 450 450 451 451 <tr valign="top"> … … 462 462 <?php endif; ?> 463 463 464 <?php if ( is_multisite() && !isset( $disabled_components['bp-blogs.php'] ) ) : ?>464 <?php if ( is_multisite() && isset( $active_components['blogs'] ) ) : ?> 465 465 466 466 <tr valign="top"> … … 752 752 check_admin_referer( 'bpwizard_ms_update' ); 753 753 754 if ( !$ disabled = get_option( 'bp-deactivated-components' ) )755 $ disabled= array();754 if ( !$active_components = get_option( 'bp-active-components' ) ) 755 $active_components = array(); 756 756 757 757 // Transfer important settings from blog options to site options 758 758 $options = array( 759 'bp-db-version' 760 'bp- deactivated-components' => $disabled,761 'avatar-default' 759 'bp-db-version' => $this->database_version, 760 'bp-active-components' => $active_components, 761 'avatar-default' => get_option( 'avatar-default' ) 762 762 ); 763 763 bp_core_activate_site_options( $options ); 764 764 765 if ( !(int) $_POST['bp_components']['bp-blogs.php'] ) { 766 if ( empty( $disabled ) ) { 767 $disabled = array(); 768 } 769 770 $disabled['bp-blogs.php'] = 1; 771 772 } else { 765 if ( isset( $_POST['bp_components']['blogs'] ) ) { 766 $active_components['blogs'] = 1; 773 767 774 768 // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on … … 785 779 restore_current_blog(); 786 780 787 unset( $disabled['bp-blogs.php'] ); 788 789 bp_core_install( $disabled ); 781 bp_core_install( $active_components ); 790 782 } 791 783 792 update_site_option( 'bp- deactivated-components', $disabled);784 update_site_option( 'bp-active-components', $active_components ); 793 785 794 786 return true; … … 1061 1053 add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', 'bp_core_setup_wizard_init', 7 ); 1062 1054 1063 function bp_core_install( $ disabled= false ) {1055 function bp_core_install( $active_components = false ) { 1064 1056 global $wpdb; 1065 1057 1066 if ( empty( $ disabled) )1067 $ disabled = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );1058 if ( empty( $active_components ) ) 1059 $active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) ); 1068 1060 1069 1061 require_once( dirname( __FILE__ ) . '/bp-core-schema.php' ); 1070 1062 1071 1063 // Core DB Tables 1072 1064 bp_core_install_notifications(); 1073 1065 1074 1066 // Activity Streams 1075 if ( empty( $disabled['bp-activity.php'] ) )1067 if ( !empty( $active_components['activity'] ) ) 1076 1068 bp_core_install_activity_streams(); 1077 1069 1078 1070 // Friend Connections 1079 if ( empty( $disabled['bp-friends.php'] ) )1071 if ( !empty( $active_components['friends'] ) ) 1080 1072 bp_core_install_friends(); 1081 1073 1082 1074 // Extensible Groups 1083 if ( empty( $disabled['bp-groups.php'] ) )1075 if ( !empty( $active_components['groups'] ) ) 1084 1076 bp_core_install_groups(); 1085 1077 1086 1078 // Private Messaging 1087 if ( empty( $disabled['bp-messages.php'] ) )1079 if ( !empty( $active_components['messages'] ) ) 1088 1080 bp_core_install_private_messaging(); 1089 1081 1090 1082 // Extended Profiles 1091 if ( empty( $disabled['bp-xprofile.php'] ) )1083 if ( !empty( $active_components['xprofile'] ) ) 1092 1084 bp_core_install_extended_profiles(); 1093 1085 1094 1086 // Only install blog tables if this is a multisite installation 1095 if ( is_multisite() && empty( $disabled['bp-blogs.php'] ) )1087 if ( is_multisite() && !empty( $active_components['blogs'] ) ) 1096 1088 bp_core_install_blog_tracking(); 1097 1089 } … … 1320 1312 } 1321 1313 add_action( 'admin_notices', 'bp_core_update_nag', 5 ); 1314 add_action( 'network_admin_notices', 'bp_core_update_nag', 5 ); 1322 1315 1323 1316 ?> -
trunk/bp-core/bp-core-functions.php
r4183 r4203 256 256 // On multisite installs, don't log on a non-root blog 257 257 if ( !bp_is_root_blog() ) 258 return; 259 260 // Don't show these messages during setup or upgrade 261 if ( isset( $bp->maintenence_mode ) ) 258 262 return; 259 263 … … 942 946 function bp_core_add_root_component( $slug ) { 943 947 global $bp; 944 948 945 949 if ( empty( $bp->pages ) ) 946 950 $bp->pages = bp_core_get_page_names(); -
trunk/bp-loader.php
r4030 r4203 57 57 58 58 // Test to see whether this is a new installation or an upgraded version of BuddyPress 59 if ( !$bp->database_version = get_site_option( 'bp-db-version' ) ) 60 $bp->database_version = get_site_option( 'bp-core-db-version' ); // BP 1.2 option name 59 if ( !$bp->database_version = get_site_option( 'bp-db-version' ) ) { 60 if ( $bp->database_version = get_option( 'bp-db-version' ) ) { 61 $bp->is_ms_activate = 1; 62 } else { 63 $bp->database_version = get_site_option( 'bp-core-db-version' ); // BP 1.2 option 64 } 65 } 61 66 62 67 // This is a new installation. … … 71 76 72 77 // Check if an update is required 73 if ( (int)$bp->database_version < (int)constant( 'BP_DB_VERSION' ) ) {78 if ( (int)$bp->database_version < (int)constant( 'BP_DB_VERSION' ) || isset( $bp->is_ms_activate ) ) { 74 79 $bp->maintenence_mode = 'update'; 75 80 require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' ); -
trunk/bp-themes/bp-default/functions.php
r4188 r4203 27 27 * @since 1.2 28 28 */ 29 30 if ( !function_exists( 'bp_is_active' ) ) 31 return; 29 32 30 33 // If BuddyPress is not activated, switch back to the default WP theme
Note: See TracChangeset
for help on using the changeset viewer.