Skip to:
Content

BuddyPress.org

Changeset 3186


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

Fixes #2561 props wpmuguru

Location:
branches/1.2
Files:
8 edited

Legend:

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

    r3167 r3186  
    7474
    7575function bp_activity_setup_globals() {
    76     global $bp, $wpdb, $current_blog;
     76    global $bp, $current_blog;
    7777
    7878    /* Internal identifier */
    7979    $bp->activity->id = 'activity';
    8080
    81     $bp->activity->table_name = $wpdb->base_prefix . 'bp_activity';
    82     $bp->activity->table_name_meta = $wpdb->base_prefix . 'bp_activity_meta';
    8381    $bp->activity->slug = BP_ACTIVITY_SLUG;
     82
     83    $bp->activity->table_name      = $bp->table_prefix . 'bp_activity';
     84    $bp->activity->table_name_meta = $bp->table_prefix . 'bp_activity_meta';
     85
    8486    $bp->activity->format_notification_function = 'bp_activity_format_notifications';
    8587
     
    9294
    9395function bp_activity_check_installed() {
    94     global $wpdb, $bp;
     96    global $bp;
    9597
    9698    if ( get_site_option( 'bp-activity-db-version' ) < BP_ACTIVITY_DB_VERSION )
     
    624626
    625627function bp_activity_add( $args = '' ) {
    626     global $bp, $wpdb;
     628    global $bp;
    627629
    628630    $defaults = array(
  • branches/1.2/bp-blogs.php

    r3153 r3186  
    6969    $bp->blogs->id = 'blogs';
    7070
    71     $bp->blogs->table_name = $wpdb->base_prefix . 'bp_user_blogs';
    72     $bp->blogs->table_name_blogmeta = $wpdb->base_prefix . 'bp_user_blogs_blogmeta';
     71    $bp->blogs->slug = BP_BLOGS_SLUG;
     72
     73    $bp->blogs->table_name          = $bp->table_prefix . 'bp_user_blogs';
     74    $bp->blogs->table_name_blogmeta = $bp->table_prefix . 'bp_user_blogs_blogmeta';
     75
    7376    $bp->blogs->format_notification_function = 'bp_blogs_format_notifications';
    74     $bp->blogs->slug = BP_BLOGS_SLUG;
    7577
    7678    /* Register this in the active components array */
  • 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. -->
  • branches/1.2/bp-forums/bp-forums-admin.php

    r3073 r3186  
    122122
    123123function bp_forums_bbpress_install() {
    124     global $wpdb, $bbdb;
     124    global $wpdb, $bbdb, $bp;
    125125
    126126    check_admin_referer( 'bp_forums_new_install_init' );
     
    141141            "define( 'BB_LOGGED_I"          => array( "'put your unique phrase here'",  "'" . addslashes( LOGGED_IN_KEY ) . "'" ),
    142142            "define( 'BB_NONCE_KE"          => array( "'put your unique phrase here'",  "'" . addslashes( NONCE_KEY ) . "'" ),
    143             "\$bb_table_prefix = '"         => array( "'bb_'",                          "'" . $wpdb->base_prefix . "bb_'" ),
     143            "\$bb_table_prefix = '"         => array( "'bb_'",                          "'" . $bp->table_prefix . "bb_'" ),
    144144            "define( 'BB_LANG', '"          => array( "''",                             "'" . WPLANG . "'" )
    145145        )
  • branches/1.2/bp-friends.php

    r3172 r3186  
    3434
    3535function friends_setup_globals() {
    36     global $bp, $wpdb;
     36    global $bp;
    3737
    3838    /* For internal identification */
    3939    $bp->friends->id = 'friends';
    4040
    41     $bp->friends->table_name = $wpdb->base_prefix . 'bp_friends';
     41    $bp->friends->slug = BP_FRIENDS_SLUG;
     42
     43    $bp->friends->table_name = $bp->table_prefix . 'bp_friends';
     44
    4245    $bp->friends->format_notification_function = 'friends_format_notifications';
    43     $bp->friends->slug = BP_FRIENDS_SLUG;
    4446
    4547    /* Register this in the active components array */
     
    5153
    5254function friends_check_installed() {
    53     global $wpdb, $bp;
     55    global $bp;
    5456
    5557    if ( !is_site_admin() )
  • branches/1.2/bp-groups.php

    r3178 r3186  
    7575    $bp->groups->id = 'groups';
    7676
    77     $bp->groups->table_name = $wpdb->base_prefix . 'bp_groups';
    78     $bp->groups->table_name_members = $wpdb->base_prefix . 'bp_groups_members';
    79     $bp->groups->table_name_groupmeta = $wpdb->base_prefix . 'bp_groups_groupmeta';
     77    $bp->groups->slug = BP_GROUPS_SLUG;
     78
     79    $bp->groups->table_name           = $bp->table_prefix . 'bp_groups';
     80    $bp->groups->table_name_members   = $bp->table_prefix . 'bp_groups_members';
     81    $bp->groups->table_name_groupmeta = $bp->table_prefix . 'bp_groups_groupmeta';
     82
    8083    $bp->groups->format_notification_function = 'groups_format_notifications';
    81     $bp->groups->slug = BP_GROUPS_SLUG;
    8284
    8385    /* Register this in the active components array */
  • branches/1.2/bp-messages.php

    r3166 r3186  
    6767
    6868function messages_setup_globals() {
    69     global $bp, $wpdb;
     69    global $bp;
    7070
    7171    /* For internal identification */
    7272    $bp->messages->id = 'messages';
    7373
    74     $bp->messages->table_name_messages = $wpdb->base_prefix . 'bp_messages_messages';
    75     $bp->messages->table_name_recipients = $wpdb->base_prefix . 'bp_messages_recipients';
    76     $bp->messages->table_name_notices = $wpdb->base_prefix . 'bp_messages_notices';
     74    $bp->messages->slug = BP_MESSAGES_SLUG;
     75
     76    $bp->messages->table_name_notices    = $bp->table_prefix . 'bp_messages_notices';
     77    $bp->messages->table_name_messages   = $bp->table_prefix . 'bp_messages_messages';
     78    $bp->messages->table_name_recipients = $bp->table_prefix . 'bp_messages_recipients';
     79
    7780    $bp->messages->format_notification_function = 'messages_format_notifications';
    78     $bp->messages->slug = BP_MESSAGES_SLUG;
    7981
    8082    /* Register this in the active components array */
     
    8688
    8789function messages_check_installed() {
    88     global $wpdb, $bp;
     90    global $bp;
    8991
    9092    if ( !is_site_admin() )
  • branches/1.2/bp-xprofile.php

    r3145 r3186  
    105105    $bp->profile->id = 'profile';
    106106
    107     $bp->profile->table_name_groups = $wpdb->base_prefix . 'bp_xprofile_groups';
    108     $bp->profile->table_name_fields = $wpdb->base_prefix . 'bp_xprofile_fields';
    109     $bp->profile->table_name_data = $wpdb->base_prefix . 'bp_xprofile_data';
     107    $bp->profile->slug = BP_XPROFILE_SLUG;
     108
     109    $bp->profile->table_name_data   = $bp->table_prefix . 'bp_xprofile_data';
     110    $bp->profile->table_name_groups = $bp->table_prefix . 'bp_xprofile_groups';
     111    $bp->profile->table_name_fields = $bp->table_prefix . 'bp_xprofile_fields';
    110112
    111113    $bp->profile->format_notification_function = 'xprofile_format_notifications';
    112     $bp->profile->slug = BP_XPROFILE_SLUG;
    113114
    114115    /* Register this in the active components array */
Note: See TracChangeset for help on using the changeset viewer.