Skip to:
Content

BuddyPress.org

Ticket #6321: 6321.01.patch

File 6321.01.patch, 2.0 KB (added by r-a-y, 11 years ago)
  • src/bp-templates/bp-legacy/buddypress-functions.php

     
    14171417
    14181418        if ( !empty( $result ) ) {
    14191419
    1420                 // Get the zebra line classes correct on ajax requests
     1420                // pretend we're in the message loop
    14211421                global $thread_template;
    14221422
    14231423                bp_thread_has_messages( array( 'thread_id' => (int) $_REQUEST['thread_id'] ) );
    14241424
     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
    14251433                bp_thread_the_message();
    14261434
    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        ?>
    14321439
    1433                 <div class="message-box new-message <?php echo $class; ?>">
     1440                <div class="message-box new-message <?php bp_the_thread_message_css_class(); ?>">
    14341441                        <div class="message-metadata">
    14351442                                <?php do_action( 'bp_before_message_meta' ); ?>
    14361443                                <?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?>
     
    14431450                        <?php do_action( 'bp_before_message_content' ); ?>
    14441451
    14451452                        <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(); ?>
    14471454                        </div>
    14481455
    14491456                        <?php do_action( 'bp_after_message_content' ); ?>
     
    14511458                        <div class="clear"></div>
    14521459                </div>
    14531460        <?php
     1461                // clean up the loop
     1462                bp_thread_messages();
     1463
    14541464        } else {
    14551465                echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'buddypress' ) . '</p></div>';
    14561466        }