Changeset 8604
- Timestamp:
- 07/12/2014 01:03:23 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-template.php
r8482 r8604 1514 1514 1515 1515 /** 1516 * Output the CSS classes for messages within a single thread. 1517 * 1518 * @since BuddyPress (2.1.0) 1519 */ 1520 function bp_the_thread_message_css_class() { 1521 echo bp_get_the_thread_message_css_class(); 1522 } 1523 /** 1524 * Generate the CSS classes for messages within a single thread. 1525 * 1526 * @since BuddyPress (2.1.0) 1527 * 1528 * @return string 1529 */ 1530 function bp_get_the_thread_message_css_class() { 1531 global $thread_template; 1532 1533 $classes = array(); 1534 1535 // Zebra-striping 1536 $classes[] = bp_get_the_thread_message_alt_class(); 1537 1538 // ID of the sender 1539 $classes[] = 'sent-by-' . intval( $thread_template->message->sender_id ); 1540 1541 // Whether the sender is the same as the logged-in user 1542 if ( bp_loggedin_user_id() == $thread_template->message->sender_id ) { 1543 $classes[] = 'sent-by-me'; 1544 } 1545 1546 $classes = apply_filters( 'bp_get_the_thread_message_css_class', $classes ); 1547 1548 return implode( ' ', $classes ); 1549 } 1550 1551 /** 1516 1552 * Output the CSS class used for message zebra striping. 1517 1553 */ -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/messages/single.php
r7965 r8604 29 29 <?php while ( bp_thread_messages() ) : bp_thread_the_message(); ?> 30 30 31 <div class="message-box <?php bp_the_thread_message_ alt_class(); ?>">31 <div class="message-box <?php bp_the_thread_message_css_class(); ?>"> 32 32 33 33 <div class="message-metadata">
Note: See TracChangeset
for help on using the changeset viewer.