| 1 | <?php
|
|---|
| 2 | /*
|
|---|
| 3 | Plugin Name: BuddyPress
|
|---|
| 4 | Plugin URI: http://buddypress.org/download/
|
|---|
| 5 | Description: BuddyPress will add social networking features to a new or existing WordPress MU installation.
|
|---|
| 6 | Author: The BuddyPress Community
|
|---|
| 7 | Version: 1.2-rc3
|
|---|
| 8 | Author URI: http://buddypress.org/developers/
|
|---|
| 9 | Network: true
|
|---|
| 10 | */
|
|---|
| 11 |
|
|---|
| 12 | define( 'BP_VERSION', '1.2-rc3' );
|
|---|
| 13 |
|
|---|
| 14 | /***
|
|---|
| 15 | * This file will load in each BuddyPress component based on which
|
|---|
| 16 | * of the components have been activated on the "BuddyPress" admin menu.
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );
|
|---|
| 20 | $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
|
|---|
| 21 |
|
|---|
| 22 | do_action( 'bp_core_loaded' );
|
|---|
| 23 |
|
|---|
| 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' );
|
|---|
| 27 |
|
|---|
| 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' );
|
|---|
| 31 |
|
|---|
| 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' );
|
|---|
| 35 |
|
|---|
| 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' );
|
|---|
| 39 |
|
|---|
| 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' );
|
|---|
| 43 |
|
|---|
| 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' );
|
|---|
| 47 |
|
|---|
| 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' );
|
|---|
| 51 |
|
|---|
| 52 | /* Allow dependent plugins to hook into BuddyPress in a safe way */
|
|---|
| 53 | function bp_loaded() {
|
|---|
| 54 | do_action( 'bp_init' );
|
|---|
| 55 | }
|
|---|
| 56 | add_action( 'plugins_loaded', 'bp_loaded' );
|
|---|
| 57 |
|
|---|
| 58 | /* Activation Function */
|
|---|
| 59 | function bp_loader_activate() {
|
|---|
| 60 | /* Force refresh theme roots. */
|
|---|
| 61 | delete_site_transient( 'theme_roots' );
|
|---|
| 62 |
|
|---|
| 63 | /* Switch the user to the new bp-default if they are using the old bp-default on activation. */
|
|---|
| 64 | if ( 'bp-sn-parent' == get_blog_option( BP_ROOT_BLOG, 'template' ) && 'bp-default' == get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) )
|
|---|
| 65 | switch_theme( 'bp-default', 'bp-default' );
|
|---|
| 66 |
|
|---|
| 67 | do_action( 'bp_loader_activate' );
|
|---|
| 68 | }
|
|---|
| 69 | register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
|
|---|
| 70 |
|
|---|
| 71 | /* Deactivation Function */
|
|---|
| 72 | function bp_loader_deactivate() {
|
|---|
| 73 | if ( !function_exists( 'delete_site_option') )
|
|---|
| 74 | return false;
|
|---|
| 75 |
|
|---|
| 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' );
|
|---|
| 83 | delete_site_option( 'bp-deactivated-components' );
|
|---|
| 84 | delete_site_option( 'bp-blogs-first-install' );
|
|---|
| 85 |
|
|---|
| 86 | do_action( 'bp_loader_deactivate' );
|
|---|
| 87 | }
|
|---|
| 88 | register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );
|
|---|
| 89 |
|
|---|
| 90 | ?>
|
|---|