[buddypress-trac] [BuddyPress] #5327: bp_get_the_thread_recipients() is not displaying correctly

buddypress-trac noreply at wordpress.org
Tue Jan 7 23:40:53 UTC 2014


#5327: bp_get_the_thread_recipients() is not displaying correctly
--------------------------+--------------------
 Reporter:  colabsadmin   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.0
Component:  Messaging     |     Version:  1.9.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by henry.wright):

 Hi boonebgorges

 How about "5 participants in this conversation". I'm thinking an explicit
 reference to 'you' being in the convo isn't needed because if you can see
 the conversation then you'll know you're in it.

 Alternatively, I built something a while ago for this which outputs the
 avatars of all of the participants in the thread if the number of members
 participating is less than 6. If more than 6 then it's just a line of text
 (pretty much what is in BP core now) to save space on the page.


 {{{
 function bp_the_thread_participant_avatars() {
     global $thread_template;

     $recipient_links = array();

     if ( count( $thread_template->thread->recipients ) >= 6 )
         return apply_filters( 'bp_the_thread_participant_avatars',
 sprintf( __( '%d participants', 'buddypress' ),
 count($thread_template->thread->recipients) ) );

     foreach( (array) $thread_template->thread->recipients as $recipient )
 {

         $participant_name = bp_core_get_user_displayname(
 $recipient->user_id );
         $participant_username = bp_core_get_username( $recipient->user_id
 );

         if ( ! empty( $participant_username ) ) {

             $recipient_link = '<a href="/' . $participant_username .'/"
 title="' . $participant_name .'">' . bp_core_fetch_avatar( array(
 'item_id' => $recipient->user_id, 'width' => 30, 'height' => 30, 'class'
 => 'avatar', 'title' => $participant_name, 'alt' => $participant_name ) )
 . '</a>';
             $recipient_links[] = $recipient_link;
         }
     }
     return apply_filters( 'bp_the_thread_participant_avatars', implode(
 '', $recipient_links ) );

 }
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5327#comment:2>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list