Skip to:
Content

BuddyPress.org

Ticket #6384: 6384.01

File 6384.01, 1.5 KB (added by hnla, 9 years ago)

Update members-loop for class function , add class for loggedin users entry

Line 
1Index: src/bp-members/bp-members-template.php
2===================================================================
3--- src/bp-members/bp-members-template.php      (revision 9777)
4+++ src/bp-members/bp-members-template.php      (working copy)
5@@ -740,7 +740,7 @@
6                $current_time = bp_core_current_time();
7                $pos_in_loop  = (int) $members_template->current_member;
8 
9-               // If we've only one group in the loop, don't both with odd and even.
10+               // If we've only one member in the loop, don't both with odd and even.
11                if ( $members_template->member_count > 1 )
12                        $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd';
13                else
14@@ -751,7 +751,10 @@
15                        if ( strtotime( $current_time ) <= strtotime( '+5 minutes', strtotime( $members_template->member->last_activity ) ) )
16                                $classes[] = 'is-online';
17                }
18-
19+               // Mark the current loggedin users entry i.e 'me'
20+               if( bp_loggedin_user_id() == $members_template->member->id ) {
21+                       $classes[] = 'my-entry';
22+               }
23                /**
24                 * Filters the determined classes to add to the HTML element.
25                 *
26Index: src/bp-templates/bp-legacy/buddypress/members/members-loop.php
27===================================================================
28--- src/bp-templates/bp-legacy/buddypress/members/members-loop.php      (revision 9777)
29+++ src/bp-templates/bp-legacy/buddypress/members/members-loop.php      (working copy)
30@@ -41,7 +41,7 @@
31 
32        <?php while ( bp_members() ) : bp_the_member(); ?>
33 
34-               <li>
35+               <li <?php bp_member_class('floppy'); ?>>
36                        <div class="item-avatar">
37                                <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a>
38                        </div>