Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/10/2012 08:47:07 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Delete empty update file, deprecate bp_db_update_stuff(), and clean up deprecated phpdoc blocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-schema.php

    r6342 r6583  
    99    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    1010
    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}" : '';
    1613}
    1714
     
    244241
    245242    // 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 XProfile group 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' ) );
    248245    }
    249246
    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' ) );
    252249    }
    253250
     
    340337    dbDelta( $sql );
    341338}
    342 
    343 /**
    344  * I don't appear to be used anymore, but I'm here anyways. I was originally
    345  * used in olden days to update pre-1.1 schemas, but that was before we had
    346  * a legitimate update process. Keep me around just incase.
    347  *
    348  * @global WPDB $wpdb
    349  * @global BuddyPress $bp
    350  */
    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.2
    361     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 exists
    382     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.