Changeset 4107
- Timestamp:
- 03/11/2011 06:02:47 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-functions.php
r3940 r4107 265 265 266 266 function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) { 267 global $wpdb , $current_blog;268 269 if ( empty( $blog_id ) && isset( $ current_blog) )270 $blog_id = $ current_blog->blog_id;267 global $wpdb; 268 269 if ( empty( $blog_id ) && isset( $wpdb->blogid ) ) 270 $blog_id = $wpdb->blogid; 271 271 else 272 272 $blog_id = BP_ROOT_BLOG; … … 291 291 292 292 function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) { 293 global $ current_blog;293 global $wpdb; 294 294 295 295 if ( empty( $blog_id ) ) 296 $blog_id = $ current_blog->blog_id;296 $blog_id = $wpdb->blogid; 297 297 298 298 bp_blogs_remove_blog_for_user( $user_id, $blog_id ); … … 330 330 331 331 function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) { 332 global $ current_blog, $bp;333 334 if ( empty( $ current_blog->blog_id ) )332 global $wpdb, $bp; 333 334 if ( empty( $wpdb->blogid ) ) 335 335 return false; 336 336 … … 338 338 339 339 if ( !$blog_id ) 340 $blog_id = (int)$ current_blog->blog_id;340 $blog_id = (int)$wpdb->blogid; 341 341 342 342 if ( !$user_id ) -
trunk/bp-blogs/bp-blogs-widgets.php
r3300 r4107 7 7 8 8 function bp_blogs_register_widgets() { 9 global $ current_blog, $bp;9 global $wpdb, $bp; 10 10 11 if ( bp_is_active( 'activity' ) && (int)$ current_blog->blog_id == BP_ROOT_BLOG )11 if ( bp_is_active( 'activity' ) && (int)$wpdb->blogid == BP_ROOT_BLOG ) 12 12 add_action('widgets_init', create_function('', 'return register_widget("BP_Blogs_Recent_Posts_Widget");') ); 13 13 } -
trunk/bp-core/admin/bp-core-admin.php
r4105 r4107 19 19 */ 20 20 function bp_core_activation_notice() { 21 global $wp_rewrite, $ current_blog, $bp;21 global $wp_rewrite, $wpdb, $bp; 22 22 23 23 if ( isset( $_POST['permalink_structure'] ) ) … … 27 27 return false; 28 28 29 if ( !empty( $ current_blog) ) {30 if ( $ current_blog->blog_id != BP_ROOT_BLOG ) {29 if ( !empty( $wpdb->blogid ) ) { 30 if ( $wpdb->blogid != BP_ROOT_BLOG ) { 31 31 return false; 32 32 } … … 91 91 */ 92 92 function bp_core_admin_settings() { 93 global $wpdb, $bp , $current_blog;93 global $wpdb, $bp; 94 94 95 95 $ud = get_userdata( $bp->loggedin_user->id ); -
trunk/bp-core/admin/bp-core-update.php
r4106 r4107 740 740 741 741 function step_ms_update_save() { 742 global $ current_blog;742 global $wpdb; 743 743 744 744 if ( isset( $_POST['submit'] ) ) { … … 762 762 } else { 763 763 // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on 764 if ( $ current_blog->blog_id != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) )764 if ( $wpdb->blogid != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) ) 765 765 switch_to_blog( BP_ROOT_BLOG ); 766 766 … … 771 771 update_option( 'bp-pages', $bp_pages ); 772 772 773 if ( $ current_blog->blog_id != BP_ROOT_BLOG )773 if ( $wpdb->blogid != BP_ROOT_BLOG ) 774 774 restore_current_blog(); 775 775 … … 810 810 811 811 function step_pages_save() { 812 global $ current_blog;812 global $wpdb; 813 813 814 814 if ( isset( $_POST['submit'] ) && isset( $_POST['bp_pages'] ) ) { … … 816 816 817 817 // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on 818 if ( !empty( $ current_blog->blog_id ) && $current_blog->blog_id != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) )818 if ( !empty( $wpdb->blogid ) && $wpdb->blogid != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) ) 819 819 switch_to_blog( BP_ROOT_BLOG ); 820 820 … … 829 829 update_option( 'bp-pages', $bp_pages ); 830 830 831 if ( !empty( $ current_blog->blog_id ) && $current_blog->blog_id != BP_ROOT_BLOG )831 if ( !empty( $wpdb->blogid ) && $wpdb->blogid != BP_ROOT_BLOG ) 832 832 restore_current_blog(); 833 833 … … 853 853 $permalink_structure = preg_replace( '#/+#', '/', '/' . $_POST['permalink_structure'] ); 854 854 855 if ( ( defined( 'VHOST' ) && constant( 'VHOST' ) == 'no' ) && $permalink_structure != '' && $current_site->domain .$current_site->path == $current_blog->domain.$current_blog->path )855 if ( ( defined( 'VHOST' ) && constant( 'VHOST' ) == 'no' ) && $permalink_structure != '' && $current_site->domain . $current_site->path == $current_blog->domain . $current_blog->path ) 856 856 $permalink_structure = '/blog' . $permalink_structure; 857 857 -
trunk/bp-core/bp-core-avatars.php
r3982 r4107 564 564 * Returns the absolute upload path for the WP installation 565 565 * 566 * @global object $ current_blog Current blog information566 * @global object $wpdb WordPress database global 567 567 * @uses wp_upload_dir To get upload directory info 568 568 * @return string Absolute path to WP upload directory 569 569 */ 570 570 function bp_core_avatar_upload_path() { 571 global $ current_blog;571 global $wpdb; 572 572 573 573 // Get upload directory information from current site … … 579 579 580 580 // If multisite, and current blog does not match root blog, make adjustments 581 if ( is_multisite() && BP_ROOT_BLOG != $ current_blog->blog_id )581 if ( is_multisite() && BP_ROOT_BLOG != $wpdb->blogid ) 582 582 $basedir = get_blog_option( BP_ROOT_BLOG, 'upload_path' ); 583 583 } else { … … 593 593 * Returns the raw base URL for root site upload location 594 594 * 595 * @global object $ current_blog Current blog information595 * @global object $wpdb WordPress database global 596 596 * @uses wp_upload_dir To get upload directory info 597 597 * @return string Full URL to current upload location 598 598 */ 599 599 function bp_core_avatar_url() { 600 global $ current_blog;600 global $wpdb; 601 601 602 602 // Get upload directory information from current site … … 608 608 609 609 // If multisite, and current blog does not match root blog, make adjustments 610 if ( is_multisite() && BP_ROOT_BLOG != $ current_blog->blog_id )610 if ( is_multisite() && BP_ROOT_BLOG != $wpdb->blogid ) 611 611 $baseurl = trailingslashit( get_blog_option( BP_ROOT_BLOG, 'home' ) ) . get_blog_option( BP_ROOT_BLOG, 'upload_path' ); 612 612 } else { -
trunk/bp-core/bp-core-catchuri.php
r4104 r4107 28 28 function bp_core_set_uri_globals() { 29 29 global $bp, $bp_unfiltered_uri, $bp_unfiltered_uri_offset; 30 global $current_blog ;30 global $current_blog, $wpdb; 31 31 32 32 // Create global component, action, and item variables … … 37 37 // on multiple blogs 38 38 if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && is_multisite() ) { 39 if ( BP_ROOT_BLOG != (int) $ current_blog->blog_id )39 if ( BP_ROOT_BLOG != (int) $wpdb->blogid ) 40 40 return false; 41 41 } -
trunk/bp-core/bp-core-cssjs.php
r4027 r4107 33 33 34 34 function bp_core_confirmation_js() { 35 global $ current_blog;35 global $wpdb; 36 36 37 if ( is_multisite() && $ current_blog->blog_id != BP_ROOT_BLOG )37 if ( is_multisite() && $wpdb->blogid != BP_ROOT_BLOG ) 38 38 return false; 39 39 -
trunk/bp-core/bp-core-filters.php
r4041 r4107 68 68 */ 69 69 function bp_core_allow_default_theme( $themes ) { 70 global $bp, $ current_blog;70 global $bp, $wpdb; 71 71 72 72 if ( !is_super_admin() ) 73 73 return $themes; 74 74 75 if ( $ current_blog->blog_id == BP_ROOT_BLOG ) {75 if ( $wpdb->blogid == BP_ROOT_BLOG ) { 76 76 $themes['bp-default'] = 1; 77 77 } 78 78 79 79 return $themes; 80 80 } … … 126 126 */ 127 127 function bp_core_login_redirect( $redirect_to ) { 128 global $bp, $ current_blog;129 130 if ( is_multisite() && $ current_blog->blog_id != BP_ROOT_BLOG )128 global $bp, $wpdb; 129 130 if ( is_multisite() && $wpdb->blogid != BP_ROOT_BLOG ) 131 131 return $redirect_to; 132 132 -
trunk/bp-core/bp-core-functions.php
r4088 r4107 169 169 */ 170 170 function bp_core_get_root_domain() { 171 global $ current_blog;171 global $wpdb; 172 172 173 173 if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) 174 $domain = get_home_url( $ current_blog->blog_id );174 $domain = get_home_url( $wpdb->blogid ); 175 175 else 176 176 $domain = get_home_url( BP_ROOT_BLOG ); -
trunk/bp-core/bp-core-template.php
r4076 r4107 219 219 220 220 function bp_get_page_title() { 221 global $bp, $post, $wp_query , $current_blog;221 global $bp, $post, $wp_query; 222 222 223 223 // Home -
trunk/bp-members/bp-members-buddybar.php
r3955 r4107 42 42 // **** "Blog Authors" Menu (visible when not logged in) ******** 43 43 function bp_adminbar_authors_menu() { 44 global $bp, $ current_blog, $wpdb;44 global $bp, $wpdb; 45 45 46 46 // Only for multisite … … 49 49 50 50 // Hide on root blog 51 if ( $ current_blog->blog_id == BP_ROOT_BLOG || !bp_is_active( 'blogs' ) )52 return false; 53 54 $blog_prefix = $wpdb->get_blog_prefix( $ current_blog->blog_id );51 if ( $wpdb->blogid == BP_ROOT_BLOG || !bp_is_active( 'blogs' ) ) 52 return false; 53 54 $blog_prefix = $wpdb->get_blog_prefix( $wpdb->blogid ); 55 55 $authors = $wpdb->get_results( "SELECT user_id, user_login, user_nicename, display_name, user_email, meta_value as caps FROM $wpdb->users u, $wpdb->usermeta um WHERE u.ID = um.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY um.user_id" ); 56 56 -
trunk/bp-members/bp-members-template.php
r4093 r4107 604 604 605 605 /** 606 * bp_get_nav()607 * TEMPLATE TAG608 *609 606 * Uses the $bp->bp_nav global to render out the navigation within a BuddyPress install. 610 607 * Each component adds to this navigation array within its own [component_name]_setup_nav() function. … … 622 619 */ 623 620 function bp_get_loggedin_user_nav() { 624 global $bp , $current_blog;621 global $bp; 625 622 626 623 // Loop through each navigation item
Note: See TracChangeset
for help on using the changeset viewer.