Changeset 2209
- Timestamp:
- 12/27/2009 10:41:10 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 26 edited
-
bp-blogs.php (modified) (9 diffs)
-
bp-core.php (modified) (7 diffs)
-
bp-core/bp-core-activation.php (modified) (1 diff)
-
bp-core/bp-core-adminbar.php (modified) (5 diffs)
-
bp-core/bp-core-avatars.php (modified) (6 diffs)
-
bp-core/bp-core-catchuri.php (modified) (1 diff)
-
bp-core/bp-core-classes.php (modified) (4 diffs)
-
bp-core/bp-core-cssjs.php (modified) (2 diffs)
-
bp-core/bp-core-signup.php (modified) (7 diffs)
-
bp-core/bp-core-templatetags.php (modified) (5 diffs)
-
bp-core/bp-core-wpabstraction.php (added)
-
bp-forums/bb-config.php (modified) (1 diff)
-
bp-forums/bp-forums-admin.php (modified) (1 diff)
-
bp-forums/bp-forums-bbpress.php (modified) (1 diff)
-
bp-forums/bp-forums-templatetags.php (modified) (1 diff)
-
bp-friends.php (modified) (1 diff)
-
bp-groups.php (modified) (1 diff)
-
bp-messages/bp-messages-notifications.php (modified) (1 diff)
-
bp-messages/bp-messages-templatetags.php (modified) (1 diff)
-
bp-themes/bp-default/_inc/css/default.css (modified) (3 diffs)
-
bp-themes/bp-default/_inc/global.js (modified) (2 diffs)
-
bp-themes/bp-default/activity/index.php (modified) (1 diff)
-
bp-themes/bp-default/footer.php (modified) (1 diff)
-
bp-themes/bp-default/header.php (modified) (1 diff)
-
bp-themes/bp-default/registration/register.php (modified) (4 diffs)
-
bp-themes/bp-default/sidebar.php (modified) (1 diff)
-
bp-xprofile.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r2179 r2209 65 65 // On first installation - record all existing blogs in the system. 66 66 if ( !(int)get_site_option( 'bp-blogs-first-install') ) { 67 68 67 bp_blogs_record_existing_blogs(); 69 68 add_site_option( 'bp-blogs-first-install', 1 ); 70 71 } else {72 73 // Import blog titles and descriptions into the blogmeta table74 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 87 69 } 88 70 … … 139 121 function bp_blogs_setup_nav() { 140 122 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; 141 128 142 129 /* Add 'Blogs' to the main navigation */ … … 171 158 global $bp; 172 159 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 ) ) { 174 161 $bp->is_directory = true; 175 162 … … 190 177 191 178 function bp_blogs_screen_my_blogs() { 179 global $bp; 180 181 if ( !bp_core_is_multiblog_install() ) 182 return false; 183 192 184 do_action( 'bp_blogs_screen_my_blogs' ); 193 185 bp_core_load_template( apply_filters( 'bp_blogs_template_my_blogs', 'members/single/home' ) ); … … 207 199 global $bp; 208 200 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 ) 210 202 return false; 211 203 … … 379 371 bp_blogs_update_blogmeta( $recorded_post->blog_id, 'last_activity', time() ); 380 372 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() ) { 382 374 /* Record this in activity streams */ 383 375 $post_permalink = bp_post_get_permalink( $post, $blog_id ); … … 415 407 } 416 408 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() ) { 418 410 /* Now re-record the post in the activity streams */ 419 411 $post_permalink = bp_post_get_permalink( $post, $blog_id ); … … 469 461 bp_blogs_update_blogmeta( $recorded_comment->blog_id, 'last_activity', time() ); 470 462 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() ) { 472 464 /* Record in activity streams */ 473 465 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id ); … … 503 495 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' ) ); 504 496 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() ) { 506 498 /* Record in activity streams */ 507 499 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id ); -
trunk/bp-core.php
r2200 r2209 11 11 define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' ); 12 12 define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) ); 13 14 /* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */ 15 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' ); 13 16 14 17 /* Place your custom code (actions/filters) in a file called /plugins/bp-custom.php and it will be loaded before anything else. */ … … 63 66 define( 'BP_HOME_BLOG_SLUG', 'blog' ); 64 67 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 */ 69 if ( function_exists( 'register_theme_directory') ) 70 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' ); 68 71 69 72 … … 414 417 */ 415 418 function bp_core_action_set_spammer_status() { 416 global $bp ;419 global $bp, $wpdb; 417 420 418 421 if ( !is_site_admin() || bp_is_home() || !$bp->displayed_user->id ) … … 424 427 425 428 /* 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' ); 427 431 428 432 if ( 'mark-spammer' == $bp->current_action ) … … 447 451 448 452 /* 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 ) ); 450 457 451 458 if ( $is_spam ) … … 1169 1176 */ 1170 1177 function 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}" ) ); 1174 1183 return apply_filters( 'bp_core_get_total_member_count', $count ); 1175 1184 } … … 1187 1196 global $wpdb; 1188 1197 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 ); 1190 1204 } 1191 1205 -
trunk/bp-core/bp-core-activation.php
r2157 r2209 4 4 global $bp, $wpdb; 5 5 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 ) 11 7 return false; 12 8 -
trunk/bp-core/bp-core-adminbar.php
r2189 r2209 2 2 3 3 function bp_core_admin_bar() { 4 global $bp, $wpdb, $current_blog , $doing_admin_bar;4 global $bp, $wpdb, $current_blog; 5 5 6 6 if ( defined( 'BP_DISABLE_ADMIN_BAR' ) ) 7 7 return false; 8 9 $doing_admin_bar = true;10 8 11 9 if ( (int)get_site_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) … … 43 41 44 42 // 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>'; 47 45 } 48 46 } … … 251 249 <?php endif; ?> 252 250 253 <?php if ( function_exists('bp_blogs_install') ) : ?>251 <?php if ( function_exists('bp_blogs_install') && bp_core_is_multiblog_install() ) : ?> 254 252 <li><a href="<?php echo $bp->root_domain . '/' . $bp->blogs->slug . '/?random-blog' ?>"><?php _e( 'Random Blog', 'buddypress' ) ?></a></li> 255 253 … … 260 258 </li> 261 259 <?php 262 263 $doing_admin_bar = false;264 260 } 265 261 … … 267 263 add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 ); 268 264 add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 ); 269 add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 ); 265 266 if ( bp_core_is_multiblog_install() ) 267 add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 ); 268 270 269 add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 ); 271 add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 ); 270 271 if ( bp_core_is_multiblog_install() ) 272 add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 ); 273 272 274 add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 ); 273 275 -
trunk/bp-core/bp-core-avatars.php
r2168 r2209 9 9 */ 10 10 11 if ( !defined( 'BP_AVATAR_UPLOAD_PATH' ) ) 12 define( 'BP_AVATAR_UPLOAD_PATH', bp_core_avatar_upload_path() ); 13 11 14 if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) ) 12 15 define( 'BP_AVATAR_THUMB_WIDTH', 50 ); … … 24 27 define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 ); 25 28 26 if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) 27 define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', get_site_option( 'fileupload_maxk' ) * 1024 ); 29 if ( !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 } 28 35 29 36 if ( !defined( 'BP_AVATAR_DEFAULT' ) ) … … 95 102 $html_height = ( 'thumb' == $type ) ? ' height="' . BP_AVATAR_THUMB_HEIGHT . '"' : ' height="' . BP_AVATAR_FULL_HEIGHT . '"'; 96 103 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 ); 99 106 100 107 /**** … … 188 195 } 189 196 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 ); 199 198 200 199 if ( !file_exists( $avatar_folder_dir ) ) … … 304 303 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . dirname( $original_file ), $item_id, $object, $avatar_dir ); 305 304 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 ); 307 306 308 307 if ( !file_exists( $avatar_folder_dir ) ) … … 368 367 } 369 368 369 function 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 370 378 ?> -
trunk/bp-core/bp-core-catchuri.php
r2088 r2209 33 33 global $bp, $current_blog; 34 34 35 if ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) {35 if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && bp_core_is_multiblog_install() ) { 36 36 /* Only catch URI's on the root blog if we are not running BP on multiple blogs */ 37 37 if ( BP_ROOT_BLOG != (int) $current_blog->blog_id ) -
trunk/bp-core/bp-core-classes.php
r2202 r2209 128 128 $sql['join_profiledata'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id"; 129 129 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.' ); 131 131 132 132 if ( 'active' == $type || 'online' == $type ) … … 223 223 224 224 $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 ); 228 229 229 230 $total_users = $wpdb->get_var( $total_users_sql ); … … 252 253 253 254 $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 ) ); 257 259 258 260 $total_users = $wpdb->get_var( $total_users_sql ); … … 277 279 278 280 $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 ); 282 285 283 286 $total_users = $wpdb->get_var( $total_users_sql ); -
trunk/bp-core/bp-core-cssjs.php
r2206 r2209 10 10 */ 11 11 function bp_core_add_admin_bar_css() { 12 global $ current_blog;12 global $bp; 13 13 14 14 if ( defined( 'BP_DISABLE_ADMIN_BAR' ) ) 15 15 return false; 16 16 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 } 26 24 } 27 add_action( 'admin_menu', 'bp_core_add_admin_bar_css' ); 28 add_action( 'template_redirect', 'bp_core_add_admin_bar_css' ); 25 add_action( 'init', 'bp_core_add_admin_bar_css' ); 29 26 30 27 /** … … 39 36 wp_enqueue_script( 'bp-admin-bar-js', BP_PLUGIN_URL . '/bp-core/js/admin-bar.js', array( 'jquery' ) ); 40 37 } 41 add_action( 'admin_menu', 'bp_core_add_admin_bar_js' ); 42 add_action( 'wp', 'bp_core_add_admin_bar_js' ); 38 add_action( 'init', 'bp_core_add_admin_bar_js' ); 43 39 44 40 /** -
trunk/bp-core/bp-core-signup.php
r2077 r2209 19 19 20 20 /* 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() ) 22 22 bp_core_redirect( $bp->root_domain ); 23 23 … … 33 33 34 34 /* 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'] ); 36 36 37 37 /* If there are errors with account details, set them for display */ … … 49 49 if ( ( !empty( $_POST['signup_password'] ) && !empty( $_POST['signup_password_confirm'] ) ) && $_POST['signup_password'] != $_POST['signup_password_confirm'] ) 50 50 $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']; 51 54 52 55 /* Now we've checked account details, we can check profile information */ … … 122 125 123 126 /* 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() ) 125 128 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 } 128 132 129 133 $bp->signup->step = 'completed-confirmation'; … … 145 149 $bp->signup->step = 'completed-confirmation'; 146 150 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' ); 161 168 } 162 169 } … … 182 189 add_action( 'wp', 'bp_core_screen_signup', 3 ); 183 190 191 function 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’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 184 226 function bp_core_signup_avatar_upload_dir() { 185 227 global $bp; … … 188 230 return false; 189 231 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 ); 200 239 $newburl = $newurl; 201 240 $newsubdir = '/avatars/signups/' . $bp->signup->avatar_dir; 202 241 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 ) ); 204 243 } 205 244 -
trunk/bp-core/bp-core-templatetags.php
r2199 r2209 1 1 <?php 2 3 2 /*** 4 3 * Members template loop that will allow you to loop all members or friends of a member … … 902 901 903 902 function 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 909 function bp_signup_page() { 910 echo bp_get_signup_page(); 918 911 } 919 912 function bp_get_signup_page() { 920 913 global $bp; 921 914 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 ); 927 921 } 928 922 … … 937 931 } 938 932 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; 933 function 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; 945 941 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 } 954 946 955 947 function bp_search_form_action() { … … 1219 1211 } 1220 1212 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; 1222 1221 } 1223 1222 … … 1226 1225 1227 1226 return $bp->activation_complete; 1227 } 1228 1229 function bp_registration_needs_activation() { 1230 return apply_filters( 'bp_registration_needs_activation', bp_core_is_multiblog_install() ); 1228 1231 } 1229 1232 -
trunk/bp-forums/bb-config.php
r1905 r2209 5 5 * It is very important from a security standpoint that this file is not moved. 6 6 * 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. 8 8 */ 9 9 -
trunk/bp-forums/bp-forums-admin.php
r2114 r2209 158 158 $file .= "\n\n" . '$bb->uri = "' . BP_PLUGIN_URL . '/bp-forums/bbpress/";'; 159 159 $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 164 173 $file .= "\n\n" . 'define(\'WP_AUTH_COOKIE_VERSION\', 2);'; 165 174 $file .= "\n\n" . '?>'; -
trunk/bp-forums/bp-forums-bbpress.php
r2077 r2209 95 95 require_once( BB_PATH . 'bb-admin/includes/defaults.bb-schema.php' ); 96 96 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 ) ) ); 98 99 99 100 require_once( BB_PATH . 'bb-admin/includes/functions.bb-upgrade.php' ); -
trunk/bp-forums/bp-forums-templatetags.php
r2199 r2209 172 172 if ( !$bp->groups->current_group->forum_id ) 173 173 return false; 174 175 $forum_id = $bp->groups->current_group->forum_id; 174 176 } 175 177 -
trunk/bp-friends.php
r2179 r2209 481 481 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 482 482 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 ); 484 489 } 485 490 -
trunk/bp-groups.php
r2189 r2209 1959 1959 $group_id = $bp->groups->current_group->id; 1960 1960 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 ); 1971 1968 $newburl = $newurl; 1972 1969 $newsubdir = '/group-avatars/' . $group_id; 1973 1970 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 ) ); 1975 1972 } 1976 1973 -
trunk/bp-messages/bp-messages-notifications.php
r2077 r2209 44 44 global $bp, $wpdb; 45 45 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}" ) ); 47 48 48 49 for ( $i = 0; $i < count($users); $i++ ) { -
trunk/bp-messages/bp-messages-templatetags.php
r2199 r2209 612 612 return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count($thread_template->thread->recipients) ) ); 613 613 614 foreach( $thread_template->thread->recipients as $recipient )614 foreach( (array)$thread_template->thread->recipients as $recipient ) 615 615 $recipient_links[] = bp_core_get_userlink( $recipient ); 616 616 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 ) ); 618 618 } 619 619 -
trunk/bp-themes/bp-default/_inc/css/default.css
r2205 r2209 23 23 h2 { 24 24 margin: 10px 0; 25 font-size: 20px; 25 font-size: 22px; 26 font-weight: normal; 26 27 } 27 28 28 29 h3 { 29 font-size: 1 6px;30 font-size: 18px; 30 31 margin: 15px 0; 31 32 color: #888; 33 font-weight: normal; 32 34 } 33 35 … … 571 573 572 574 form.standard-form#signup_form div div.error { 573 color: white;574 background: red;575 color: #fff; 576 background: #e41717; 575 577 -moz-border-radius: 3px; 576 578 -webkit-border-radius: 3px; … … 1432 1434 1433 1435 div.post h3 { 1434 font-size: 2 4px;1436 font-size: 26px; 1435 1437 margin-bottom: 5px; 1436 1438 line-height: 120%; -
trunk/bp-themes/bp-default/_inc/global.js
r2191 r2209 70 70 if ( 0 == j("ul.activity-list").length ) { 71 71 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">' ); 73 74 } 74 75 … … 366 367 } 367 368 } 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 else435 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 else446 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 453 369 }); 454 370 -
trunk/bp-themes/bp-default/activity/index.php
r2201 r2209 23 23 24 24 <?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 27 34 <?php endif; ?> 28 35 -
trunk/bp-themes/bp-default/footer.php
r2170 r2209 5 5 6 6 <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; ?> 8 12 9 13 <?php do_action( 'bp_footer' ) ?> -
trunk/bp-themes/bp-default/header.php
r2205 r2209 61 61 <?php endif; ?> 62 62 63 <?php if ( function_exists( 'bp_blogs_install' ) ) : ?>63 <?php if ( function_exists( 'bp_blogs_install' ) && bp_core_is_multiblog_install() ) : ?> 64 64 <li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>> 65 65 <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 12 12 <?php if ( 'request-details' == bp_get_current_signup_step() ) : ?> 13 13 14 <h2 class="pagetitle"><?php _e( 'Create an Account', 'buddypress' ) ?></h2>14 <h2><?php _e( 'Create an Account', 'buddypress' ) ?></h2> 15 15 16 16 <?php do_action( 'template_notices' ) ?> … … 161 161 <?php do_action( 'bp_after_signup_profile_fields' ) ?> 162 162 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() ) : ?> 164 164 165 165 <?php do_action( 'bp_before_blog_details_fields' ) ?> … … 216 216 <?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?> 217 217 218 <h2 class="pagetitle"><?php _e( 'Sign Up Complete!', 'buddypress' ) ?></h2>218 <h2><?php _e( 'Sign Up Complete!', 'buddypress' ) ?></h2> 219 219 220 220 <?php do_action( 'template_notices' ) ?> 221 221 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; ?> 223 227 224 228 <?php if ( !(int)get_site_option( 'bp-disable-avatar-uploads' ) ) : ?> … … 227 231 228 232 <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> 230 234 231 235 <div id="signup-avatar"> -
trunk/bp-themes/bp-default/sidebar.php
r2170 r2209 16 16 <?php else : ?> 17 17 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> 19 24 20 25 <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 1037 1037 $directory = 'avatars'; 1038 1038 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 ); 1049 1046 $newburl = $newurl; 1050 1047 $newsubdir = '/avatars/' . $user_id; 1051 1048 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 ) ); 1053 1050 } 1054 1051
Note: See TracChangeset
for help on using the changeset viewer.