Ticket #2203: 2203.002.diff
| File 2203.002.diff, 8.0 KB (added by , 16 years ago) |
|---|
-
bp-friends.php
317 317 $friendship->friend_user_id = $friend_userid; 318 318 $friendship->is_confirmed = 0; 319 319 $friendship->is_limited = 0; 320 $friendship->date_created = time();320 $friendship->date_created = gmdate( "Y-m-d H:i:s" ); 321 321 322 322 if ( $force_accept ) 323 323 $friendship->is_confirmed = 1; -
bp-core/bp-core-notifications.php
4 4 global $bp; 5 5 6 6 if ( !$date_notified ) 7 $date_notified = time();7 $date_notified = gmdate( "Y-m-d H:i:s" ); 8 8 9 9 $notification = new BP_Core_Notification; 10 10 $notification->item_id = $item_id; -
bp-core/bp-core-classes.php
421 421 422 422 if ( $this->id ) { 423 423 // Update 424 $sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = FROM_UNIXTIME(%d), is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );424 $sql = $wpdb->prepare( "UPDATE {$bp->core->table_name_notifications} SET item_id = %d, secondary_item_id = %d, user_id = %d, component_name = %s, component_action = %d, date_notified = %s, is_new = %d ) WHERE id = %d", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id ); 425 425 } else { 426 426 // Save 427 $sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, FROM_UNIXTIME(%d), %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );427 $sql = $wpdb->prepare( "INSERT INTO {$bp->core->table_name_notifications} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, %s, %d )", $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new ); 428 428 } 429 429 430 430 if ( !$result = $wpdb->query( $sql ) ) -
bp-friends/bp-friends-classes.php
60 60 61 61 if ( $this->id ) { 62 62 // Update 63 $result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET initiator_user_id = %d, friend_user_id = %d, is_confirmed = %d, is_limited = %d, date_created = FROM_UNIXTIME(%d)) WHERE id = %d", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created, $this->id ) );63 $result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET initiator_user_id = %d, friend_user_id = %d, is_confirmed = %d, is_limited = %d, date_created = %s ) WHERE id = %d", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created, $this->id ) ); 64 64 } else { 65 65 // Save 66 $result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->friends->table_name} ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES ( %d, %d, %d, %d, FROM_UNIXTIME(%d))", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created ) );66 $result = $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->friends->table_name} ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES ( %d, %d, %d, %d, %s )", $this->initiator_user_id, $this->friend_user_id, $this->is_confirmed, $this->is_limited, $this->date_created ) ); 67 67 $this->id = $wpdb->insert_id; 68 68 } 69 69 … … 201 201 function accept($friendship_id) { 202 202 global $wpdb, $bp; 203 203 204 return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = FROM_UNIXTIME(%d) WHERE id = %d AND friend_user_id = %d", time(), $friendship_id, $bp->loggedin_user->id ) );204 return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", gmdate( "Y-m-d H:i:s" ), $friendship_id, $bp->loggedin_user->id ) ); 205 205 } 206 206 207 207 function reject($friendship_id) { -
bp-messages.php
327 327 'recipients' => false, // Can be an array of usernames, user_ids or mixed. 328 328 'subject' => false, 329 329 'content' => false, 330 'date_sent' => time()330 'date_sent' => gmdate( "Y-m-d H:i:s" ) 331 331 ); 332 332 333 333 $r = wp_parse_args( $args, $defaults ); … … 412 412 $notice = new BP_Messages_Notice; 413 413 $notice->subject = $subject; 414 414 $notice->message = $message; 415 $notice->date_sent = time();415 $notice->date_sent = gmdate( "Y-m-d H:i:s" ); 416 416 $notice->is_active = 1; 417 417 $notice->save(); // send it. 418 418 -
bp-messages/bp-messages-templatetags.php
272 272 function bp_get_message_thread_last_post_date() { 273 273 global $messages_template; 274 274 275 return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( $messages_template->thread->last_message_date) ) );275 return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( get_date_from_gmt( $messages_template->thread->last_message_date, 'U' ) ) ); 276 276 } 277 277 278 278 function bp_message_thread_avatar() { -
bp-messages/bp-messages-classes.php
243 243 function bp_messages_message( $id = null ) { 244 244 global $bp; 245 245 246 $this->date_sent = time();246 $this->date_sent = gmdate( "Y-m-d H:i:s" ); 247 247 $this->sender_id = $bp->loggedin_user->id; 248 248 249 249 if ( $id ) { … … 288 288 } 289 289 290 290 // First insert the message into the messages table 291 if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( thread_id, sender_id, subject, message, date_sent ) VALUES ( %d, %d, %s, %s, FROM_UNIXTIME(%d))", $this->thread_id, $this->sender_id, $this->subject, $this->message, $this->date_sent ) ) )291 if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( thread_id, sender_id, subject, message, date_sent ) VALUES ( %d, %d, %s, %s, %s )", $this->thread_id, $this->sender_id, $this->subject, $this->message, $this->date_sent ) ) ) 292 292 return false; 293 293 294 294 if ( $new_thread ) { … … 387 387 do_action( 'messages_notice_before_save', $this ); 388 388 389 389 if ( !$this->id ) { 390 $sql = $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_notices} (subject, message, date_sent, is_active) VALUES (%s, %s, FROM_UNIXTIME(%d), %d)", $this->subject, $this->message, $this->date_sent, $this->is_active );390 $sql = $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_notices} (subject, message, date_sent, is_active) VALUES (%s, %s, %s, %d)", $this->subject, $this->message, $this->date_sent, $this->is_active ); 391 391 } else { 392 392 $sql = $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET subject = %s, message = %s, is_active = %d WHERE id = %d", $this->subject, $this->message, $this->is_active, $this->id ); 393 393 }