single message thread sender id issue
-
I am trying to sort messageids gotten from the messageloop by the sender ids. But nothing seems to let be access the sender ids. I know the bp_get_the_thread_message_sender_id() can only be used inside a single thread. But how to i get inside? 🙂
<?php $aMessages = array();?> <?php if ( bp_has_message_threads() ) : ?> <?php while ( bp_message_threads() ) : bp_message_thread(); ?> <?php if (!array_key_exists (bp_get_the_thread_message_sender_id() , $aMessages )): ?> <?php $aMessages[bp_get_the_thread_message_sender_id()]['id'] = bp_get_message_thread_id(); var_dump($aMessages); ?> <?php endif;?> <?php endwhile; ?> <?php else: ?> <div id="message" class="info"> <p>There are no messages to display.</p> </div> <?php endif;?>
EDIT
<?php global $thread_template;?> <?php $display_name = bp_core_get_user_displayname( $thread_template->message->sender_id ); ?>
This code is not working either :/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.