Skip to:
Content

BuddyPress.org

Changeset 2209


Ignore:
Timestamp:
12/27/2009 10:41:10 AM (16 years ago)
Author:
apeatling
Message:

Single WP support. Yes, you read that correctly.

Location:
trunk
Files:
1 added
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r2179 r2209  
    6565    // On first installation - record all existing blogs in the system.
    6666    if ( !(int)get_site_option( 'bp-blogs-first-install') ) {
    67 
    6867        bp_blogs_record_existing_blogs();
    6968        add_site_option( 'bp-blogs-first-install', 1 );
    70 
    71     } else {
    72 
    73         // Import blog titles and descriptions into the blogmeta table
    74         if ( get_site_option( 'bp-blogs-version' ) <= '0.1.5' ) {
    75             $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM " . $bp->blogs->table_name ) );
    76 
    77             for ( $i = 0; $i < count($blog_ids); $i++ ) {
    78                 $name = get_blog_option( $blog_ids[$i], 'blogname' );
    79                 $desc = get_blog_option( $blog_ids[$i], 'blogdescription' );
    80 
    81                 bp_blogs_update_blogmeta( $blog_ids[$i], 'name', $name );
    82                 bp_blogs_update_blogmeta( $blog_ids[$i], 'description', $desc );
    83                 bp_blogs_update_blogmeta( $blog_ids[$i], 'last_activity', time() );
    84             }
    85         }
    86 
    8769    }
    8870
     
    139121function bp_blogs_setup_nav() {
    140122    global $bp;
     123
     124    /* Blog/post/comment menus should not appear on single WordPress setups. Although comments
     125       and posts made by users will still show on their activity stream .*/
     126    if ( !bp_core_is_multiblog_install() )
     127        return false;
    141128
    142129    /* Add 'Blogs' to the main navigation */
     
    171158    global $bp;
    172159
    173     if ( $bp->current_component == $bp->blogs->slug && empty( $bp->current_action ) ) {
     160    if ( bp_core_is_multiblog_install() && $bp->current_component == $bp->blogs->slug && empty( $bp->current_action ) ) {
    174161        $bp->is_directory = true;
    175162
     
    190177
    191178function bp_blogs_screen_my_blogs() {
     179    global $bp;
     180
     181    if ( !bp_core_is_multiblog_install() )
     182        return false;
     183
    192184    do_action( 'bp_blogs_screen_my_blogs' );
    193185    bp_core_load_template( apply_filters( 'bp_blogs_template_my_blogs', 'members/single/home' ) );
     
    207199    global $bp;
    208200
    209     if ( $bp->current_component != $bp->blogs->slug || 'create' != $bp->current_action )
     201    if ( !bp_core_is_multiblog_install() || $bp->current_component != $bp->blogs->slug || 'create' != $bp->current_action )
    210202        return false;
    211203
     
    379371            bp_blogs_update_blogmeta( $recorded_post->blog_id, 'last_activity', time() );
    380372
    381             if ( (int)get_blog_option( $blog_id, 'blog_public' ) ) {
     373            if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multiblog_install() ) {
    382374                /* Record this in activity streams */
    383375                $post_permalink = bp_post_get_permalink( $post, $blog_id );
     
    415407        }
    416408
    417         if ( (int)get_blog_option( $blog_id, 'blog_public' ) ) {
     409        if ( (int)get_blog_option( $blog_id, 'blog_public' ) || !bp_core_is_multiblog_install() ) {
    418410            /* Now re-record the post in the activity streams */
    419411            $post_permalink = bp_post_get_permalink( $post, $blog_id );
     
    469461    bp_blogs_update_blogmeta( $recorded_comment->blog_id, 'last_activity', time() );
    470462
    471     if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) ) {
     463    if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) || !bp_core_is_multiblog_install() ) {
    472464        /* Record in activity streams */
    473465        $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id );
     
    503495    bp_blogs_delete_activity( array( 'item_id' => $comment_id, 'secondary_item_id' => $recorded_comment->blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_comment' ) );
    504496
    505     if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) ) {
     497    if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) || !bp_core_is_multiblog_install() ) {
    506498        /* Record in activity streams */
    507499        $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id );
  • trunk/bp-core.php

    r2200 r2209  
    1111define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' );
    1212define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) );
     13
     14/* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */
     15require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' );
    1316
    1417/* Place your custom code (actions/filters) in a file called /plugins/bp-custom.php and it will be loaded before anything else. */
     
    6366    define( 'BP_HOME_BLOG_SLUG', 'blog' );
    6467
    65 /* Register BuddyPress themes contained within the theme folder */
    66 if ( function_exists( 'register_theme_folder' ) )
    67     register_theme_folder( 'buddypress/bp-themes' );
     68/* Register BuddyPress themes contained within the bp-theme folder */
     69if ( function_exists( 'register_theme_directory') )
     70    register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' );
    6871
    6972
     
    414417 */
    415418function bp_core_action_set_spammer_status() {
    416     global $bp;
     419    global $bp, $wpdb;
    417420
    418421    if ( !is_site_admin() || bp_is_home() || !$bp->displayed_user->id )
     
    424427
    425428        /* Get the functions file */
    426         require( ABSPATH . 'wp-admin/includes/mu.php' );
     429        if ( file_exists( ABSPATH . 'wp-admin/includes/mu.php' ) && bp_core_is_multiblog_install() )
     430            require( ABSPATH . 'wp-admin/includes/mu.php' );
    427431
    428432        if ( 'mark-spammer' == $bp->current_action )
     
    447451
    448452        /* Finally, mark this user as a spammer */
    449         update_user_status( $bp->displayed_user->id, 'spam', $is_spam, 1 );
     453        if ( bp_core_is_multiblog_install() )
     454            $wpdb->update( $wpdb->users, array( 'spam' => $is_spam ), array( 'ID' => $bp->displayed_user->id ) );
     455
     456        $wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $bp->displayed_user->id ) );
    450457
    451458        if ( $is_spam )
     
    11691176 */
    11701177function bp_core_get_total_member_count() {
    1171     global $wpdb;
    1172 
    1173     $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM " . CUSTOM_USER_TABLE . " WHERE spam = 0" ) );
     1178    global $wpdb, $bp;
     1179
     1180    $status_sql = bp_core_get_status_sql();
     1181
     1182    $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM " . CUSTOM_USER_TABLE . " WHERE {$status_sql}" ) );
    11741183    return apply_filters( 'bp_core_get_total_member_count', $count );
    11751184}
     
    11871196    global $wpdb;
    11881197
    1189     return apply_filters( 'bp_core_is_user_spammer', (int) $wpdb->get_var( $wpdb->prepare( "SELECT spam FROM " . CUSTOM_USER_TABLE . " WHERE ID = %d", $user_id ) ) );
     1198    if ( bp_core_is_multiblog_install() )
     1199        $is_spammer = (int) $wpdb->get_var( $wpdb->prepare( "SELECT spam FROM " . CUSTOM_USER_TABLE . " WHERE ID = %d", $user_id ) );
     1200    else
     1201        $is_spammer = (int) $wpdb->get_var( $wpdb->prepare( "SELECT user_status FROM " . CUSTOM_USER_TABLE . " WHERE ID = %d", $user_id ) );
     1202
     1203    return apply_filters( 'bp_core_is_user_spammer', $is_spammer );
    11901204}
    11911205
  • trunk/bp-core/bp-core-activation.php

    r2157 r2209  
    44    global $bp, $wpdb;
    55
    6     if ( BP_ACTIVATION_SLUG != $bp->current_component )
    7         return false;
    8 
    9     /* If we are using a BuddyPress 1.0 theme ignore this. */
    10     if ( file_exists( WP_CONTENT_DIR . '/bp-themes' ) )
     6    if ( !bp_core_is_multiblog_install() || BP_ACTIVATION_SLUG != $bp->current_component )
    117        return false;
    128
  • trunk/bp-core/bp-core-adminbar.php

    r2189 r2209  
    22
    33function bp_core_admin_bar() {
    4     global $bp, $wpdb, $current_blog, $doing_admin_bar;
     4    global $bp, $wpdb, $current_blog;
    55
    66    if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
    77        return false;
    8 
    9     $doing_admin_bar = true;
    108
    119    if ( (int)get_site_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() )
     
    4341
    4442    // Show "Sign Up" link if user registrations are allowed
    45     if ( get_site_option( 'registration' ) != 'none' && get_site_option( 'registration' ) != 'blog' ) {
    46         echo '<li class="bp-signup no-arrow"><a href="' . bp_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
     43    if ( bp_get_signup_allowed() ) {
     44        echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
    4745    }
    4846}
     
    251249            <?php endif; ?>
    252250
    253             <?php if ( function_exists('bp_blogs_install') ) : ?>
     251            <?php if ( function_exists('bp_blogs_install') && bp_core_is_multiblog_install() ) : ?>
    254252            <li><a href="<?php echo $bp->root_domain . '/' . $bp->blogs->slug . '/?random-blog' ?>"><?php _e( 'Random Blog', 'buddypress' ) ?></a></li>
    255253
     
    260258    </li>
    261259    <?php
    262 
    263     $doing_admin_bar = false;
    264260}
    265261
     
    267263add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 );
    268264add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 );
    269 add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
     265
     266if ( bp_core_is_multiblog_install() )
     267    add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
     268
    270269add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
    271 add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
     270
     271if ( bp_core_is_multiblog_install() )
     272    add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
     273
    272274add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
    273275
  • trunk/bp-core/bp-core-avatars.php

    r2168 r2209  
    99 */
    1010
     11if ( !defined( 'BP_AVATAR_UPLOAD_PATH' ) )
     12    define( 'BP_AVATAR_UPLOAD_PATH', bp_core_avatar_upload_path() );
     13
    1114if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
    1215    define( 'BP_AVATAR_THUMB_WIDTH', 50 );
     
    2427    define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
    2528
    26 if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) )
    27     define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', get_site_option( 'fileupload_maxk' ) * 1024 );
     29if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
     30    if ( !get_site_option( 'fileupload_maxk' ) )
     31        define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); /* 5mb */
     32    else
     33        define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', get_site_option( 'fileupload_maxk' ) * 1024 );
     34}
    2835
    2936if ( !defined( 'BP_AVATAR_DEFAULT' ) )
     
    95102        $html_height = ( 'thumb' == $type ) ? ' height="' . BP_AVATAR_THUMB_HEIGHT . '"' : ' height="' . BP_AVATAR_FULL_HEIGHT . '"';
    96103
    97     $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', $bp->root_domain . '/' . basename( WP_CONTENT_DIR ) . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    98     $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     104    $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, BP_AVATAR_UPLOAD_PATH ) . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     105    $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    99106
    100107    /****
     
    188195    }
    189196
    190     if ( 'user' == $object ) {
    191         /* Delete any legacy meta entries if this is a user avatar */
    192         delete_usermeta( $item_id, 'bp_core_avatar_v1_path' );
    193         delete_usermeta( $item_id, 'bp_core_avatar_v1' );
    194         delete_usermeta( $item_id, 'bp_core_avatar_v2_path' );
    195         delete_usermeta( $item_id, 'bp_core_avatar_v2' );
    196     }
    197 
    198     $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     197    $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    199198
    200199    if ( !file_exists( $avatar_folder_dir ) )
     
    304303        $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . dirname( $original_file ), $item_id, $object, $avatar_dir );
    305304    else
    306         $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     305        $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    307306
    308307    if ( !file_exists( $avatar_folder_dir ) )
     
    368367}
    369368
     369function bp_core_avatar_upload_path() {
     370    if ( bp_core_is_multiblog_install() )
     371        $path = ABSPATH . get_blog_option( BP_ROOT_BLOG, 'upload_path' );
     372    else
     373        $path = get_option( 'upload_path' );
     374
     375    return apply_filters( 'bp_core_avatar_upload_path', $path );
     376}
     377
    370378?>
  • trunk/bp-core/bp-core-catchuri.php

    r2088 r2209  
    3333    global $bp, $current_blog;
    3434
    35     if ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) {
     35    if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && bp_core_is_multiblog_install() ) {
    3636        /* Only catch URI's on the root blog if we are not running BP on multiple blogs */
    3737        if ( BP_ROOT_BLOG != (int) $current_blog->blog_id )
  • trunk/bp-core/bp-core-classes.php

    r2202 r2209  
    128128            $sql['join_profiledata'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id";
    129129
    130         $sql['where'] = "WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0";
     130        $sql['where'] = 'WHERE ' . bp_core_get_status_sql( 'u.' );
    131131
    132132        if ( 'active' == $type || 'online' == $type )
     
    223223
    224224        $letter = like_escape( $wpdb->escape( $letter ) );
    225 
    226         $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pf.name = %s AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter );
    227         $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pf.name = %s AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC{$pag_sql}", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter, $pag_sql );
     225        $status_sql = bp_core_get_status_sql( 'u.' );
     226
     227        $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter );
     228        $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC{$pag_sql}", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter, $pag_sql );
    228229
    229230        $total_users = $wpdb->get_var( $total_users_sql );
     
    252253
    253254        $user_sql = " AND user_id IN ( " . $wpdb->escape( $user_ids ) . " ) ";
    254 
    255         $total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT ID) FROM " . CUSTOM_USER_TABLE . " WHERE spam = 0 AND deleted = 0 AND user_status = 0 AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) " ), $wpdb->escape( $user_ids ) );
    256         $paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM " . CUSTOM_USER_TABLE . " WHERE spam = 0 AND deleted = 0 AND user_status = 0 AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}" ), $wpdb->escape( $user_ids ) );
     255        $status_sql = bp_core_get_status_sql( 'u.' );
     256
     257        $total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT ID) FROM " . CUSTOM_USER_TABLE . " WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) " ), $wpdb->escape( $user_ids ) );
     258        $paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM " . CUSTOM_USER_TABLE . " WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}" ), $wpdb->escape( $user_ids ) );
    257259
    258260        $total_users = $wpdb->get_var( $total_users_sql );
     
    277279
    278280        $search_terms = like_escape( $wpdb->escape( $search_terms ) );
    279 
    280         $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC", $search_terms );
    281         $paged_users_sql = apply_filters( 'bp_core_search_users_sql', "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );
     281        $status_sql = bp_core_get_status_sql( 'u.' );
     282
     283        $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC", $search_terms );
     284        $paged_users_sql = apply_filters( 'bp_core_search_users_sql', "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );
    282285
    283286        $total_users = $wpdb->get_var( $total_users_sql );
  • trunk/bp-core/bp-core-cssjs.php

    r2206 r2209  
    1010 */
    1111function bp_core_add_admin_bar_css() {
    12     global $current_blog;
     12    global $bp;
    1313
    1414    if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
    1515        return false;
    1616
    17     /* Fetch the admin bar css from the active theme location */
    18     if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) . '/_inc/css/adminbar.css' ) )
    19         $admin_bar_css = WP_CONTENT_URL . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) . '/_inc/css/adminbar.css';
    20     else if ( file_exists( WP_CONTENT_DIR . '/' . get_blog_option( BP_ROOT_BLOG, 'template' ) . '/_inc/css/adminbar.css' ) )
    21         $admin_bar_css = WP_CONTENT_URL . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template' ) . '/_inc/css/adminbar.css';
    22     else
    23         $admin_bar_css = BP_PLUGIN_URL . '/bp-core/css/admin-bar-fallback.css';
    24 
    25     wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $admin_bar_css ) );
     17    /* Check there is admin bar css in the currently active theme. If not fallback to the css in the plugin. */
     18    if ( !locate_template( array( '_inc/css/adminbar.css' ), false ) )
     19        wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', BP_PLUGIN_URL . '/bp-core/css/admin-bar-fallback.css' ) );
     20    else {
     21        if ( is_admin() )
     22            wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', str_replace( ABSPATH, $bp->root_domain . '/', locate_template( array( '_inc/css/adminbar.css' ), false ) ) ) );
     23    }
    2624}
    27 add_action( 'admin_menu', 'bp_core_add_admin_bar_css' );
    28 add_action( 'template_redirect', 'bp_core_add_admin_bar_css' );
     25add_action( 'init', 'bp_core_add_admin_bar_css' );
    2926
    3027/**
     
    3936    wp_enqueue_script( 'bp-admin-bar-js', BP_PLUGIN_URL . '/bp-core/js/admin-bar.js', array( 'jquery' ) );
    4037}
    41 add_action( 'admin_menu', 'bp_core_add_admin_bar_js' );
    42 add_action( 'wp', 'bp_core_add_admin_bar_js' );
     38add_action( 'init', 'bp_core_add_admin_bar_js' );
    4339
    4440/**
  • trunk/bp-core/bp-core-signup.php

    r2077 r2209  
    1919
    2020    /* If signups are disabled, just re-direct */
    21     if ( 'none' == bp_get_signup_allowed() || 'blog' == bp_get_signup_allowed() )
     21    if ( !bp_get_signup_allowed() || 'none' == bp_get_signup_allowed() || 'blog' == bp_get_signup_allowed() )
    2222        bp_core_redirect( $bp->root_domain );
    2323
     
    3333
    3434        /* Check the base account details for problems */
    35         $account_details = wpmu_validate_user_signup( $_POST['signup_username'] , $_POST['signup_email'] );
     35        $account_details = wpmu_validate_user_signup( $_POST['signup_username'], $_POST['signup_email'] );
    3636
    3737        /* If there are errors with account details, set them for display */
     
    4949        if ( ( !empty( $_POST['signup_password'] ) && !empty( $_POST['signup_password_confirm'] ) ) && $_POST['signup_password'] != $_POST['signup_password_confirm'] )
    5050            $bp->signup->errors['signup_password'] = __( 'The passwords you entered do not match.', 'buddypress' );
     51
     52        $bp->signup->username = $_POST['signup_username'];
     53        $bp->signup->email = $_POST['signup_email'];
    5154
    5255        /* Now we've checked account details, we can check profile information */
     
    122125
    123126                /* Finally, sign up the user and/or blog*/
    124                 if ( isset( $_POST['signup_with_blog'] ) )
     127                if ( isset( $_POST['signup_with_blog'] ) && bp_core_is_multiblog_install() )
    125128                    wpmu_signup_blog( $blog_details['domain'], $blog_details['path'], $blog_details['blog_title'], $_POST['signup_username'], $_POST['signup_email'], $usermeta );
    126                 else
    127                     wpmu_signup_user( $_POST['signup_username'], $_POST['signup_email'], $usermeta );
     129                else {
     130                    bp_core_signup_user( $_POST['signup_username'], $_POST['signup_password'], $_POST['signup_email'], $usermeta );
     131                }
    128132
    129133                $bp->signup->step = 'completed-confirmation';
     
    145149        $bp->signup->step = 'completed-confirmation';
    146150
    147         /* Get the activation key */
    148         if ( !$bp->signup->key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $_POST[ 'signup_username' ], $_POST[ 'signup_email' ] ) ) ) {
    149             bp_core_add_message( __( 'There was a problem uploading your avatar, please try uploading it again', 'buddypress' ) );
    150         } else {
    151             /* Hash the key to create the upload folder (added security so people don't sniff the activation key) */
    152             $bp->signup->avatar_dir = wp_hash( $bp->signup->key );
    153 
    154             /* Pass the file to the avatar upload handler */
    155             if ( bp_core_avatar_handle_upload( $_FILES, 'bp_core_signup_avatar_upload_dir' ) ) {
    156                 $bp->avatar_admin->step = 'crop-image';
    157 
    158                 /* Make sure we include the jQuery jCrop file for image cropping */
    159                 add_action( 'wp', 'bp_core_add_jquery_cropper' );
    160             }
     151        if ( bp_core_is_multiblog_install() ) {
     152            /* Get the activation key */
     153            if ( !$bp->signup->key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $_POST[ 'signup_username' ], $_POST[ 'signup_email' ] ) ) ) {
     154                bp_core_add_message( __( 'There was a problem uploading your avatar, please try uploading it again', 'buddypress' ) );
     155            } else {
     156                /* Hash the key to create the upload folder (added security so people don't sniff the activation key) */
     157                $bp->signup->avatar_dir = wp_hash( $bp->signup->key );
     158            }
     159        } else
     160            $bp->signup->avatar_dir = wp_hash( $bp->signup->username );
     161
     162        /* Pass the file to the avatar upload handler */
     163        if ( bp_core_avatar_handle_upload( $_FILES, 'bp_core_signup_avatar_upload_dir' ) ) {
     164            $bp->avatar_admin->step = 'crop-image';
     165
     166            /* Make sure we include the jQuery jCrop file for image cropping */
     167            add_action( 'wp', 'bp_core_add_jquery_cropper' );
    161168        }
    162169    }
     
    182189add_action( 'wp', 'bp_core_screen_signup', 3 );
    183190
     191function bp_core_signup_user( $user_login, $user_password, $user_email, $usermeta ) {
     192    global $bp;
     193
     194    if ( bp_core_is_multiblog_install() )
     195        return wpmu_signup_user( $user_login, $user_email, $usermeta );
     196
     197    $errors = new WP_Error();
     198
     199    $user_id = wp_create_user( $user_login, $user_password, $user_email );
     200    if ( !$user_id ) {
     201        $errors->add('registerfail', sprintf(__('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_option('admin_email')));
     202        return $errors;
     203    }
     204
     205    /* Set any profile data */
     206    if ( function_exists( 'xprofile_set_field_data' ) ) {
     207        if ( !empty( $usermeta['profile_field_ids'] ) ) {
     208            $profile_field_ids = explode( ',', $usermeta['profile_field_ids'] );
     209
     210            foreach( $profile_field_ids as $field_id ) {
     211                $current_field = $usermeta["field_{$field_id}"];
     212
     213                if ( !empty( $current_field ) )
     214                    xprofile_set_field_data( $field_id, $user_id, $current_field );
     215            }
     216        }
     217    }
     218
     219    wp_new_user_notification( $user_id, $user_pass );
     220
     221    $bp->signup->username = $user_login;
     222
     223    return $user_id;
     224}
     225
    184226function bp_core_signup_avatar_upload_dir() {
    185227    global $bp;
     
    188230        return false;
    189231
    190     $path = get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    191     $newdir = WP_CONTENT_DIR . str_replace( 'wp-content', '', $path );
    192     $newdir .= '/avatars/signups/' . $bp->signup->avatar_dir;
    193 
    194     $newbdir = $newdir;
    195 
    196     if ( !file_exists( $newdir ) )
    197         @wp_mkdir_p( $newdir );
    198 
    199     $newurl = WP_CONTENT_URL . '/blogs.dir/' . BP_ROOT_BLOG . '/files/avatars/signups/' . $bp->signup->avatar_dir;
     232    $path  = BP_AVATAR_UPLOAD_PATH . '/avatars/signups/' . $bp->signup->avatar_dir;
     233    $newbdir = $path;
     234
     235    if ( !file_exists( $path ) )
     236        @wp_mkdir_p( $path );
     237
     238    $newurl = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $path );
    200239    $newburl = $newurl;
    201240    $newsubdir = '/avatars/signups/' . $bp->signup->avatar_dir;
    202241
    203     return apply_filters( 'bp_core_signup_avatar_upload_dir', array( 'path' => $newdir, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
     242    return apply_filters( 'bp_core_signup_avatar_upload_dir', array( 'path' => $path, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
    204243}
    205244
  • trunk/bp-core/bp-core-templatetags.php

    r2199 r2209  
    11<?php
    2 
    32/***
    43 * Members template loop that will allow you to loop all members or friends of a member
     
    902901
    903902function bp_has_custom_signup_page() {
    904     if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/register.php') )
    905         return true;
    906 
    907     if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/registration/register.php') )
    908         return true;
    909 
    910     return false;
    911 }
    912 
    913 function bp_signup_page( $deprecated = true ) {
    914     if ( !$deprecated )
    915         return bp_get_signup_page();
    916     else
    917         echo bp_get_signup_page();
     903    if ( locate_template( array( 'register.php' ), false ) || locate_template( array( '/registration/register.php' ), false ) )
     904        return true;
     905
     906    return false;
     907}
     908
     909function bp_signup_page() {
     910    echo bp_get_signup_page();
    918911}
    919912    function bp_get_signup_page() {
    920913        global $bp;
    921914
    922         if ( bp_has_custom_signup_page() ) {
    923                 return apply_filters( 'bp_get_signup_page', $bp->root_domain . '/' . BP_REGISTER_SLUG );
    924         } else {
    925                 return apply_filters( 'bp_get_signup_page', $bp->root_domain . '/wp-signup.php' );
    926         }
     915        if ( bp_has_custom_signup_page() )
     916            $page = $bp->root_domain . '/' . BP_REGISTER_SLUG;
     917        else
     918            $page = $bp->root_domain . '/wp-signup.php';
     919
     920        return apply_filters( 'bp_get_signup_page', $page );
    927921    }
    928922
     
    937931}
    938932
    939 function bp_activation_page( $echo = true ) {
    940     global $bp;
    941 
    942     if ( bp_has_custom_activation_page() ) {
    943         if ( $echo )
    944             echo $bp->root_domain . '/' . BP_ACTIVATION_SLUG;
     933function bp_activation_page() {
     934    echo bp_get_activation_page();
     935}
     936    function bp_get_activation_page() {
     937        global $bp;
     938
     939        if ( bp_has_custom_activation_page() )
     940            $page = $bp->root_domain . '/' . BP_ACTIVATION_SLUG;
    945941        else
    946             return $bp->root_domain . '/' . BP_ACTIVATION_SLUG;
    947     } else {
    948         if ( $echo )
    949             echo $bp->root_domain . '/wp-activate.php';
    950         else
    951             return $bp->root_domain . '/wp-activate.php';
    952     }
    953 }
     942            $page = $bp->root_domain . '/wp-activate.php';
     943
     944        return apply_filters( 'bp_get_activation_page', $page );
     945    }
    954946
    955947function bp_search_form_action() {
     
    12191211}
    12201212    function bp_get_signup_allowed() {
    1221         return get_site_option( 'registration' );
     1213        if ( bp_core_is_multiblog_install() )
     1214            return get_site_option( 'registration' );
     1215        else {
     1216            if ( (int)get_option( 'users_can_register') )
     1217                return 'user';
     1218        }
     1219
     1220        return false;
    12221221    }
    12231222
     
    12261225
    12271226    return $bp->activation_complete;
     1227}
     1228
     1229function bp_registration_needs_activation() {
     1230    return apply_filters( 'bp_registration_needs_activation', bp_core_is_multiblog_install() );
    12281231}
    12291232
  • trunk/bp-forums/bb-config.php

    r1905 r2209  
    55 * It is very important from a security standpoint that this file is not moved.
    66 * Your actual bb-config.php file will be installed in the root of your WordPress
    7  * installation once you set up the forums component in BuddyPress.
     7 * installation once you have set up the forums component in BuddyPress.
    88 */
    99
  • trunk/bp-forums/bp-forums-admin.php

    r2114 r2209  
    158158    $file .= "\n\n" . '$bb->uri = "' . BP_PLUGIN_URL . '/bp-forums/bbpress/";';
    159159    $file .= "\n" .   '$bb->name = "' . get_blog_option( BP_ROOT_BLOG, 'name' ) . ' ' . __( 'Forums', 'buddypress' ) . '";';
    160     $file .= "\n" .   '$bb->wordpress_mu_primary_blog_id = ' . BP_ROOT_BLOG . ';';
    161     $file .= "\n\n" . 'define(\'BB_AUTH_SALT\', "' . AUTH_SALT . '");';
    162     $file .= "\n" .   'define(\'BB_LOGGED_IN_SALT\', "' . LOGGED_IN_SALT . '");';
    163     $file .= "\n" .   'define(\'BB_SECURE_AUTH_SALT\', "' . SECURE_AUTH_SALT . '");';
     160
     161    if ( bp_core_is_multiblog_install() )
     162        $file .= "\n" .   '$bb->wordpress_mu_primary_blog_id = ' . BP_ROOT_BLOG . ';';
     163
     164    if ( defined( 'AUTH_SALT' ) )
     165        $file .= "\n\n" . 'define(\'BB_AUTH_SALT\', "' . AUTH_SALT . '");';
     166
     167    if ( defined( 'LOGGED_IN_SALT' ) )
     168        $file .= "\n" .   'define(\'BB_LOGGED_IN_SALT\', "' . LOGGED_IN_SALT . '");';
     169
     170    if ( defined( 'SECURE_AUTH_SALT' ) )
     171        $file .= "\n" .   'define(\'BB_SECURE_AUTH_SALT\', "' . SECURE_AUTH_SALT . '");';
     172
    164173    $file .= "\n\n" . 'define(\'WP_AUTH_COOKIE_VERSION\', 2);';
    165174    $file .= "\n\n" . '?>';
  • trunk/bp-forums/bp-forums-bbpress.php

    r2077 r2209  
    9595        require_once( BB_PATH . 'bb-admin/includes/defaults.bb-schema.php' );
    9696
    97         dbDelta( $bb_queries );
     97        /* Backticks and "IF NOT EXISTS" break the dbDelta function. */
     98        dbDelta( str_replace( ' IF NOT EXISTS', '', str_replace( '`', '', $bb_queries ) ) );
    9899
    99100        require_once( BB_PATH . 'bb-admin/includes/functions.bb-upgrade.php' );
  • trunk/bp-forums/bp-forums-templatetags.php

    r2199 r2209  
    172172        if ( !$bp->groups->current_group->forum_id )
    173173            return false;
     174
     175        $forum_id = $bp->groups->current_group->forum_id;
    174176    }
    175177
  • trunk/bp-friends.php

    r2179 r2209  
    481481        $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
    482482
    483     return apply_filters( 'friends_get_total_friend_count', get_usermeta( $user_id, 'total_friend_count' ) );
     483    $count = get_usermeta( $user_id, 'total_friend_count' );
     484
     485    if ( empty( $count ) )
     486        $count = 0;
     487
     488    return apply_filters( 'friends_get_total_friend_count', $count );
    484489}
    485490
  • trunk/bp-groups.php

    r2189 r2209  
    19591959        $group_id = $bp->groups->current_group->id;
    19601960
    1961     $path  = get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    1962     $newdir = WP_CONTENT_DIR . str_replace( 'wp-content', '', $path );
    1963     $newdir .= '/group-avatars/' . $group_id;
    1964 
    1965     $newbdir = $newdir;
    1966 
    1967     if ( !file_exists( $newdir ) )
    1968         @wp_mkdir_p( $newdir );
    1969 
    1970     $newurl = WP_CONTENT_URL . '/blogs.dir/' . BP_ROOT_BLOG . '/files/group-avatars/' . $group_id;
     1961    $path = BP_AVATAR_UPLOAD_PATH . '/group-avatars/' . $group_id;
     1962    $newbdir = $path;
     1963
     1964    if ( !file_exists( $path ) )
     1965        @wp_mkdir_p( $path );
     1966
     1967    $newurl = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $path );
    19711968    $newburl = $newurl;
    19721969    $newsubdir = '/group-avatars/' . $group_id;
    19731970
    1974     return apply_filters( 'groups_avatar_upload_dir', array( 'path' => $newdir, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
     1971    return apply_filters( 'groups_avatar_upload_dir', array( 'path' => $path, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
    19751972}
    19761973
  • trunk/bp-messages/bp-messages-notifications.php

    r2077 r2209  
    4444    global $bp, $wpdb;
    4545
    46     $users = $wpdb->get_results( $wpdb->prepare( "SELECT ID as user_id, user_email, user_login FROM {$wpdb->base_prefix}users WHERE user_status = 0 AND spam = 0 AND deleted = 0" ) );
     46    $status_sql = bp_core_get_status_sql( 'u.' );
     47    $users = $wpdb->get_results( $wpdb->prepare( "SELECT ID as user_id, user_email, user_login FROM {$wpdb->base_prefix}users WHERE {$status_sql}" ) );
    4748
    4849    for ( $i = 0; $i < count($users); $i++ ) {
  • trunk/bp-messages/bp-messages-templatetags.php

    r2199 r2209  
    612612            return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count($thread_template->thread->recipients) ) );
    613613
    614         foreach( $thread_template->thread->recipients as $recipient )
     614        foreach( (array)$thread_template->thread->recipients as $recipient )
    615615            $recipient_links[] = bp_core_get_userlink( $recipient );
    616616
    617         return apply_filters( 'bp_get_the_thread_recipients', implode( ', ', $recipient_links ) );
     617        return apply_filters( 'bp_get_the_thread_recipients', implode( ', ', (array)$recipient_links ) );
    618618    }
    619619
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r2205 r2209  
    2323h2 {
    2424    margin: 10px 0;
    25     font-size: 20px;
     25    font-size: 22px;
     26    font-weight: normal;
    2627}
    2728
    2829h3 {
    29     font-size: 16px;
     30    font-size: 18px;
    3031    margin: 15px 0;
    3132    color: #888;
     33    font-weight: normal;
    3234}
    3335
     
    571573
    572574form.standard-form#signup_form div div.error {
    573     color: white;
    574     background: red;
     575    color: #fff;
     576    background: #e41717;
    575577    -moz-border-radius: 3px;
    576578    -webkit-border-radius: 3px;
     
    14321434
    14331435    div.post h3 {
    1434         font-size: 24px;
     1436        font-size: 26px;
    14351437        margin-bottom: 5px;
    14361438        line-height: 120%;
  • trunk/bp-themes/bp-default/_inc/global.js

    r2191 r2209  
    7070                if ( 0 == j("ul.activity-list").length ) {
    7171                    j("div.error").slideUp(100).remove();
    72                     j("div.activity").append( '<ul id="site-wide-stream" class="activity-list item-list">' );
     72                    j("div#message").slideUp(100).remove();
     73                    j("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
    7374                }
    7475
     
    366367            }
    367368        }
    368     });
    369 
    370     /* New posts */
    371     j("input#whats-new-submit").click( function() {
    372         var button = j(this);
    373         var form = button.parent().parent().parent().parent();
    374 
    375         form.children().each( function() {
    376             if ( j.nodeName(this, "textarea") || j.nodeName(this, "input") )
    377                 j(this).attr( 'disabled', 'disabled' );
    378         });
    379 
    380         j( 'form#' + form.attr('id') + ' span.ajax-loader' ).show();
    381 
    382         /* Remove any errors */
    383         j('div.error').remove();
    384         button.attr('disabled','disabled');
    385 
    386         j.post( ajaxurl, {
    387             action: 'post_update',
    388             'cookie': encodeURIComponent(document.cookie),
    389             '_wpnonce_post_update': j("input#_wpnonce_post_update").val(),
    390             'content': j("textarea#whats-new").val(),
    391             'group': j("#whats-new-post-in").val()
    392         },
    393         function(response)
    394         {
    395             j( 'form#' + form.attr('id') + ' span.ajax-loader' ).hide();
    396 
    397             form.children().each( function() {
    398                 if ( j.nodeName(this, "textarea") || j.nodeName(this, "input") )
    399                     j(this).attr( 'disabled', '' );
    400             });
    401 
    402             /* Check for errors and append if found. */
    403             if ( response[0] + response[1] == '-1' ) {
    404                 form.prepend( response.substr( 2, response.length ) );
    405                 j( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
    406                 button.attr("disabled", '');
    407             } else {
    408                 if ( 0 == j("ul#activity-stream").length ) {
    409                     j("div.error").slideUp(100).remove();
    410                     j("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
    411                 }
    412 
    413                 j("ul#activity-stream").prepend(response);
    414                 j("li.new-update").hide().slideDown( 300 );
    415                 j("li.new-update").removeClass( 'new-update' );
    416                 j("textarea#whats-new").val('');
    417 
    418                 /* Re-enable the submit button after 8 seconds. */
    419                 setTimeout( function() { button.attr("disabled", ''); }, 8000 );
    420             }
    421         });
    422 
    423         return false;
    424     });
    425 
    426     /**** Pagination Links ****************************************************/
    427 
    428     j('div#content').click( function(event) {
    429         var target = j(event.target);
    430 
    431         if ( target.parent().parent().hasClass('pagination') ) {
    432             if ( j('div.item-list-tabs li.selected').length )
    433                 var el = j('div.item-list-tabs li.selected');
    434             else
    435                 var el = j('li.filter select');
    436 
    437             var page_number = 1;
    438             var css_id = el.attr('id').split( '-' );
    439             var object = css_id[0];
    440 
    441             if ( j(target).hasClass('next') )
    442                 var page_number = Number( j('div.pagination span.current').html() ) + 1;
    443             else if ( j(target).hasClass('prev') )
    444                 var page_number = Number( j('div.pagination span.current').html() ) - 1;
    445             else
    446                 var page_number = Number( j(target).html() );
    447 
    448             bp_filter_request( j.cookie('bp-' + object + '-type'), j.cookie('bp-' + object + '-filter'), object, 'div.' + object, page_number, j.cookie('bp-' + object + '-search-terms') );
    449 
    450             return false;
    451         }
    452 
    453369    });
    454370
  • trunk/bp-themes/bp-default/activity/index.php

    r2201 r2209  
    2323
    2424                        <?php if ( is_user_logged_in() ) : ?>
    25                             <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-friends/' ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
    26                             <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-groups/' ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
     25
     26                            <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
     27                                <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-friends/' ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
     28                            <?php endif; ?>
     29
     30                            <?php if ( bp_get_total_group_count( bp_loggedin_user_id() ) ) : ?>
     31                                <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-groups/' ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
     32                            <?php endif; ?>
     33
    2734                        <?php endif; ?>
    2835
  • trunk/bp-themes/bp-default/footer.php

    r2170 r2209  
    55
    66        <div id="footer">
    7             <p><?php printf( __( '%s is proudly powered by <a href="http://mu.wordpress.org">WordPress MU</a> and <a href="http://buddypress.org">BuddyPress</a>', 'buddypress' ), bloginfo('name') ); ?></p>
     7            <?php if ( bp_core_is_multiblog_install() ) : ?>
     8                <p><?php printf( __( '%s is proudly powered by <a href="http://mu.wordpress.org">WordPress MU</a> and <a href="http://buddypress.org">BuddyPress</a>', 'buddypress' ), bloginfo('name') ); ?></p>
     9            <?php else : ?>
     10                <p><?php printf( __( '%s is proudly powered by <a href="http://wordpress.org">WordPress</a> and <a href="http://buddypress.org">BuddyPress</a>', 'buddypress' ), bloginfo('name') ); ?></p>
     11            <?php endif; ?>
    812
    913            <?php do_action( 'bp_footer' ) ?>
  • trunk/bp-themes/bp-default/header.php

    r2205 r2209  
    6161                <?php endif; ?>
    6262
    63                 <?php if ( function_exists( 'bp_blogs_install' ) ) : ?>
     63                <?php if ( function_exists( 'bp_blogs_install' ) && bp_core_is_multiblog_install() ) : ?>
    6464                    <li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>>
    6565                        <a href="<?php echo site_url() ?>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a>
  • trunk/bp-themes/bp-default/registration/register.php

    r2170 r2209  
    1212            <?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
    1313
    14                 <h2 class="pagetitle"><?php _e( 'Create an Account', 'buddypress' ) ?></h2>
     14                <h2><?php _e( 'Create an Account', 'buddypress' ) ?></h2>
    1515
    1616                <?php do_action( 'template_notices' ) ?>
     
    161161                <?php do_action( 'bp_after_signup_profile_fields' ) ?>
    162162
    163                 <?php if ( 'all' == bp_get_signup_allowed() || 'blog' == bp_get_signup_allowed() ) : ?>
     163                <?php if ( bp_core_is_multiblog_install() && 'all' == bp_get_signup_allowed() || 'blog' == bp_get_signup_allowed() ) : ?>
    164164
    165165                    <?php do_action( 'bp_before_blog_details_fields' ) ?>
     
    216216            <?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>
    217217
    218                 <h2 class="pagetitle"><?php _e( 'Sign Up Complete!', 'buddypress' ) ?></h2>
     218                <h2><?php _e( 'Sign Up Complete!', 'buddypress' ) ?></h2>
    219219
    220220                <?php do_action( 'template_notices' ) ?>
    221221
    222                 <p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ) ?></p>
     222                <?php if ( bp_registration_needs_activation() ) : ?>
     223                    <p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ) ?></p>
     224                <?php else : ?>
     225                    <p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ) ?></p>
     226                <?php endif; ?>
    223227
    224228                <?php if ( !(int)get_site_option( 'bp-disable-avatar-uploads' ) ) : ?>
     
    227231
    228232                        <h3><?php _e( 'Your Current Avatar', 'buddypress' ) ?></h3>
    229                         <p><?php _e( "We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one while you wait for your activation email?", 'buddypress' ) ?></p>
     233                        <p><?php _e( "We've fetched an avatar for your new account. If you'd like to change this, why not upload a new one?", 'buddypress' ) ?></p>
    230234
    231235                        <div id="signup-avatar">
  • trunk/bp-themes/bp-default/sidebar.php

    r2170 r2209  
    1616    <?php else : ?>
    1717
    18         <p id="login-text"><?php printf( __( 'To start connecting please log in first. You can also <a href="%s" title="Create an account">create an account</a>.', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?></p>
     18        <p id="login-text">
     19            <?php _e( 'To start connecting please log in first.', 'buddypress' ) ?>
     20            <?php if ( bp_get_signup_allowed() ) : ?>
     21                <?php printf( __( ' You can also <a href="%s" title="Create an account">create an account</a>.', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
     22            <?php endif; ?>
     23        </p>
    1924
    2025        <form name="login-form" id="login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login' ) ?>" method="post">
  • trunk/bp-xprofile.php

    r2179 r2209  
    10371037        $directory = 'avatars';
    10381038
    1039     $path  = get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    1040     $newdir = WP_CONTENT_DIR . str_replace( 'wp-content', '', $path );
    1041     $newdir .= '/avatars/' . $user_id;
    1042 
    1043     $newbdir = $newdir;
    1044 
    1045     if ( !file_exists( $newdir ) )
    1046         @wp_mkdir_p( $newdir );
    1047 
    1048     $newurl = WP_CONTENT_URL . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $directory . '/' . $user_id;
     1039    $path  = BP_AVATAR_UPLOAD_PATH . '/avatars/' . $user_id;
     1040    $newbdir = $path;
     1041
     1042    if ( !file_exists( $path ) )
     1043        @wp_mkdir_p( $path );
     1044
     1045    $newurl = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, $path );
    10491046    $newburl = $newurl;
    10501047    $newsubdir = '/avatars/' . $user_id;
    10511048
    1052     return apply_filters( 'xprofile_avatar_upload_dir', array( 'path' => $newdir, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
     1049    return apply_filters( 'xprofile_avatar_upload_dir', array( 'path' => $path, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
    10531050}
    10541051
Note: See TracChangeset for help on using the changeset viewer.