Skip to:
Content

BuddyPress.org

Changeset 1262 for trunk/bp-groups.php


Ignore:
Timestamp:
03/26/2009 11:20:12 AM (15 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-groups.php

    r1255 r1262  
    99Site Wide Only: true
    1010*/
    11 
     11 
    1212require_once( 'bp-core.php' );
    1313
     
    2323require ( 'bp-groups/bp-groups-templatetags.php' );
    2424require ( 'bp-groups/bp-groups-widgets.php' );
    25 require ( 'bp-groups/bp-groups-notifications.php' );
    2625require ( 'bp-groups/bp-groups-filters.php' );
    27 require ( 'bp-groups/bp-groups-admin.php' );
    2826
    2927/**************************************************************************
     
    161159    global $wpdb, $bp;
    162160   
    163     if ( is_site_admin() ) {
    164         /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    165         if ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION )
    166             groups_install();
    167     }
     161    if ( !is_site_admin() )
     162        return false;
     163
     164    require ( 'bp-groups/bp-groups-admin.php' );
     165
     166    /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
     167    if ( get_site_option('bp-groups-db-version') < BP_GROUPS_DB_VERSION )
     168        groups_install();
    168169}
    169170add_action( 'admin_menu', 'groups_check_installed' );
     
    172173    global $wpdb, $bp;
    173174   
    174     if ( is_site_admin() ) {
    175         /* Add the administration tab under the "Site Admin" tab for site administrators */
    176         add_submenu_page( 'wpmu-admin.php', __("Groups", 'buddypress'), __("Groups", 'buddypress'), 1, "groups_admin_settings", "groups_admin_settings" );
    177     }
     175    if ( !is_site_admin() )
     176        return false;
     177       
     178    /* Add the administration tab under the "Site Admin" tab for site administrators */
     179    add_submenu_page( 'wpmu-admin.php', __("Groups", 'buddypress'), __("Groups", 'buddypress'), 1, "groups_admin_settings", "groups_admin_settings" );
    178180}
    179181add_action( 'admin_menu', 'groups_add_admin_menu' );
     
    17401742            return false;
    17411743    }
     1744   
     1745    require_once ( 'bp-groups/bp-groups-notifications.php' );
    17421746
    17431747    // Send friend invites.
     
    19011905        return false;
    19021906
    1903     if ( $notify_members )
     1907    if ( $notify_members ) {
     1908        require_once ( 'bp-groups/bp-groups-notifications.php' );
    19041909        groups_notification_group_updated( $group->id );
    1905 
     1910    }
     1911       
    19061912    do_action( 'groups_details_updated', $group->id );
    19071913   
     
    20252031    if ( $requesting_user->save() ) {
    20262032        $admins = groups_get_group_admins( $group_id );
    2027        
     2033
     2034        require_once ( 'bp-groups/bp-groups-notifications.php' );
     2035
    20282036        for ( $i = 0; $i < count( $admins ); $i++ ) {
    20292037            // Saved okay, now send the email notification
     
    20582066
    20592067    /* Send a notification to the user. */
     2068    require_once ( 'bp-groups/bp-groups-notifications.php' );
    20602069    groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, true );
    20612070   
     
    20772086   
    20782087    // Send a notification to the user.
     2088    require_once ( 'bp-groups/bp-groups-notifications.php' );
    20792089    groups_notification_membership_request_completed( $membership->user_id, $membership->group_id, false );
    20802090   
Note: See TracChangeset for help on using the changeset viewer.