Skip to:
Content

BuddyPress.org

Changeset 3994 for trunk/bp-loader.php


Ignore:
Timestamp:
02/02/2011 04:35:06 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Remove temporary bp-core-bootstrap file and move procedure into BP_Core component. Update loaders accordingly. Also introduce optional_components and required_components global $bp values for additional future usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r3946 r3994  
    99 * Network:     true
    1010 */
     11
    1112/** Constants *****************************************************************/
    1213
     
    1819if ( !defined( 'BP_DB_VERSION' ) )
    1920    define( 'BP_DB_VERSION', 3605 );
     21
     22// Place your custom code (actions/filters) in a file called
     23// '/plugins/bp-custom.php' and it will be loaded before anything else.
     24if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
     25    require_once( WP_PLUGIN_DIR . '/bp-custom.php' );
    2026
    2127// Define on which blog ID BuddyPress should run
     
    3036    define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
    3137
    32 // Load the WP abstraction file so BuddyPress can run on all WordPress setups.
    33 require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
    34 
    35 // Place your custom code (actions/filters) in a file called
    36 // '/plugins/bp-custom.php' and it will be loaded before anything else.
    37 if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
    38     require_once( WP_PLUGIN_DIR . '/bp-custom.php' );
    39 
    4038// Define the user and usermeta table names, useful if you are using custom or shared tables.
    4139if ( !defined( 'CUSTOM_USER_TABLE' ) )
     
    4947    define( 'BP_SEARCH_SLUG', 'search' );
    5048
     49// Setup the BuddyPress theme directory
     50register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
     51
    5152/** Loader ********************************************************************/
    5253
    53 require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-bootstrap.php' );
     54// Load the WP abstraction file so BuddyPress can run on all WordPress setups.
     55require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
     56
     57// Test to see whether this is a new installation or an upgraded version of BuddyPress
     58if ( !$bp->database_version = get_site_option( 'bp-db-version' ) )
     59    $bp->database_version = get_site_option( 'bp-core-db-version' );  // BP 1.2 option name
     60
     61// This is a new installation.
     62if ( empty( $bp->database_version ) ) {
     63    $bp->maintenence_mode = 'install';
     64    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
     65
     66// An update is required
     67} elseif ( $bp->database_version < constant( 'BP_DB_VERSION' ) ) {
     68    $bp->maintenence_mode = 'update';
     69    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
     70
     71// Existing installation - No maintenence required
     72} else {
     73    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-loader.php' );
     74}
     75
     76/** Activation ****************************************************************/
    5477
    5578if ( !function_exists( 'bp_loader_activate' ) ) :
Note: See TracChangeset for help on using the changeset viewer.