Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/12/2010 06:33:05 AM (16 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2561 props wpmuguru

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core.php

    r3185 r3186  
    8585 */
    8686function bp_core_setup_globals() {
    87     global $bp, $wpdb;
     87    global $bp;
    8888    global $current_user, $current_component, $current_action, $current_blog;
    8989    global $displayed_user_id;
     
    9191
    9292    $current_user = wp_get_current_user();
     93
     94    /* Get the base database prefix */
     95    $bp->table_prefix = bp_core_get_table_prefix();
    9396
    9497    /* The domain for the root of the site where the main blog resides */
     
    154157
    155158    /* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */
    156     $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', $bp->site_options['user-avatar-default'] );
     159    $bp->grav_default->user  = apply_filters( 'bp_user_gravatar_default', $bp->site_options['user-avatar-default'] );
    157160    $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' );
    158     $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', 'identicon' );
     161    $bp->grav_default->blog  = apply_filters( 'bp_blog_gravatar_default', 'identicon' );
    159162
    160163    /* Fetch the full name for the logged in and current user */
    161     $bp->loggedin_user->fullname = bp_core_get_user_displayname( $bp->loggedin_user->id );
     164    $bp->loggedin_user->fullname  = bp_core_get_user_displayname( $bp->loggedin_user->id );
    162165    $bp->displayed_user->fullname = bp_core_get_user_displayname( $bp->displayed_user->id );
    163166
     
    171174    $bp->is_item_mod = false;
    172175
    173     $bp->core->table_name_notifications = $wpdb->base_prefix . 'bp_notifications';
     176    $bp->core->table_name_notifications = $bp->table_prefix . 'bp_notifications';
    174177
    175178    if ( !$bp->current_component && $bp->displayed_user->id )
     
    199202add_action( 'bp_setup_root_components', 'bp_core_setup_root_uris' );
    200203
     204/**
     205 * bp_core_get_table_prefix()
     206 *
     207 * Allow filtering of database prefix. Intended for use in multinetwork installations.
     208 *
     209 * @global object $wpdb WordPress database object
     210 * @return string Filtered database prefix
     211 */
     212function bp_core_get_table_prefix() {
     213    global $wpdb;
     214
     215    return apply_filters( 'bp_core_get_table_prefix', $wpdb->base_prefix );
     216}
    201217
    202218/**
     
    252268 * @package BuddyPress Core
    253269 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
    254  * @global $wpdb WordPress DB access object.
    255270 * @global $current_user WordPress global variable containing current logged in user information
    256271 * @uses is_site_admin() returns true if the current user is a site admin, false if not
     
    259274 */
    260275function bp_core_check_installed() {
    261     global $wpdb, $bp;
     276    global $bp;
    262277
    263278    if ( !is_site_admin() )
     
    279294 * @package BuddyPress Core
    280295 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
    281  * @global $wpdb WordPress DB access object.
    282296 * @uses is_site_admin() returns true if the current user is a site admin, false if not
    283297 * @uses add_submenu_page() WP function to add a submenu item
     
    934948 * @package BuddyPress Core
    935949 * @param $username str Username to check.
    936  * @global $wpdb WordPress DB access object.
    937950 * @return false on no match
    938951 * @return int the user ID of the matched user.
     
    976989 * @package BuddyPress Core
    977990 * @param $username str Username to check.
    978  * @global $wpdb WordPress DB access object.
    979991 * @return false on no match
    980992 * @return int the user ID of the matched user.
    981993 */
    982994function bp_core_get_random_member() {
    983     global $bp, $wpdb;
     995    global $bp;
    984996
    985997    if ( isset( $_GET['random-member'] ) ) {
     
    17091721 */
    17101722function bp_core_delete_account( $user_id = false ) {
    1711     global $bp, $wpdb, $wp_version;
     1723    global $bp, $wp_version;
    17121724
    17131725    if ( !$user_id )
     
    18431855 */
    18441856function bp_core_print_generation_time() {
    1845     global $wpdb;
    1846     ?>
     1857?>
    18471858
    18481859<!-- Generated in <?php timer_stop(1); ?> seconds. -->
Note: See TracChangeset for help on using the changeset viewer.