Skip to:
Content

BuddyPress.org

Changeset 2863 for trunk/bp-loader.php


Ignore:
Timestamp:
03/22/2010 11:34:23 AM (15 years ago)
Author:
apeatling
Message:

Added new install/upgrade wizard. Removed root components and replaced them with actual WordPress pages. Testing on WordPress vhost/novhost and root profile support still to do.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r2844 r2863  
    55Description: Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress.
    66Author: The BuddyPress Community
    7 Version: 1.2.2
     7Version: 1.3-bleeding
    88Author URI: http://buddypress.org/developers/
    99Site Wide Only: true
    1010*/
    1111
    12 define( 'BP_VERSION', '1.2.2' );
     12define( 'BP_VERSION', '1.3-bleeding' );
     13define( 'BP_DB_VERSION', 1225 );
    1314
    1415/***
    15  * This file will load in each BuddyPress component based on which
    16  * of the components have been activated on the "BuddyPress" admin menu.
     16 * Check if this is the first time BuddyPress has been loaded, or the first time
     17 * since an upgrade. If so, load the install/upgrade routine only.
    1718 */
     19if ( get_site_option( 'bp-db-version' ) < constant( 'BP_DB_VERSION' ) ) {
     20    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-upgrade.php' );
    1821
    19 require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );
    20 $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
     22/***
     23 * If the install or upgrade routine is completed and everything is up to date
     24 * continue loading BuddyPress as normal.
     25 */
     26} else {
     27    /***
     28     * This file will load in each BuddyPress component based on which
     29     * of the components have been activated on the "BuddyPress" admin menu.
     30     */
     31    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );
     32    $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
    2133
    22 do_action( 'bp_core_loaded' );
     34    do_action( 'bp_core_loaded' );
    2335
    24 /* Activity Streams */
    25 if ( !isset( $bp_deactivated['bp-activity.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-activity.php') )
    26     include( BP_PLUGIN_DIR . '/bp-activity.php' );
     36    /* Activity Streams */
     37    if ( !isset( $bp_deactivated['bp-activity.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-activity.php') )
     38        include( BP_PLUGIN_DIR . '/bp-activity.php' );
    2739
    28 /* Blog Tracking */
    29 if ( !isset( $bp_deactivated['bp-blogs.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-blogs.php') )
    30     include( BP_PLUGIN_DIR . '/bp-blogs.php' );
     40    /* Blog Tracking */
     41    if ( !isset( $bp_deactivated['bp-blogs.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-blogs.php') )
     42        include( BP_PLUGIN_DIR . '/bp-blogs.php' );
    3143
    32 /* bbPress Forum Integration */
    33 if ( !isset( $bp_deactivated['bp-forums.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-forums.php') )
    34     include( BP_PLUGIN_DIR . '/bp-forums.php' );
     44    /* bbPress Forum Integration */
     45    if ( !isset( $bp_deactivated['bp-forums.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-forums.php') )
     46        include( BP_PLUGIN_DIR . '/bp-forums.php' );
    3547
    36 /* Friend Connections */
    37 if ( !isset( $bp_deactivated['bp-friends.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-friends.php') )
    38     include( BP_PLUGIN_DIR . '/bp-friends.php' );
     48    /* Friend Connections */
     49    if ( !isset( $bp_deactivated['bp-friends.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-friends.php') )
     50        include( BP_PLUGIN_DIR . '/bp-friends.php' );
    3951
    40 /* Groups Support */
    41 if ( !isset( $bp_deactivated['bp-groups.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-groups.php') )
    42     include( BP_PLUGIN_DIR . '/bp-groups.php' );
     52    /* Groups Support */
     53    if ( !isset( $bp_deactivated['bp-groups.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-groups.php') )
     54        include( BP_PLUGIN_DIR . '/bp-groups.php' );
    4355
    44 /* Private Messaging */
    45 if ( !isset( $bp_deactivated['bp-messages.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-messages.php') )
    46     include( BP_PLUGIN_DIR . '/bp-messages.php' );
     56    /* Private Messaging */
     57    if ( !isset( $bp_deactivated['bp-messages.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-messages.php') )
     58        include( BP_PLUGIN_DIR . '/bp-messages.php' );
    4759
    48 /* Extended Profiles */
    49 if ( !isset( $bp_deactivated['bp-xprofile.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') )
    50     include( BP_PLUGIN_DIR . '/bp-xprofile.php' );
     60    /* Extended Profiles */
     61    if ( !isset( $bp_deactivated['bp-xprofile.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') )
     62        include( BP_PLUGIN_DIR . '/bp-xprofile.php' );
    5163
    52 /* Allow dependent plugins to hook into BuddyPress in a safe way */
    53 function bp_loaded() {
    54     do_action( 'bp_init' );
     64    /* Allow dependent plugins to hook into BuddyPress in a safe way */
     65    function bp_loaded() {
     66        do_action( 'bp_init' );
     67    }
     68    add_action( 'plugins_loaded', 'bp_loaded' );
    5569}
    56 add_action( 'plugins_loaded', 'bp_loaded' );
    5770
    5871/* Activation Function */
     
    7487        return false;
    7588
    76     delete_site_option( 'bp-core-db-version' );
    77     delete_site_option( 'bp-activity-db-version' );
    78     delete_site_option( 'bp-blogs-db-version' );
    79     delete_site_option( 'bp-friends-db-version' );
    80     delete_site_option( 'bp-groups-db-version' );
    81     delete_site_option( 'bp-messages-db-version' );
    82     delete_site_option( 'bp-xprofile-db-version' );
    8389    delete_site_option( 'bp-deactivated-components' );
    8490    delete_site_option( 'bp-blogs-first-install' );
     91    delete_site_option( 'bp-pages' );
    8592
    8693    do_action( 'bp_loader_deactivate' );
Note: See TracChangeset for help on using the changeset viewer.