Skip to:
Content

BuddyPress.org

Changeset 1262 for trunk/bp-core.php


Ignore:
Timestamp:
03/26/2009 11:20:12 AM (18 years ago)
Author:
apeatling
Message:

Selectively including files that only need to be included at specific times.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1250 r1262  
    1414define( 'BP_CORE_DB_VERSION', '1030' );
    1515
     16/* Place your custom code (actions/filters) in a file called bp-custom.php and it will be loaded before anything else. */
     17if ( file_exists( WPMU_PLUGIN_DIR . '/bp-custom.php' ) )
     18        require( WPMU_PLUGIN_DIR . '/bp-custom.php' );
     19
    1620/* Load the language file */
    1721if ( file_exists( WPMU_PLUGIN_DIR . '/bp-languages/buddypress-' . get_locale() . '.mo' ) )
    1822        load_textdomain( 'buddypress', WPMU_PLUGIN_DIR . '/bp-languages/buddypress-' . get_locale() . '.mo' );
    1923
    20 /* Place your custom code (actions/filters) in a file called bp-custom.php and it will be loaded before anything else. */
    21 if ( file_exists( WPMU_PLUGIN_DIR . '/bp-custom.php' ) )
    22         require( WPMU_PLUGIN_DIR . '/bp-custom.php' );
    23 
     24/* Load the files containing functions that we globally will need. */
    2425require ( 'bp-core/bp-core-catchuri.php' );
    2526require ( 'bp-core/bp-core-classes.php' );
    … …  
    3233require ( 'bp-core/bp-core-ajax.php' );
    3334require ( 'bp-core/bp-core-notifications.php' );
    34 require ( 'bp-core/bp-core-admin.php' );
    35 require ( 'bp-core/bp-core-signup.php' );
    36 require ( 'bp-core/bp-core-activation.php' );
    3735
    3836/* Define the slug for member pages and the members directory (e.g. domain.com/[members] ) */
    … …  
    9290        $bp->displayed_user->domain = bp_core_get_user_domain($displayed_user_id);
    9391       
    94         /* The component being used eg: http://andy.domain.com/ [profile] */
     92        /* The component being used eg: http://domain.com/members/andy/ [profile] */
    9593        $bp->current_component = $current_component; // type: string
    9694       
    97         /* The current action for the component eg: http://andy.domain.com/profile/ [edit] */
     95        /* The current action for the component eg: http://domain.com/members/andy/profile/ [edit] */
    9896        $bp->current_action = $current_action; // type: string
    9997       
    100         /* The action variables for the current action eg: http://andy.domain.com/profile/edit/ [group] / [6] */
     98        /* The action variables for the current action eg: http://domain.com/members/andy/profile/edit/ [group] / [6] */
    10199        $bp->action_variables = $action_variables; // type: array
    102100       
    103         /* Only used where a component has a sub item, e.g. groups: http://andy.domain.com/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.*/
     101        /* Only used where a component has a sub item, e.g. groups: http://domain.com/members/andy/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.*/
    104102        $bp->current_item = ''; // type: string
    105103
    … …  
    107105        $bp->is_single_item = false;
    108106
    109         /* The default component to use if none are set and someone visits: http://andy.domain.com/ */
     107        /* The default component to use if none are set and someone visits: http://domain.com/members/andy */
    110108        $bp->default_component = 'profile';
    111109       
    … …  
    224222        global $wpdb, $bp;
    225223
    226         if ( is_site_admin() ) {
    227                 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    228                 if ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION )
    229                         bp_core_install();
    230         }
     224        if ( !is_site_admin() )
     225                return false;
     226       
     227        require ( 'bp-core/bp-core-admin.php' );
     228
     229        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
     230        if ( get_site_option('bp-core-db-version') < BP_CORE_DB_VERSION )
     231                bp_core_install();
    231232}
    232233add_action( 'admin_menu', 'bp_core_check_installed' );
    … …  
    246247        global $wpdb, $bp;
    247248       
    248         if ( is_site_admin() ) {
    249                 /* Add the administration tab under the "Site Admin" tab for site administrators */
    250                 add_submenu_page( 'wpmu-admin.php', __("BuddyPress", 'buddypress'), __("BuddyPress", 'buddypress'), 1, "bp_core_admin_settings", "bp_core_admin_settings" );
    251         }
     249        if ( !is_site_admin() )
     250                return false;
     251               
     252        /* Add the administration tab under the "Site Admin" tab for site administrators */
     253        add_submenu_page( 'wpmu-admin.php', __("BuddyPress", 'buddypress'), __("BuddyPress", 'buddypress'), 1, "bp_core_admin_settings", "bp_core_admin_settings" );
     254
    252255}
    253256add_action( 'admin_menu', 'bp_core_add_admin_menu' );
Note: See TracChangeset for help on using the changeset viewer.