Changeset 5749 for trunk/bp-core/admin/bp-core-schema.php
- Timestamp:
- 02/13/2012 04:03:55 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/admin/bp-core-schema.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-schema.php
r5683 r5749 1 1 <?php 2 2 3 // Exit if accessed directly 3 4 if ( !defined( 'ABSPATH' ) ) exit; … … 13 14 14 15 return ''; 16 } 17 18 function bp_core_install( $active_components = false ) { 19 20 if ( empty( $active_components ) ) 21 $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) ); 22 23 // Core DB Tables 24 bp_core_install_notifications(); 25 26 // Activity Streams 27 if ( !empty( $active_components['activity'] ) ) 28 bp_core_install_activity_streams(); 29 30 // Friend Connections 31 if ( !empty( $active_components['friends'] ) ) 32 bp_core_install_friends(); 33 34 // Extensible Groups 35 if ( !empty( $active_components['groups'] ) ) 36 bp_core_install_groups(); 37 38 // Private Messaging 39 if ( !empty( $active_components['messages'] ) ) 40 bp_core_install_private_messaging(); 41 42 // Extended Profiles 43 if ( !empty( $active_components['xprofile'] ) ) 44 bp_core_install_extended_profiles(); 45 46 // Blog tracking 47 if ( !empty( $active_components['blogs'] ) ) 48 bp_core_install_blog_tracking(); 15 49 } 16 50 … … 301 335 } 302 336 337 /** 338 * I don't appear to be used anymore, but I'm here anyways. I was originally 339 * used in olden days to update pre-1.1 schemas, but that was before we had 340 * a legitimate update process. Keep me around just incase. 341 * 342 * @global WPDB $wpdb 343 * @global BuddyPress $bp 344 */ 345 function bp_update_db_stuff() { 346 global $wpdb, $bp; 347 348 $bp_prefix = bp_core_get_table_prefix(); 349 350 // Rename the old user activity cached table if needed. 351 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) ) 352 $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" ); 353 354 // Rename fields from pre BP 1.2 355 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) { 356 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) { 357 $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" ); 358 } 359 360 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) { 361 $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" ); 362 } 363 } 364 365 // On first installation - record all existing blogs in the system. 366 if ( !(int) $bp->site_options['bp-blogs-first-install'] ) { 367 bp_blogs_record_existing_blogs(); 368 bp_update_option( 'bp-blogs-first-install', 1 ); 369 } 370 371 if ( is_multisite() ) { 372 bp_core_add_illegal_names(); 373 } 374 375 // Update and remove the message threads table if it exists 376 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) { 377 if ( BP_Messages_Thread::update_tables() ) { 378 $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" ); 379 } 380 } 381 382 } 383 303 384 ?>
Note: See TracChangeset
for help on using the changeset viewer.