Skip to:
Content

BuddyPress.org

Ticket #5114: 5114.1.diff

File 5114.1.diff, 854 bytes (added by sbrajesh, 11 years ago)

Fix the issue of showing all members on alphabetical sorting

  • bp-core/bp-core-classes.php

     
    310310                                        $sql['orderby'] = "ORDER BY u.value";
    311311                                        $sql['order']   = "ASC";
    312312                                }
    313 
     313                                //when aphabetical sorting make sure the user has activated account and not marked as spam etc
     314                                //user_status=0 means active , we are doing a NOT IN in the subquery to avoid large dataset assuming no. of spammers etc are less than active
     315                                $sql['where'][] =  $wpdb->prepare( "u.{$this->uid_name} NOT IN ( SELECT ID FROM {$wpdb->users} WHERE user_status != %d )", 0 );
     316                               
    314317                                break;
    315318
    316319                        // Any other 'type' falls through