Skip to:
Content

BuddyPress.org

Changeset 3736 for trunk/bp-loader.php


Ignore:
Timestamp:
01/18/2011 10:46:09 PM (14 years ago)
Author:
boonebgorges
Message:

Modifies upgrade routine so that a site's front-end can continue to be accessible after a BP upgrade but before the wizard has been completed. Adds upgrade nags to the Dashboard. Fixes #2789. Props r-a-y and DJPaul for earlier patches and help testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r3728 r3736  
    1111
    1212define( 'BP_VERSION', '1.3-bleeding' );
    13 define( 'BP_DB_VERSION', 1225 );
     13define( 'BP_DB_VERSION', 3705 );
    1414
    1515// Define on which blog ID BuddyPress should run
     
    1717    define( 'BP_ROOT_BLOG', 1 );
    1818
    19 /***
    20  * Check if this is the first time BuddyPress has been loaded, or the first time
    21  * since an update. If so, load the install/update routine only.
    22  */
    23 if ( get_site_option( 'bp-db-version' ) < constant( 'BP_DB_VERSION' ) ) {
     19// Register BuddyPress themes contained within the bp-themes folder
     20register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
     21     
     22// Test to see whether this is a new installation or an upgraded version of BuddyPress
     23$bp_db_version = get_site_option( 'bp-db-version' );
     24if ( ! $bp_db_version )
     25    $bp_db_version = get_site_option( 'bp-core-db-version' );  // BP 1.2 option name
     26     
     27if ( ! $bp_db_version ) {
     28    // This is a new installation. Run the wizard before loading BP core files
     29    define( 'BP_IS_INSTALL', true );
    2430    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
    25 
    26 /***
    27  * If the install or update routine is completed and everything is up to date
    28  * continue loading BuddyPress as normal.
    29  */
    3031} else {
    3132    /***
     
    6566    if ( !isset( $bp_deactivated['bp-xprofile.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') )
    6667        include( BP_PLUGIN_DIR . '/bp-xprofile.php' );
     68       
     69    // If this is an upgrade, load the upgrade file
     70    if ( $bp_db_version < constant( 'BP_DB_VERSION' ) ) {
     71        define( 'BP_IS_UPGRADE', true );
     72        require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
     73    }
    6774
    6875    add_action( 'plugins_loaded', 'bp_loaded', 20 );
     
    136143}
    137144
    138 // Activation Function
     145/**
     146 * Defines BP's activation routine.
     147 *
     148 * Most of BP's crucial setup is handled by the setup wizard. This function takes care of some
     149 * issues with incompatible legacy themes, and provides a hook for other functions to know that
     150 * BP has been activated.
     151 *
     152 * @package BuddyPress Core
     153*/
    139154function bp_loader_activate() {
    140155    // Force refresh theme roots.
    141156    delete_site_transient( 'theme_roots' );
     157
     158    if ( !function_exists( 'get_blog_option' ) )
     159        require ( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-wpabstraction.php' );
    142160
    143161    // Switch the user to the new bp-default if they are using the old
Note: See TracChangeset for help on using the changeset viewer.