Skip to:
Content

BuddyPress.org

Changeset 1252


Ignore:
Timestamp:
03/25/2009 06:01:41 PM (16 years ago)
Author:
apeatling
Message:

More restrictive wildcards on the members search so it returns more relevant results.

File:
1 edited

Legend:

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

    r1245 r1252  
    216216        like_escape($search_terms);
    217217
    218         $total_users = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(u.ID) as user_id FROM {$wpdb->base_prefix}users u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC" ) );
    219         $paged_users = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT u.ID as user_id FROM {$wpdb->base_prefix}users u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC{$pag_sql}" ) );
     218        $total_users = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(u.ID) as user_id FROM {$wpdb->base_prefix}users u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE pd.value LIKE '$search_terms%%' ORDER BY pd.value ASC" ) );
     219        $paged_users = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT u.ID as user_id FROM {$wpdb->base_prefix}users u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE pd.value LIKE '$search_terms%%' ORDER BY pd.value ASC{$pag_sql}" ) );
    220220       
    221221        return array( 'users' => $paged_users, 'total' => $total_users );
Note: See TracChangeset for help on using the changeset viewer.