Changeset 6470
- Timestamp:
- 10/29/2012 01:11:04 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-classes.php
r6342 r6470 100 100 public $uid_name = ''; 101 101 102 /** 103 * Standard response when the query should not return any rows. 104 * 105 * @since BuddyPress (1.7) 106 * @access protected 107 * @var string 108 */ 109 protected $no_results = array( 'join' => '', 'where' => '0 = 1' ); 110 111 102 112 /** Methods ***************************************************************/ 103 113 … … 286 296 } else { 287 297 // If the user has no friends, make sure the query returns null 288 $sql['where'][] = "0 = 1";298 $sql['where'][] = $this->no_results['where']; 289 299 } 290 300 } … … 296 306 // @todo remove need for bp_is_active() check 297 307 if ( false !== $search_terms && bp_is_active( 'xprofile' ) ) { 298 $found_user_ids = $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s", '%%' . like_escape( $search_terms ) . '%%' ) , ARRAY_N);308 $found_user_ids = $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s", '%%' . like_escape( $search_terms ) . '%%' ) ); 299 309 300 310 if ( ! empty( $found_user_ids ) ) { 301 311 $sql['where'][] = "u.{$this->uid_name} IN (" . implode( ',', wp_parse_id_list( $found_user_ids ) ) . ")"; 312 } else { 313 $sql['where'][] = $this->no_results['where']; 302 314 } 303 315 }
Note: See TracChangeset
for help on using the changeset viewer.