Changeset 5716
- Timestamp:
- 02/11/2012 06:01:03 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-functions.php
r5683 r5716 528 528 */ 529 529 function bp_core_get_last_activity( $last_activity_date, $string ) { 530 if ( !$last_activity_date || empty( $last_activity_date ) ) 531 $last_active = __( 'not recently active', 'buddypress' ); 530 531 if ( empty( $last_activity_date ) ) 532 $last_active = __( 'Not recently active', 'buddypress' ); 532 533 else 533 534 $last_active = sprintf( $string, bp_core_time_since( $last_activity_date ) ); … … 807 808 $is_root_blog = true; 808 809 809 return apply_filters( 'bp_is_root_blog', (bool) $is_root_blog );810 return (bool) apply_filters( 'bp_is_root_blog', (bool) $is_root_blog ); 810 811 } 811 812 … … 814 815 * 815 816 * @package BuddyPress 816 * @since 1.5817 * 818 * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id().817 * @since BuddyPress (1.5) 818 * 819 * @return int Return the root site ID 819 820 */ 820 821 function bp_get_root_blog_id() { 821 822 // Default to 1 823 $root_blog_id = 1; 824 825 // Define on which blog ID BuddyPress should run 826 if ( !defined( 'BP_ROOT_BLOG' ) ) { 827 828 // Root blog is the main site on this network 829 if ( is_multisite() && !bp_is_multiblog_mode() ) { 830 $current_site = get_current_site(); 831 $root_blog_id = $current_site->blog_id; 832 833 // Root blog is whatever the current site is (could be any site on the network) 834 } elseif ( is_multisite() && bp_is_multiblog_mode() ) { 835 $root_blog_id = get_current_blog_id(); 836 } 837 838 define( 'BP_ROOT_BLOG', $root_blog_id ); 839 840 // Root blog is defined 841 } else { 842 $root_blog_id = BP_ROOT_BLOG; 843 } 844 845 return apply_filters( 'bp_get_root_blog_id', (int) $root_blog_id ); 822 global $bp; 823 824 return (int) apply_filters( 'bp_get_root_blog_id', (int) $bp->root_blog_id ); 846 825 } 847 826 -
trunk/bp-loader.php
r5675 r5716 75 75 public $load_deprecated = true; 76 76 77 /** Root ******************************************************************/ 78 79 /** 80 * @var int The root blog ID 81 */ 82 public $root_blog_id = 1; 83 77 84 /** Paths *****************************************************************/ 78 85 … … 368 375 */ 369 376 private function setup_globals() { 377 378 /** Root **************************************************************/ 379 380 // BuddyPress Root blog ID 381 $this->root_blog_id = (int) apply_filters( 'bp_get_root_blog_id', BP_ROOT_BLOG ); 370 382 371 383 /** Paths *************************************************************/ … … 429 441 // Get the possible DB versions 430 442 $versions = array(); 431 $versions['1.2'] = get_site_option( 'bp-core-db-version' );432 $versions['1.5-multi'] = get_site_option( 'bp-db-version');433 $versions['1. 5-single'] = get_option ( 'bp-db-version');434 $versions['1. 6-multi'] = get_site_option( '_bp_db_version');435 $versions['1.6-single'] = get_ option ( '_bp_db_version');443 $versions['1.2'] = get_site_option( 'bp-core-db-version' ); 444 $versions['1.5-multi'] = get_site_option( 'bp-db-version' ); 445 $versions['1.6-multi'] = get_site_option( '_bp_db_version' ); 446 $versions['1.5-single'] = get_blog_option( $this->root_blog_id, 'bp-db-version' ); 447 $versions['1.6-single'] = get_blog_option( $this->root_blog_id, '_bp_db_version' ); 436 448 437 449 // Remove empty array items 438 450 $versions = array_filter( $versions ); 439 451 440 // Get the largest version 441 $this->db_version_raw = !empty( $versions ) ? (int) max( $versions ) : 0; 452 // If no 1.6-single exists, use the max of the others 453 if ( empty( $versions['1.6-single'] ) ) 454 $this->db_version_raw = !empty( $versions ) ? (int) max( $versions ) : 0; 455 456 // 1.6-single exists, so trust it 457 else 458 $this->db_version_raw = $versions['1.6-single']; 442 459 443 460 // Is this an upgrade to WordPress Network Mode?
Note: See TracChangeset
for help on using the changeset viewer.