Skip to:
Content

BuddyPress.org

Changeset 3757 for trunk/bp-loader.php


Ignore:
Timestamp:
01/20/2011 10:53:49 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Second pass at huge component refactor.

Move component files out of root directory and append '-loader' to the file names. Split those files up into smaller pieces.

Abstract 'settings' component out of 'core' and into its own component for future extension, including new template files in bp-default.

Append '-sa' to bbPress bridge file for 'Stand Alone' compatibility, to make room for bbPress plugin compatibility layer.

Various bug fixes through-out all components. Various code clean-up and documentation through-out all components.

Still more refactoring to do.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r3743 r3757  
    11<?php
    2 /*
    3 Plugin Name: BuddyPress
    4 Plugin URI: http://buddypress.org
    5 Description: 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.
    6 Author: The BuddyPress Community
    7 Version: 1.3-bleeding
    8 Author URI: http://buddypress.org/community/members/
    9 Network: true
    10 */
     2/**
     3 * Plugin Name: BuddyPress
     4 * Plugin URI:  http://buddypress.org
     5 * Description: 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.
     6 * Author:      The BuddyPress Community
     7 * Version:     1.3-bleeding
     8 * Author URI:  http://buddypress.org/community/members/
     9 * Network:     true
     10 */
     11
     12/** Constants *****************************************************************/
    1113
    1214define( 'BP_VERSION', '1.3-bleeding' );
    13 define( 'BP_DB_VERSION', 3705 );
     15define( 'BP_DB_VERSION', 3605 );
    1416
    1517// Define on which blog ID BuddyPress should run
    1618if ( !defined( 'BP_ROOT_BLOG' ) )
    1719    define( 'BP_ROOT_BLOG', 1 );
     20
     21// Path and URL
     22define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
     23define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
     24
     25// Load the WP abstraction file so BuddyPress can run on all WordPress setups.
     26require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
     27
     28// Place your custom code (actions/filters) in a file called
     29// '/plugins/bp-custom.php' and it will be loaded before anything else.
     30if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
     31    require( WP_PLUGIN_DIR . '/bp-custom.php' );
     32
     33// Define the user and usermeta table names, useful if you are using custom or shared tables.
     34if ( !defined( 'CUSTOM_USER_TABLE' ) )
     35    define( 'CUSTOM_USER_TABLE',      $wpdb->base_prefix . 'users' );
     36
     37if ( !defined( 'CUSTOM_USER_META_TABLE' ) )
     38    define( 'CUSTOM_USER_META_TABLE', $wpdb->base_prefix . 'usermeta' );
     39
     40// The search slug has to be defined nice and early because of the way search requests are loaded
     41if ( !defined( 'BP_SEARCH_SLUG' ) )
     42    define( 'BP_SEARCH_SLUG', 'search' );
     43
     44/** Loader ********************************************************************/
    1845
    1946// Register BuddyPress themes contained within the bp-themes folder
     
    3158// Existing successful installation
    3259} else {
     60
    3361    /***
    3462     * This file will load in each BuddyPress component based on which
    3563     * of the components have been activated on the "BuddyPress" admin menu.
    3664     */
    37     require_once( WP_PLUGIN_DIR . '/buddypress/bp-core.php' );
     65    require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-loader.php' );
    3866    $bp_deactivated = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
    3967
     
    4775    do_action( 'bp_core_loaded' );
    4876
     77    // Users
     78    include( BP_PLUGIN_DIR . '/bp-users/bp-users-loader.php'       );
     79    include( BP_PLUGIN_DIR . '/bp-settings/bp-settings-loader.php' );
     80
    4981    // Activity Streams
    50     if ( !isset( $bp_deactivated['bp-activity.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-activity.php') )
    51         include( BP_PLUGIN_DIR . '/bp-activity.php' );
     82    if ( !isset( $bp_deactivated['bp-activity/bp-activity-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php') )
     83        include( BP_PLUGIN_DIR . '/bp-activity/bp-activity-loader.php' );
    5284
    5385    // Blog Tracking
    54     if ( !isset( $bp_deactivated['bp-blogs.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-blogs.php') )
    55         include( BP_PLUGIN_DIR . '/bp-blogs.php' );
     86    if ( !isset( $bp_deactivated['bp-blogs/bp-blogs-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php') )
     87        include( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-loader.php' );
    5688
    5789    // bbPress Forum Integration
    58     if ( !isset( $bp_deactivated['bp-forums.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-forums.php') )
    59         include( BP_PLUGIN_DIR . '/bp-forums.php' );
     90    if ( !isset( $bp_deactivated['bp-forums/bp-forums-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php') )
     91        include( BP_PLUGIN_DIR . '/bp-forums/bp-forums-loader.php' );
    6092
    6193    // Friend Connections
    62     if ( !isset( $bp_deactivated['bp-friends.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-friends.php') )
    63         include( BP_PLUGIN_DIR . '/bp-friends.php' );
     94    if ( !isset( $bp_deactivated['bp-friends/bp-friends-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php') )
     95        include( BP_PLUGIN_DIR . '/bp-friends/bp-friends-loader.php' );
    6496
    6597    // Groups Support
    66     if ( !isset( $bp_deactivated['bp-groups.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-groups.php') )
    67         include( BP_PLUGIN_DIR . '/bp-groups.php' );
     98    if ( !isset( $bp_deactivated['bp-groups/bp-groups-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php') )
     99        include( BP_PLUGIN_DIR . '/bp-groups/bp-groups-loader.php' );
    68100
    69101    // Private Messaging
    70     if ( !isset( $bp_deactivated['bp-messages.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-messages.php') )
    71         include( BP_PLUGIN_DIR . '/bp-messages.php' );
     102    if ( !isset( $bp_deactivated['bp-messages/bp-messages-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php') )
     103        include( BP_PLUGIN_DIR . '/bp-messages/bp-messages-loader.php' );
    72104
    73105    // Extended Profiles
    74     if ( !isset( $bp_deactivated['bp-xprofile.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile.php') )
    75         include( BP_PLUGIN_DIR . '/bp-xprofile.php' );
     106    if ( !isset( $bp_deactivated['bp-xprofile/bp-xprofile-loader.php'] ) && file_exists( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php') )
     107        include( BP_PLUGIN_DIR . '/bp-xprofile/bp-xprofile-loader.php' );
    76108       
    77109    // If this is an upgrade, load the upgrade file
     
    83115
    84116/********************************************************************************
    85  * Custom Actions
    86  *
    87117 * Functions to set up custom BuddyPress actions that components should
    88118 * hook in to.
     
    136166function bp_loaded() {
    137167    do_action( 'bp_loaded' );
     168}
     169
     170/**
     171 * Attach potential template screens
     172 */
     173function bp_screens() {
     174    do_action( 'bp_screens' );
    138175}
    139176
Note: See TracChangeset for help on using the changeset viewer.