Changeset 5729 for trunk/bp-messages/bp-messages-template.php
- Timestamp:
- 02/11/2012 09:32:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-template.php
r5705 r5729 56 56 $total_notice_count = BP_Messages_Notice::get_total_notice_count(); 57 57 58 if ( !$max || $max >= (int) $total_notice_count ) {58 if ( !$max || $max >= (int) $total_notice_count ) { 59 59 if ( 'notices' == $this->box ) { 60 $this->total_thread_count = (int) $total_notice_count;60 $this->total_thread_count = (int) $total_notice_count; 61 61 } 62 62 } else { 63 $this->total_thread_count = (int) $max;63 $this->total_thread_count = (int) $max; 64 64 } 65 65 … … 68 68 $this->thread_count = count( $this->threads ); 69 69 } else { 70 $this->thread_count = (int) $max;70 $this->thread_count = (int) $max; 71 71 } 72 72 } else { … … 75 75 } 76 76 77 if ( (int) $this->total_thread_count && (int)$this->pag_num ) {77 if ( (int) $this->total_thread_count && (int) $this->pag_num ) { 78 78 $this->pag_links = paginate_links( array( 79 79 'base' => add_query_arg( 'mpage', '%#%' ), 80 80 'format' => '', 81 'total' => ceil( (int) $this->total_thread_count / (int)$this->pag_num ),81 'total' => ceil( (int) $this->total_thread_count / (int) $this->pag_num ), 82 82 'current' => $this->pag_page, 83 83 'prev_text' => _x( '←', 'Message pagination previous text', 'buddypress' ), … … 130 130 if ( 'notices' != $bp->current_action ) { 131 131 $last_message_index = count( $this->thread->messages ) - 1; 132 $this->thread->messages = array_reverse( (array) $this->thread->messages );132 $this->thread->messages = array_reverse( (array) $this->thread->messages ); 133 133 134 134 // Set up the last message data 135 135 if ( count($this->thread->messages) > 1 ) { 136 136 if ( 'inbox' == $this->box ) { 137 foreach ( (array) $this->thread->messages as $key => $message ) {137 foreach ( (array) $this->thread->messages as $key => $message ) { 138 138 if ( bp_loggedin_user_id() != $message->sender_id ) { 139 139 $last_message_index = $key; … … 143 143 144 144 } elseif ( 'sentbox' == $this->box ) { 145 foreach ( (array) $this->thread->messages as $key => $message ) {145 foreach ( (array) $this->thread->messages as $key => $message ) { 146 146 if ( bp_loggedin_user_id() == $message->sender_id ) { 147 147 $last_message_index = $key; … … 296 296 global $messages_template; 297 297 298 if ( (int) $messages_template->thread->unread_count )298 if ( (int) $messages_template->thread->unread_count ) 299 299 return apply_filters( 'bp_get_message_thread_unread_count', $messages_template->thread->unread_count ); 300 300 … … 493 493 global $messages_template, $bp; 494 494 495 if ( 1 == (int) $messages_template->thread->is_active ) {495 if ( 1 == (int) $messages_template->thread->is_active ) { 496 496 $link = wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id ), 'messages_deactivate_notice' ); 497 497 } else { … … 507 507 global $messages_template; 508 508 509 if ( 1 == (int) $messages_template->thread->is_active ) {509 if ( 1 == (int) $messages_template->thread->is_active ) { 510 510 $text = __('Deactivate', 'buddypress'); 511 511 } else { … … 788 788 return apply_filters( 'bp_get_the_thread_recipients', sprintf( __( '%d Recipients', 'buddypress' ), count($thread_template->thread->recipients) ) ); 789 789 790 foreach( (array) $thread_template->thread->recipients as $recipient ) {790 foreach( (array) $thread_template->thread->recipients as $recipient ) { 791 791 if ( (int) $recipient->user_id !== bp_loggedin_user_id() ) 792 792 $recipient_links[] = bp_core_get_userlink( $recipient->user_id );
Note: See TracChangeset
for help on using the changeset viewer.