Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/24/2010 05:14:47 PM (15 years ago)
Author:
apeatling
Message:

User join filters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-classes.php

    r2925 r2951  
    125125        $sql['from'] = "FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN " . CUSTOM_USER_META_TABLE . " um ON um.user_id = u.ID";
    126126
    127         if ( $search_terms && bp_is_active( 'xprofile' ) || 'alphabetical' == $type )
    128             $sql['join_profiledata'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id";
    129 
    130127        $sql['where'] = 'WHERE ' . bp_core_get_status_sql( 'u.' );
    131128
     
    164161        }
    165162
    166         if ( $search_terms && bp_is_active( 'xprofile' ) ) {
     163        if ( $search_terms ) {
    167164            $search_terms = like_escape( $wpdb->escape( $search_terms ) );
    168             $sql['where_searchterms'] = "AND pd.value LIKE '%%$search_terms%%'";
     165            $sql['where_searchterms'] = "AND u.display_name LIKE '%%$search_terms%%'";
    169166        }
    170167
     
    177174                break;
    178175            case 'alphabetical':
    179                 $sql[] = "ORDER BY pd.value ASC";
     176                $sql[] = "ORDER BY u.display_name ASC";
    180177                break;
    181178            case 'random':
Note: See TracChangeset for help on using the changeset viewer.