Changeset 6557 for branches/1.6/bp-messages/bp-messages-classes.php
- Timestamp:
- 12/04/2012 12:03:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.6/bp-messages/bp-messages-classes.php
r6057 r6557 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 } … … 539 539 } 540 540 541 $notices = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" ));541 $notices = $wpdb->get_results( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" ); 542 542 543 543 return $notices; … … 547 547 global $wpdb, $bp; 548 548 549 $notice_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ));549 $notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices ); 550 550 551 551 return $notice_count; … … 555 555 global $wpdb, $bp; 556 556 557 $notice_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" ));557 $notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" ); 558 558 return new BP_Messages_Notice( $notice_id ); 559 559 }
Note: See TracChangeset
for help on using the changeset viewer.