Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 09:32:04 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Breathing room for cast variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-classes.php

    r5697 r5729  
    3636            return false;
    3737
    38         foreach ( (array)$this->messages as $key => $message )
     38        foreach ( (array) $this->messages as $key => $message )
    3939            $this->sender_ids[$message->sender_id] = $message->sender_id;
    4040
     
    113113
    114114        // Sort threads by date_sent
    115         foreach( (array)$thread_ids as $thread )
     115        foreach( (array) $thread_ids as $thread )
    116116            $sorted_threads[$thread->thread_id] = strtotime( $thread->date_sent );
    117117
     
    119119
    120120        $threads = false;
    121         foreach ( (array)$sorted_threads as $thread_id => $date_sent )
     121        foreach ( (array) $sorted_threads as $thread_id => $date_sent )
    122122            $threads[] = new BP_Messages_Thread( $thread_id );
    123123
    124         return array( 'threads' => &$threads, 'total' => (int)$total_threads );
     124        return array( 'threads' => &$threads, 'total' => (int) $total_threads );
    125125    }
    126126
     
    210210        $recipient_links = array();
    211211
    212         foreach ( (array)$recipients as $recipient )
     212        foreach ( (array) $recipients as $recipient )
    213213            $recipient_links[] = bp_core_get_userlink( $recipient->user_id );
    214214
     
    229229            return true;
    230230
    231         foreach( (array)$threads as $thread ) {
     231        foreach( (array) $threads as $thread ) {
    232232            $message_ids = maybe_unserialize( $thread->message_ids );
    233233
     
    298298        // If we have no thread_id then this is the first message of a new thread.
    299299        if ( empty( $this->thread_id ) ) {
    300             $this->thread_id = (int)$wpdb->get_var( $wpdb->prepare( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) ) + 1;
     300            $this->thread_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) ) + 1;
    301301            $new_thread = true;
    302302        }
     
    310310        if ( $new_thread ) {
    311311            // Add an recipient entry for all recipients
    312             foreach ( (array)$this->recipients as $recipient ) {
     312            foreach ( (array) $this->recipients as $recipient ) {
    313313                $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_recipients} ( user_id, thread_id, unread_count ) VALUES ( %d, %d, 1 )", $recipient->user_id, $this->thread_id ) );
    314314                $recipient_ids[] = $recipient->user_id;
Note: See TracChangeset for help on using the changeset viewer.