Ticket #5275: 5275.diff
File 5275.diff, 1.5 KB (added by , 11 years ago) |
---|
-
bp-members/bp-members-functions.php
512 512 if ( !$count = get_transient( 'bp_active_member_count' ) ) { 513 513 // Avoid a costly join by splitting the lookup 514 514 if ( is_multisite() ) { 515 $sql = "SELECT ID FROM {$wpdb->users} WHERE ( user_status!= 0 OR deleted != 0 OR user_status != 0)";515 $sql = "SELECT ID FROM {$wpdb->users} WHERE (spam != 0 OR deleted != 0 OR user_status != 0)"; 516 516 } else { 517 517 $sql = "SELECT ID FROM {$wpdb->users} WHERE user_status != 0"; 518 518 } … … 585 585 update_user_status( $user_id, 'spam', $is_spam ); 586 586 } 587 587 588 // Always set single site status589 $wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) );590 591 588 // Call multisite actions in single site mode for good measure 592 589 if ( !is_multisite() ) { 593 590 $wp_action = ( true === $is_spam ) ? 'make_spam_user' : 'make_ham_user'; … … 595 592 } 596 593 } 597 594 595 /** 596 * Must be run in Administration screen and front end to be sure if the Admin switch 597 * config user_status == spam when spaming from WordPress Network Admin users and 598 * BuddyPress user's profile capabilities 599 */ 600 $wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) ); 601 598 602 // Hide this user's activity 599 603 if ( ( true === $is_spam ) && bp_is_active( 'activity' ) ) { 600 604 bp_activity_hide_user_activity( $user_id );