Changeset 5773
- Timestamp:
- 02/13/2012 03:44:13 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages/bp-messages-template.php
r5758 r5773 123 123 124 124 function the_message_thread() { 125 global $bp;126 125 127 126 $this->in_the_loop = true; 128 $this->thread = $this->next_thread();127 $this->thread = $this->next_thread(); 129 128 130 129 if ( ! bp_is_current_action( 'notices' ) ) { 131 $last_message_index = count( $this->thread->messages ) - 1;130 $last_message_index = count( $this->thread->messages ) - 1; 132 131 $this->thread->messages = array_reverse( (array) $this->thread->messages ); 133 132 … … 152 151 } 153 152 154 $this->thread->last_message_id = $this->thread->messages[$last_message_index]->id;155 $this->thread->last_message_date = $this->thread->messages[$last_message_index]->date_sent;156 $this->thread->last_sender_id = $this->thread->messages[$last_message_index]->sender_id;153 $this->thread->last_message_id = $this->thread->messages[$last_message_index]->id; 154 $this->thread->last_message_date = $this->thread->messages[$last_message_index]->date_sent; 155 $this->thread->last_sender_id = $this->thread->messages[$last_message_index]->sender_id; 157 156 $this->thread->last_message_subject = $this->thread->messages[$last_message_index]->subject; 158 157 $this->thread->last_message_content = $this->thread->messages[$last_message_index]->message; 159 158 } 160 159 161 if ( 0 == $this->current_thread ) // loop has just started 160 // loop has just started 161 if ( 0 == $this->current_thread ) { 162 162 do_action('messages_box_loop_start'); 163 } 163 164 } 164 165 } … … 185 186 } 186 187 187 if ( bp_is_current_action( 'sentbox' ) ) 188 if ( bp_is_current_action( 'sentbox' ) ) { 188 189 $box = 'sentbox'; 189 190 if ( bp_is_current_action( 'notices' ) ) 190 } 191 192 if ( bp_is_current_action( 'notices' ) ) { 191 193 $box = 'notices'; 194 } 192 195 193 196 $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type ); … … 406 409 407 410 function bp_messages_options() { 408 global $bp;?>411 ?> 409 412 410 413 <?php _e( 'Select:', 'buddypress' ) ?> … … 429 432 } 430 433 434 /** 435 * Return whether or not the notice is currently active 436 * 437 * @since BuddyPress (1.6) 438 * @uses bp_get_messages_is_active_notice() 439 */ 440 function bp_messages_is_active_notice() { 441 global $messages_template; 442 443 if ( $messages_template->thread->is_active ) 444 return true; 445 446 return false; 447 } 448 449 /** 450 * Output a string for the active notice 451 * 452 * Since 1.6 this function has been deprecated in favor of text in the theme 453 * 454 * @since BuddyPress (1.0) 455 * @deprecated BuddyPress (1.6) 456 * @uses bp_get_message_is_active_notice() 457 */ 431 458 function bp_message_is_active_notice() { 432 global $messages_template; 433 434 if ( $messages_template->thread->is_active ) { 435 echo "<strong>"; 436 _e( 'Currently Active', 'buddypress' ); 437 echo "</strong>"; 438 } 439 } 459 echo bp_get_message_is_active_notice(); 460 } 461 /** 462 * Returns a string for the active notice 463 * 464 * Since 1.6 this function has been deprecated in favor of text in the theme 465 * 466 * @since BuddyPress (1.0) 467 * @deprecated BuddyPress (1.6) 468 * @uses bp_messages_is_active_notice() 469 */ 440 470 function bp_get_message_is_active_notice() { 441 global $messages_template; 442 443 if ( $messages_template->thread->is_active)444 return true;445 446 return false;471 472 $string = ''; 473 if ( bp_messages_is_active_notice() ) 474 $string = __( 'Currently Active', 'buddypress' ); 475 476 return apply_filters( 'bp_get_message_is_active_notice', $string ); 447 477 } 448 478 -
trunk/bp-themes/bp-default/members/single/messages/notices-loop.php
r5737 r5773 21 21 <?php while ( bp_message_threads() ) : bp_message_thread(); ?> 22 22 <tr id="notice-<?php bp_message_notice_id(); ?>" class="<?php bp_message_css_class(); ?>"> 23 <td width="1%"> 24 </td> 23 <td width="1%"></td> 25 24 <td width="38%"> 26 25 <strong><?php bp_message_notice_subject(); ?></strong> … … 28 27 </td> 29 28 <td width="21%"> 30 <strong><?php bp_message_is_active_notice(); ?></strong> 31 <span class="activity"><?php _e("Sent:", "buddypress"); ?> <?php bp_message_notice_post_date(); ?></span> 29 30 <?php if ( bp_messages_is_active_notice() ) : ?> 31 32 <strong><?php bp_messages_is_active_notice(); ?></strong> 33 34 <?php endif; ?> 35 36 <span class="activity"><?php _e( 'Sent:', 'buddypress' ); ?> <?php bp_message_notice_post_date(); ?></span> 32 37 </td> 33 38
Note: See TracChangeset
for help on using the changeset viewer.