Changeset 4592 for trunk/bp-members/bp-members-functions.php
- Timestamp:
- 07/04/2011 06:54:19 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-functions.php
r4559 r4592 482 482 global $wpdb; 483 483 484 if ( is_multisite() ) 485 $is_spammer = (int) $wpdb->get_var( $wpdb->prepare( "SELECT spam FROM $wpdb->users WHERE ID = %d", $user_id ) ); 486 else 487 $is_spammer = (int) $wpdb->get_var( $wpdb->prepare( "SELECT user_status FROM $wpdb->users WHERE ID = %d", $user_id ) ); 488 489 return apply_filters( 'bp_core_is_user_spammer', $is_spammer ); 484 // Assume user is not spam 485 $is_spammer = false; 486 487 // Get user data 488 $user = get_userdata( $user_id ); 489 490 // No user found 491 if ( empty( $user ) ) { 492 $is_spammer = false; 493 494 // User found 495 } else { 496 497 // Check if spam 498 if ( !empty( $user->spam ) ) 499 $is_spammer = true; 500 501 if ( 'spam' == $user->user_status ) 502 $is_spammer = true; 503 } 504 505 return apply_filters( 'bp_core_is_user_spammer', (bool) $is_spammer ); 490 506 } 491 507 … … 500 516 global $wpdb; 501 517 502 return apply_filters( 'bp_core_is_user_spammer', (int) $wpdb->get_var( $wpdb->prepare( "SELECT deleted FROM $wpdb->users WHERE ID = %d", $user_id ) ) ); 518 // Assume user is not deleted 519 $is_deleted = false; 520 521 // Get user data 522 $user = get_userdata( $user_id ); 523 524 // No user found 525 if ( empty( $user ) ) { 526 $is_deleted = true; 527 528 // User found 529 } else { 530 531 // Check if deleted 532 if ( !empty( $user->deleted ) ) 533 $is_deleted = true; 534 535 if ( 'deleted' == $user->user_status ) 536 $is_deleted = true; 537 538 } 539 540 return apply_filters( 'bp_core_is_user_deleted', (bool) $is_deleted ); 503 541 } 504 542
Note: See TracChangeset
for help on using the changeset viewer.