Changeset 6497
- Timestamp:
- 11/08/2012 07:37:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-classes.php
r6413 r6497 145 145 146 146 if ( $type == 'unread' ) 147 $type_sql = $wpdb->prepare( " AND r.unread_count != 0 " );147 $type_sql = " AND r.unread_count != 0 "; 148 148 elseif ( $type == 'read' ) 149 $type_sql = $wpdb->prepare( " AND r.unread_count = 0 " );149 $type_sql = " AND r.unread_count = 0 "; 150 150 151 151 if ( !empty( $search_terms ) ) { … … 200 200 201 201 if ( $type == 'unread' ) 202 $type_sql = $wpdb->prepare( " AND unread_count != 0 " );202 $type_sql = " AND unread_count != 0 "; 203 203 else if ( $type == 'read' ) 204 $type_sql = $wpdb->prepare( " AND unread_count = 0 " );204 $type_sql = " AND unread_count = 0 "; 205 205 206 206 return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0$exclude_sender $type_sql", $user_id ) ); … … 283 283 $bp_prefix = bp_core_get_table_prefix(); 284 284 $errors = false; 285 $threads = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp_prefix}bp_messages_threads" ));285 $threads = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" ); 286 286 287 287 // Nothing to update, just return true to remove the table … … 358 358 // If we have no thread_id then this is the first message of a new thread. 359 359 if ( empty( $this->thread_id ) ) { 360 $this->thread_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" )) + 1;360 $this->thread_id = (int) $wpdb->get_var( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) + 1; 361 361 $new_thread = true; 362 362 } … … 540 540 } 541 541 542 $notices = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" ));542 $notices = $wpdb->get_results( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" ); 543 543 544 544 return $notices; … … 548 548 global $wpdb, $bp; 549 549 550 $notice_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ));550 $notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ); 551 551 552 552 return $notice_count; … … 556 556 global $wpdb, $bp; 557 557 558 $notice_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" ) ); 558 $notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" ); 559 559 560 return new BP_Messages_Notice( $notice_id ); 560 561 }
Note: See TracChangeset
for help on using the changeset viewer.