Skip to:
Content

BuddyPress.org

Changeset 3853


Ignore:
Timestamp:
01/24/2011 02:00:05 AM (15 years ago)
Author:
johnjamesjacoby
Message:

bp_core_is_multisite is deprecated, so use is_multisite instead. See r3851, r3852, and #2574.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-functions.php

    r3840 r3853  
    147147
    148148    if ( 'publish' == $post->post_status && empty( $post->post_password ) ) {
    149         if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multisite() ) {
     149        if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !is_multisite() ) {
    150150            // Record this in activity streams
    151151            $post_permalink   = get_permalink( $post_id );
    152152
    153             if ( is_multisite() ) {
     153            if ( is_multisite() )
    154154                $activity_action  = sprintf( __( '%1$s wrote a new blog post: %2$s on the blog %3$s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' );
    155             } else {
     155            else
    156156                $activity_action  = sprintf( __( '%1$s wrote a new blog post: %2$s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    157             }
    158157
    159158            $activity_content = $post->post_content;
  • trunk/bp-core/bp-core-avatars.php

    r3852 r3853  
    597597
    598598    // If multisite, and current blog does not match root blog, make adjustments
    599     if ( bp_core_is_multisite() && BP_ROOT_BLOG != $current_blog->blog_id )
     599    if ( is_multisite() && BP_ROOT_BLOG != $current_blog->blog_id )
    600600        $upload_dir['baseurl'] = trailingslashit( get_blog_option( BP_ROOT_BLOG, 'home' ) ) . get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    601601
  • trunk/bp-core/bp-core-wpabstraction.php

    r3771 r3853  
    1010 */
    1111
     12/**
     13 * Only add abstraction functions if WordPress is not in multisite mode
     14 */
    1215if ( !is_multisite() ) {
    1316    $wpdb->base_prefix = $wpdb->prefix;
    14     $wpdb->blogid = 1;
    15 }
     17    $wpdb->blogid      = 1;
    1618
    17 /**
    18  * bp_core_is_multisite()
    19  *
    20  * This function originally served as a wrapper when WordPress and WordPress MU were separate entities.
    21  * Use is_multisite() instead.
    22  *
    23  * @deprecated 1.3
    24  * @deprecated Use is_multisite()
    25  */
    26 function bp_core_is_multisite() {
    27     _deprecated_function( __FUNCTION__, '1.3', 'is_multisite()' );
    28     return is_multisite();
    29 }
     19    /**
     20     * bp_core_is_main_site
     21     *
     22     * Checks if current blog is root blog of site. Deprecated in 1.3.
     23     *
     24     * @deprecated 1.3
     25     * @deprecated Use is_multisite()
     26     * @package BuddyPress
     27     * @param int $blog_id optional blog id to test (default current blog)
     28     * @return bool True if not multisite or $blog_id is main site
     29     * @since 1.2.6
     30     */
     31    function bp_core_is_main_site( $blog_id = '' ) {
     32        _deprecated_function( __FUNCTION__, '1.3', 'is_main_site()' );
     33        return is_main_site( $blog_id );
     34    }
    3035
    31 /**
    32  * bp_core_is_main_site
    33  *
    34  * Checks if current blog is root blog of site. Deprecated in 1.3.
    35  *
    36  * @deprecated 1.3
    37  * @deprecated Use is_multisite()
    38  * @package BuddyPress
    39  * @param int $blog_id optional blog id to test (default current blog)
    40  * @return bool True if not multisite or $blog_id is main site
    41  * @since 1.2.6
    42  */
    43 function bp_core_is_main_site( $blog_id = '' ) {
    44     _deprecated_function( __FUNCTION__, '1.3', 'is_main_site()' );
    45     return is_main_site( $blog_id );
    46 }
     36    function bp_core_get_status_sql( $prefix = false ) {
     37        if ( !is_multisite() )
     38            return "{$prefix}user_status = 0";
     39        else
     40            return "{$prefix}spam = 0 AND {$prefix}deleted = 0 AND {$prefix}user_status = 0";
     41    }
    4742
    48 function bp_core_get_status_sql( $prefix = false ) {
    49     if ( !is_multisite() )
    50         return "{$prefix}user_status = 0";
    51     else
    52         return "{$prefix}spam = 0 AND {$prefix}deleted = 0 AND {$prefix}user_status = 0";
    53 }
     43    if ( !function_exists( 'get_blog_option' ) ) {
     44        function get_blog_option( $blog_id, $option_name, $default = false ) {
     45            return get_option( $option_name, $default );
     46        }
     47    }
    5448
    55 if ( !function_exists( 'get_blog_option' ) ) {
    56     function get_blog_option( $blog_id, $option_name, $default = false ) {
    57         return get_option( $option_name, $default );
     49    if ( !function_exists( 'add_blog_option' ) ) {
     50        function add_blog_option( $blog_id, $option_name, $option_value ) {
     51            return add_option( $option_name, $option_value );
     52        }
     53    }
     54
     55    if ( !function_exists( 'update_blog_option' ) ) {
     56        function update_blog_option( $blog_id, $option_name, $option_value ) {
     57            return update_option( $option_name, $option_value );
     58        }
     59    }
     60
     61    if ( !function_exists( 'switch_to_blog' ) ) {
     62        function switch_to_blog() {
     63            return 1;
     64        }
     65    }
     66
     67    if ( !function_exists( 'restore_current_blog' ) ) {
     68        function restore_current_blog() {
     69            return 1;
     70        }
     71    }
     72
     73    if ( !function_exists( 'get_blogs_of_user' ) ) {
     74        function get_blogs_of_user() {
     75            return false;
     76        }
     77    }
     78
     79    if ( !function_exists( 'update_blog_status' ) ) {
     80        function update_blog_status() {
     81            return true;
     82        }
     83    }
     84
     85    if ( !function_exists( 'is_subdomain_install' ) ) {
     86        function is_subdomain_install() {
     87            if ( ( defined( 'VHOST' ) && 'yes' == VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) )
     88                return true;
     89
     90            return false;
     91        }
    5892    }
    5993}
    6094
    61 if ( !function_exists( 'add_blog_option' ) ) {
    62     function add_blog_option( $blog_id, $option_name, $option_value ) {
    63         return add_option( $option_name, $option_value );
    64     }
    65 }
    66 
    67 if ( !function_exists( 'update_blog_option' ) ) {
    68     function update_blog_option( $blog_id, $option_name, $option_value ) {
    69         return update_option( $option_name, $option_value );
    70     }
    71 }
    72 
    73 if ( !function_exists( 'switch_to_blog' ) ) {
    74     function switch_to_blog() {
    75         return 1;
    76     }
    77 }
    78 
    79 if ( !function_exists( 'restore_current_blog' ) ) {
    80     function restore_current_blog() {
    81         return 1;
    82     }
    83 }
    84 
    85 if ( !function_exists( 'get_blogs_of_user' ) ) {
    86     function get_blogs_of_user() {
    87         return false;
    88     }
    89 }
    90 
    91 if ( !function_exists( 'update_blog_status' ) ) {
    92     function update_blog_status() {
    93         return true;
    94     }
    95 }
    96 
    97 if ( !function_exists( 'is_subdomain_install' ) ) {
    98     function is_subdomain_install() {
    99         if ( ( defined( 'VHOST' ) && 'yes' == VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) )
    100             return true;
    101 
    102         return false;
    103     }
    104 }
    10595?>
  • trunk/bp-core/deprecated/1.3.php

    r3806 r3853  
    88 * @deprecated Since 1.3
    99 */
     10
     11/** WP Abstraction ************************************************************/
     12
     13/**
     14 * bp_core_is_multisite()
     15 *
     16 * This function originally served as a wrapper when WordPress and WordPress MU were separate entities.
     17 * Use is_multisite() instead.
     18 *
     19 * @deprecated 1.3
     20 * @deprecated Use is_multisite()
     21 */
     22function bp_core_is_multisite() {
     23    _deprecated_function( __FUNCTION__, '1.3', 'is_multisite()' );
     24    return is_multisite();
     25}
    1026
    1127/** Activity ******************************************************************/
Note: See TracChangeset for help on using the changeset viewer.