Skip to:
Content

BuddyPress.org

Changeset 6583


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.

Location:
trunk/bp-core
Files:
1 deleted
4 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 }
  • trunk/bp-core/deprecated/1.5.php

    r6474 r6583  
    1313/** Loader ********************************************************************/
    1414
     15/**
     16 * @deprecated BuddyPress (1.5)
     17 */
    1518function bp_setup_root_components() {
    1619    do_action( 'bp_setup_root_components' );
     
    2629 * Use is_multisite() instead.
    2730 *
    28  * @deprecated 1.5
     31 * @deprecated BuddyPress (1.5)
    2932 * @deprecated Use is_multisite()
    3033 */
     
    3942 * Checks if current blog is root blog of site. Deprecated in 1.5.
    4043 *
    41  * @deprecated 1.5
     44 * @deprecated BuddyPress (1.5)
    4245 * @deprecated Use is_main_site()
    4346 * @package BuddyPress
     
    5457 * WPMU version of is_super_admin()
    5558 *
    56  * @deprecated 1.5
     59 * @deprecated BuddyPress (1.5)
    5760 * @deprecated Use is_super_admin()
    5861 * @param int $user_id Optional. Defaults to logged-in user
     
    7275 * that allowed positioning of menus. Deprecated in 1.5 in favour of a WP core function.
    7376 *
    74  * @deprecated 1.5
     77 * @deprecated BuddyPress (1.5)
    7578 * @deprecated Use add_menu_page().
    7679 * @since BuddyPress (1.1)
     
    118121/** Activity ******************************************************************/
    119122
     123/**
     124 * @deprecated BuddyPress (1.5)
     125 */
    120126function bp_is_activity_permalink() {
    121127    _deprecated_function( __FUNCTION__, '1.5', 'bp_is_single_activity' );
     
    125131/** Core **********************************************************************/
    126132
     133/**
     134 * @deprecated BuddyPress (1.5)
     135 */
    127136function bp_core_get_wp_profile() {
    128137    _deprecated_function( __FUNCTION__, '1.5' );
    129 
    130     global $bp;
    131138
    132139    $ud = get_userdata( bp_displayed_user_id() ); ?>
     
    197204}
    198205
     206/**
     207 * @deprecated BuddyPress (1.5)
     208 * @deprecated Use bp_is_my_profile()
     209 */
    199210function bp_is_home() {
    200211    _deprecated_function( __FUNCTION__, '1.5', 'bp_is_my_profile' );
     
    205216 * Is the user on the front page of the site?
    206217 *
    207  * @deprecated 1.5
     218 * @deprecated BuddyPress (1.5)
    208219 * @deprecated Use is_front_page()
    209220 * @return bool
     
    217228 * Is the front page of the site set to the Activity component?
    218229 *
    219  * @deprecated 1.5
     230 * @deprecated BuddyPress (1.5)
    220231 * @deprecated Use bp_is_component_front_page( 'activity' )
    221232 * @return bool
     
    226237}
    227238
     239/**
     240 * @deprecated BuddyPress (1.5)
     241 * @deprecated use bp_is_user()
     242 */
    228243function bp_is_member() {
    229244    _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user' );
     
    231246}
    232247
     248/**
     249 * @deprecated BuddyPress (1.5)
     250 * @deprecated use bp_loggedin_user_link()
     251 */
    233252function bp_loggedinuser_link() {
    234253    _deprecated_function( __FUNCTION__, '1.5', 'bp_logged_in_user_link' );
     
    240259 * Deprecated in 1.5; not used anymore.
    241260 *
     261 * @deprecated BuddyPress (1.5)
    242262 * @return bool
    243263 */
     
    250270 * Template tag version of bp_get_page_title()
    251271 *
    252  * @deprecated 1.5
     272 * @deprecated BuddyPress (1.5)
    253273 * @deprecated Use wp_title()
    254274 * @since BuddyPress (1.0)
     
    261281     * Now, just simply use wp_title().
    262282     *
    263      * @deprecated 1.5
     283     * @deprecated BuddyPress (1.5)
    264284     * @deprecated Use wp_title()
    265285     * @since BuddyPress (1.0)
     
    278298 * Generate a link to log out. Last used in BP 1.2-beta. You should be using wp_logout_url().
    279299 *
    280  * @deprecated 1.5
     300 * @deprecated BuddyPress (1.5)
    281301 * @deprecated Use wp_logout_url()
    282302 * @since BuddyPress (1.0)
     
    292312 * Send an email and a BP notification on receipt of an @-mention in a group
    293313 *
    294  * @deprecated 1.5
     314 * @deprecated BuddyPress (1.5)
    295315 * @deprecated Deprecated in favor of the more general bp_activity_at_message_notification()
    296316 */
    297317function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) {
    298     global $bp;
    299 
    300318    _deprecated_function( __FUNCTION__, '1.5', 'bp_activity_at_message_notification()' );
    301319
     
    361379/**
    362380 * BP 1.5 simplified notification functions a bit
     381 * @deprecated BuddyPress (1.5)
    363382 */
    364383function bp_core_delete_notifications_for_user_by_type( $user_id, $component_name, $component_action ) {
     
    374393/**
    375394 * In BP 1.5, these functions were renamed for greater consistency
     395 * @deprecated BuddyPress (1.5)
    376396 */
    377397function bp_forum_directory_permalink() {
     
    386406/**
    387407 * Last used by core in BP 1.1. The markup was merged into DTheme's header.php template.
     408 * @deprecated BuddyPress (1.5)
    388409 */
    389410function bp_search_form() {
     
    405426/**
    406427 * Some _is_ function had their names normalized
     428 * @deprecated BuddyPress (1.5)
    407429 */
    408430function bp_is_profile_edit() {
     
    411433}
    412434
     435/**
     436 * @deprecated BuddyPress (1.5)
     437 */
    413438function bp_is_change_avatar() {
    414439    _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_change_avatar()' );
     
    416441}
    417442
     443/**
     444 * @deprecated BuddyPress (1.5)
     445 */
    418446function bp_is_friend_requests() {
    419447    _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_friend_requests()' );
     
    426454 * You should be using bp_is_root_component().
    427455 *
    428  * @deprecated 1.5
     456 * @deprecated BuddyPress (1.5)
    429457 * @deprecated bp_is_root_component()
    430458 * @return true if root component, else false.
     
    441469 * in BuddyPress 1.5.
    442470 *
     471 * @deprecated BuddyPress (1.5)
    443472 * @since BuddyPress (1.5)
    444473 */
     
    450479     * include "Activity Stream." As of 1.5.x, it is no longer required.
    451480     *
    452      * @deprecated 1.5
     481     * @deprecated BuddyPress (1.5)
    453482     * @deprecated No longer required.
    454483     * @param string $page_html A list of pages as a dropdown (select list)
     
    468497     * As of 1.5.x, it is no longer required.
    469498     *
    470      * @deprecated 1.5
     499     * @deprecated BuddyPress (1.5)
    471500     * @deprecated No longer required.
    472501     * @param $string $oldvalue Previous value of get_option( 'page_on_front' )
     
    489518     * As of 1.5.x, it is no longer required.
    490519     *
    491      * @deprecated 1.5
     520     * @deprecated BuddyPress (1.5)
    492521     * @deprecated No longer required.
    493522     * @param string $template Absolute path to the page template
     
    506535     * As of 1.5.x, it is no longer required.
    507536     *
    508      * @deprecated 1.5
     537     * @deprecated BuddyPress (1.5)
    509538     * @deprecated No longer required.
    510539     * @since BuddyPress (1.2)
     
    520549     * As of 1.5.x, it is no longer required.
    521550     *
    522      * @deprecated 1.5
     551     * @deprecated BuddyPress (1.5)
    523552     * @deprecated No longer required.
    524553     * @param array $posts Posts as retrieved by WP_Query
     
    537566     * As of 1.5.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php.
    538567     *
    539      * @deprecated 1.5
     568     * @deprecated BuddyPress (1.5)
    540569     * @deprecated Enqueue the comment-reply script in your theme's header.php.
    541570     * @since BuddyPress (1.2)
  • trunk/bp-core/deprecated/1.6.php

    r6448 r6583  
    99 */
    1010
     11// Exit if accessed directly
     12if ( !defined( 'ABSPATH' ) ) exit;
     13
    1114/** Toolbar functions *********************************************************/
    1215
     16/**
     17 * @deprecated BuddyPress (1.6)
     18 */
    1319function bp_admin_bar_remove_wp_menus() {
    1420    _deprecated_function( __FUNCTION__, '1.6' );
    1521}
    1622
     23/**
     24 * @deprecated BuddyPress (1.6)
     25 */
    1726function bp_admin_bar_root_site() {
    1827    _deprecated_function( __FUNCTION__, '1.6' );
    1928}
    2029
     30/**
     31 * @deprecated BuddyPress (1.6)
     32 */
    2133function bp_admin_bar_my_sites_menu() {
    2234    _deprecated_function( __FUNCTION__, '1.6' );
    2335}
    2436
    25 function bp_admin_bar_comments_menu( $wp_admin_bar ) {
    26     _deprecated_function( __FUNCTION__, '1.6' );
    27 }
    28 
     37/**
     38 * @deprecated BuddyPress (1.6)
     39 */
     40function bp_admin_bar_comments_menu( $wp_admin_bar = '' ) {
     41    _deprecated_function( __FUNCTION__, '1.6' );
     42}
     43
     44/**
     45 * @deprecated BuddyPress (1.6)
     46 */
    2947function bp_admin_bar_appearance_menu() {
    3048    _deprecated_function( __FUNCTION__, '1.6' );
    3149}
    3250
     51/**
     52 * @deprecated BuddyPress (1.6)
     53 */
    3354function bp_admin_bar_updates_menu() {
    3455    _deprecated_function( __FUNCTION__, '1.6' );
    3556}
    3657
     58/**
     59 * @deprecated BuddyPress (1.6)
     60 */
    3761function bp_members_admin_bar_my_account_logout() {
    3862    _deprecated_function( __FUNCTION__, '1.6' );
    3963}
    4064
     65/**
     66 * @deprecated BuddyPress (1.6)
     67 */
    4168function bp_core_is_user_deleted( $user_id = 0 ) {
    4269    _deprecated_function( __FUNCTION__, '1.6' );
     
    4471}
    4572
     73/**
     74 * @deprecated BuddyPress (1.6)
     75 */
    4676function bp_core_is_user_spammer( $user_id = 0 ) {
    4777    _deprecated_function( __FUNCTION__, '1.6' );
     
    5585
    5686/**
    57  * @deprecated 1.6
     87 * @deprecated BuddyPress (1.6)
    5888 * @deprecated No longer used; see bp_blogs_transition_activity_status()
    5989 */
     
    6797
    6898/**
    69  * @deprecated 1.6
     99 * @deprecated BuddyPress (1.6)
    70100 * @deprecated No longer used; see BP_Admin::admin_menus()
    71101 */
     
    75105
    76106/**
    77  * @deprecated 1.6
     107 * @deprecated BuddyPress (1.6)
    78108 * @deprecated No longer used. We do ajax properly now.
    79109 */
     
    89119 * Displays Friends header tabs
    90120 *
    91  * @deprecated 1.6
     121 * @deprecated BuddyPress (1.6)
    92122 * @deprecated No longer used
    93123 */
     
    107137 * Filters the title for the Friends component
    108138 *
    109  * @deprecated 1.6
     139 * @deprecated BuddyPress (1.6)
    110140 * @deprecated No longer used
    111141 */
     
    129159
    130160
    131 /**
    132  * Groups functions
    133  */
    134 
    135 /**
    136  * @deprecated 1.6
     161/** Groups functions **********************************************************/
     162
     163/**
     164 * @deprecated BuddyPress (1.6)
    137165 * @deprecated Renamed to groups_get_id() for greater consistency
    138166 */
     
    142170}
    143171
    144 /**
    145  * Admin functions
    146  */
     172/** Admin functions ***********************************************************/
    147173
    148174/**
    149175 * Loads admin panel styles and scripts.
    150176 *
    151  * @deprecated 1.6
    152  * @deprecated No longer used.
     177 * @deprecated BuddyPress (1.6)
    153178 */
    154179function bp_core_add_admin_menu_styles() {
     
    156181}
    157182
    158 /**
    159  * Activity functions
    160  */
    161 
    162 /**
    163  * @deprecated 1.6
    164  * @deprecated No longer used. Renamed to bp_activity_register_activity_actions().
     183/** Activity functions ********************************************************/
     184
     185/**
     186 * @deprecated BuddyPress (1.6)
    165187 */
    166188function updates_register_activity_actions() {
     
    171193 * Sets the "From" address in emails sent
    172194 *
    173  * @deprecated 1.6
    174  * @deprecated No longer used.
     195 * @deprecated BuddyPress (1.6)
    175196 * @return noreply@sitedomain email address
    176197 */
     
    198219 * Note that this hack only runs if the function bp_dtheme_register_actions() is not found (this
    199220 * function was introduced in BP 1.6 for related backward compatibility reasons).
     221 *
     222 * @deprecated BuddyPress (1.6)
    200223 */
    201224if ( !function_exists( 'bp_dtheme_register_actions' ) ) :
     
    250273    add_action( 'after_setup_theme', 'bp_die_legacy_ajax_callbacks', 20 );
    251274endif;
    252 
  • trunk/bp-core/deprecated/1.7.php

    r6558 r6583  
    1515 *
    1616 * @since BuddyPress (1.6)
     17 * @deprecated BuddyPress (1.7)
    1718 * @uses bp_get_maintenance_mode() To get the BuddyPress maintenance mode
    1819 */
     
    2425     *
    2526     * @since BuddyPress (1.6)
     27     * @deprecated BuddyPress (1.7)
    2628     * @return string The BuddyPress maintenance mode
    2729     */
     
    3032    }
    3133
     34/**
     35 * @deprecated BuddyPress (1.7)
     36 */
    3237function xprofile_get_profile() {
    3338    _deprecated_function( __FUNCTION__, '1.7' );
     
    3540}
    3641
     42/**
     43 * @deprecated BuddyPress (1.7)
     44 */
    3745function bp_get_profile_header() {
    3846    _deprecated_function( __FUNCTION__, '1.7' );
     
    4048}
    4149
     50/**
     51 * @deprecated BuddyPress (1.7)
     52 * @param string $component_name
     53 * @return boolean
     54 */
    4255function bp_exists( $component_name ) {
    4356    _deprecated_function( __FUNCTION__, '1.7' );
     
    4861}
    4962
     63/**
     64 * @deprecated BuddyPress (1.7)
     65 */
    5066function bp_get_plugin_sidebar() {
    5167    _deprecated_function( __FUNCTION__, '1.7' );
     
    5975 * step. It also means that the themes won't show for selection on other blogs.
    6076 *
     77 * @deprecated BuddyPress (1.7)
    6178 * @package BuddyPress Core
    6279 */
     
    91108 * The administrator will be shown a notice for each check that fails.
    92109 *
     110 * @deprecated BuddyPress (1.7)
    93111 * @package BuddyPress Core
    94112 */
     
    211229    }
    212230}
     231
     232/**
     233 * This function was originally used to update pre-1.1 schemas, but that was
     234 * before we had a legitimate update process.
     235 *
     236 * @deprecated BuddyPress (1.7)
     237 * @global WPDB $wpdb
     238 */
     239function bp_update_db_stuff() {
     240    global $wpdb;
     241
     242    $bp        = buddypress();
     243    $bp_prefix = bp_core_get_table_prefix();
     244
     245    // Rename the old user activity cached table if needed.
     246    if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) ) {
     247        $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );
     248    }
     249
     250    // Rename fields from pre BP 1.2
     251    if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) {
     252        if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) {
     253            $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );
     254        }
     255
     256        if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) {
     257            $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );
     258        }
     259    }
     260
     261    // On first installation - record all existing blogs in the system.
     262    if ( !(int) $bp->site_options['bp-blogs-first-install'] ) {
     263        bp_blogs_record_existing_blogs();
     264        bp_update_option( 'bp-blogs-first-install', 1 );
     265    }
     266
     267    if ( is_multisite() ) {
     268        bp_core_add_illegal_names();
     269    }
     270
     271    // Update and remove the message threads table if it exists
     272    if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) {
     273        if ( BP_Messages_Thread::update_tables() ) {
     274            $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" );
     275        }
     276    }
     277}
Note: See TracChangeset for help on using the changeset viewer.