Ticket #6321: 6321.01.patch
| File 6321.01.patch, 2.0 KB (added by , 11 years ago) |
|---|
-
src/bp-templates/bp-legacy/buddypress-functions.php
1417 1417 1418 1418 if ( !empty( $result ) ) { 1419 1419 1420 // Get the zebra line classes correct on ajax requests1420 // pretend we're in the message loop 1421 1421 global $thread_template; 1422 1422 1423 1423 bp_thread_has_messages( array( 'thread_id' => (int) $_REQUEST['thread_id'] ) ); 1424 1424 1425 // set the current message to the 2nd last 1426 $thread_template->message = end( $thread_template->thread->messages ); 1427 $thread_template->message = prev( $thread_template->thread->messages ); 1428 1429 // set current message to current key 1430 $thread_template->current_message = key( $thread_template->thread->messages ); 1431 1432 // now manually iterate message like we're in the loop 1425 1433 bp_thread_the_message(); 1426 1434 1427 if ( $thread_template->message_count % 2 == 1 ) { 1428 $class = 'odd'; 1429 } else { 1430 $class = 'even alt'; 1431 } ?> 1435 // manually call oEmbed 1436 // this is needed because we're not at the beginning of the loop 1437 bp_messages_embed() 1438 ?> 1432 1439 1433 <div class="message-box new-message <?php echo $class; ?>">1440 <div class="message-box new-message <?php bp_the_thread_message_css_class(); ?>"> 1434 1441 <div class="message-metadata"> 1435 1442 <?php do_action( 'bp_before_message_meta' ); ?> 1436 1443 <?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?> … … 1443 1450 <?php do_action( 'bp_before_message_content' ); ?> 1444 1451 1445 1452 <div class="message-content"> 1446 <?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] )); ?>1453 <?php bp_the_thread_message_content(); ?> 1447 1454 </div> 1448 1455 1449 1456 <?php do_action( 'bp_after_message_content' ); ?> … … 1451 1458 <div class="clear"></div> 1452 1459 </div> 1453 1460 <?php 1461 // clean up the loop 1462 bp_thread_messages(); 1463 1454 1464 } else { 1455 1465 echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'buddypress' ) . '</p></div>'; 1456 1466 }