Skip to:
Content

BuddyPress.org

Ticket #2203: 2203.002.diff

File 2203.002.diff, 8.0 KB (added by cnorris23, 11 years ago)
  • bp-friends.php

     
    317317        $friendship->friend_user_id = $friend_userid;
    318318        $friendship->is_confirmed = 0;
    319319        $friendship->is_limited = 0;
    320         $friendship->date_created = time();
     320        $friendship->date_created = gmdate( "Y-m-d H:i:s" );
    321321
    322322        if ( $force_accept )
    323323                $friendship->is_confirmed = 1;
  • bp-core/bp-core-notifications.php

     
    44        global $bp;
    55
    66        if ( !$date_notified )
    7                 $date_notified = time();
     7                $date_notified = gmdate( "Y-m-d H:i:s" );
    88
    99        $notification = new BP_Core_Notification;
    1010        $notification->item_id = $item_id;
  • bp-core/bp-core-classes.php

     
    421421
    422422                if ( $this->id ) {
    423423                        // 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 );
    425425                } else {
    426426                        // 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 );
    428428                }
    429429
    430430                if ( !$result = $wpdb->query( $sql ) )
  • bp-friends/bp-friends-classes.php

     
    6060
    6161                if ( $this->id ) {
    6262                        // 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 ) );
    6464                } else {
    6565                        // 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 ) );
    6767                        $this->id = $wpdb->insert_id;
    6868                }
    6969
     
    201201        function accept($friendship_id) {
    202202                global $wpdb, $bp;
    203203
    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 ) );
    205205        }
    206206
    207207        function reject($friendship_id) {
  • bp-messages.php

     
    327327                'recipients' => false, // Can be an array of usernames, user_ids or mixed.
    328328                'subject' => false,
    329329                'content' => false,
    330                 'date_sent' => time()
     330                'date_sent' => gmdate( "Y-m-d H:i:s" )
    331331        );
    332332
    333333        $r = wp_parse_args( $args, $defaults );
     
    412412                $notice = new BP_Messages_Notice;
    413413                $notice->subject = $subject;
    414414                $notice->message = $message;
    415                 $notice->date_sent = time();
     415                $notice->date_sent = gmdate( "Y-m-d H:i:s" );
    416416                $notice->is_active = 1;
    417417                $notice->save(); // send it.
    418418
  • bp-messages/bp-messages-templatetags.php

     
    272272        function bp_get_message_thread_last_post_date() {
    273273                global $messages_template;
    274274
    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' ) ) );
    276276        }
    277277
    278278function bp_message_thread_avatar() {
  • bp-messages/bp-messages-classes.php

     
    243243        function bp_messages_message( $id = null ) {
    244244                global $bp;
    245245
    246                 $this->date_sent = time();
     246                $this->date_sent = gmdate( "Y-m-d H:i:s" );
    247247                $this->sender_id = $bp->loggedin_user->id;
    248248
    249249                if ( $id ) {
     
    288288                }
    289289
    290290                // 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 ) ) )
    292292                        return false;
    293293
    294294                if ( $new_thread ) {
     
    387387                do_action( 'messages_notice_before_save', $this );
    388388
    389389                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 );
    391391                } else {
    392392                        $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 );
    393393                }