Skip to:
Content

BuddyPress.org

Changeset 6548


Ignore:
Timestamp:
12/01/2012 12:09:55 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Messages (bp-legacy):

  • When sending messages with ajax, make sure the new message has the correct alt class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-templates/bp-legacy/buddypress-functions.php

    r6526 r6548  
    970970        $result = messages_new_message( array( 'thread_id' => $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) );
    971971
    972         if ( $result ) { ?>
    973                 <div class="message-box new-message">
     972        if ( !empty( $result ) ) {
     973
     974                // Get the zebra line classes correct on ajax requests
     975                global $thread_template;
     976
     977                bp_thread_has_messages( array( 'thread_id' => $_REQUEST['thread_id'] ) );
     978
     979                if ( $thread_template->message_count % 2 == 1 ) {
     980                        $class = 'odd';
     981                } else {
     982                        $class = 'even alt';
     983                } ?>
     984
     985                <div class="message-box new-message <?php echo $class; ?>">
    974986                        <div class="message-metadata">
    975987                                <?php do_action( 'bp_before_message_meta' ); ?>
Note: See TracChangeset for help on using the changeset viewer.