Changeset 6583 for trunk/bp-core/admin/bp-core-schema.php
- Timestamp:
- 12/10/2012 08:47:07 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-schema.php
r6342 r6583 9 9 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 10 10 11 /* BuddyPress component DB schema */ 12 if ( !empty($wpdb->charset) ) 13 return "DEFAULT CHARACTER SET $wpdb->charset"; 14 15 return ''; 11 // BuddyPress component DB schema 12 return !empty( $wpdb->charset ) ? "DEFAULT CHARACTER SET {$wpdb->charset}" : ''; 16 13 } 17 14 … … 244 241 245 242 // These values should only be updated if they are not already present 246 if ( ! $base_group_name =bp_get_option( 'bp-xprofile-base-group-name' ) ) {247 bp_update_option( 'bp-xprofile-base-group-name', _x( ' Base', 'First XProfilegroup name', 'buddypress' ) );243 if ( ! bp_get_option( 'bp-xprofile-base-group-name' ) ) { 244 bp_update_option( 'bp-xprofile-base-group-name', _x( 'General', 'First field-group name', 'buddypress' ) ); 248 245 } 249 246 250 if ( ! $fullname_field_name =bp_get_option( 'bp-xprofile-fullname-field-name' ) ) {251 bp_update_option( 'bp-xprofile-fullname-field-name', _x( ' Name', 'XProfile fullname field name', 'buddypress' ) );247 if ( ! bp_get_option( 'bp-xprofile-fullname-field-name' ) ) { 248 bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Display Name', 'Display name field', 'buddypress' ) ); 252 249 } 253 250 … … 340 337 dbDelta( $sql ); 341 338 } 342 343 /**344 * I don't appear to be used anymore, but I'm here anyways. I was originally345 * used in olden days to update pre-1.1 schemas, but that was before we had346 * a legitimate update process. Keep me around just incase.347 *348 * @global WPDB $wpdb349 * @global BuddyPress $bp350 */351 function bp_update_db_stuff() {352 global $wpdb, $bp;353 354 $bp_prefix = bp_core_get_table_prefix();355 356 // Rename the old user activity cached table if needed.357 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) )358 $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );359 360 // Rename fields from pre BP 1.2361 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) {362 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) {363 $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );364 }365 366 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) {367 $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );368 }369 }370 371 // On first installation - record all existing blogs in the system.372 if ( !(int) $bp->site_options['bp-blogs-first-install'] ) {373 bp_blogs_record_existing_blogs();374 bp_update_option( 'bp-blogs-first-install', 1 );375 }376 377 if ( is_multisite() ) {378 bp_core_add_illegal_names();379 }380 381 // Update and remove the message threads table if it exists382 if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) {383 if ( BP_Messages_Thread::update_tables() ) {384 $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" );385 }386 }387 388 }
Note: See TracChangeset
for help on using the changeset viewer.