Changeset 4891
- Timestamp:
- 07/28/2011 11:04:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-classes.php
r4829 r4891 223 223 $sql['from'] = "FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON um.user_id = u.ID"; 224 224 225 if ( $search_terms && bp_is_active( 'xprofile' ) || 'alphabetical' == $type ) 226 $sql['join_profiledata'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id"; 225 // We search against xprofile fields, so we must join the table 226 if ( $search_terms && bp_is_active( 'xprofile' ) ) 227 $sql['join_profiledata_search'] = "LEFT JOIN {$bp->profile->table_name_data} spd ON u.ID = spd.user_id"; 228 229 // Alphabetical sorting is done by the xprofile Full Name field 230 if ( 'alphabetical' == $type ) 231 $sql['join_profiledata_alpha'] = "LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id"; 227 232 228 233 if ( $meta_key ) … … 271 276 if ( $search_terms && bp_is_active( 'xprofile' ) ) { 272 277 $search_terms = like_escape( $wpdb->escape( $search_terms ) ); 273 $sql['where_searchterms'] = "AND pd.value LIKE '%%$search_terms%%'";278 $sql['where_searchterms'] = "AND spd.value LIKE '%%$search_terms%%'"; 274 279 } 275 280
Note: See TracChangeset
for help on using the changeset viewer.