<?php
$message_count = Wo_CountMessages(array(
    'new' => true,
    'user_id' => $wo['recipient']['user_id']
));
?>
<div class="messages-recipients-list" id="messages-recipient-<?php echo $wo['recipient']['user_id']; ?>">
   <a href="#" onclick="Wo_GetUserMessages(<?php echo $wo['recipient']['user_id']; ?>,'<?php echo $wo['recipient']['name']; ?>');">
      <div class="<?php echo Wo_RightToLeft('pull-right');?>">
         <span class="new-message-alert <?php echo ($message_count == 0) ? 'hidden' : ''; ?>">
         <?php echo $message_count; ?>
         </span>
      </div>
      <div class="avatar <?php echo Wo_RightToLeft('pull-left');?>">
         <img alt="<?php echo $wo['recipient']['name']; ?> Profile Picture" src="<?php echo $wo['recipient']['avatar'];?>">
      </div>
      <span class="messages-user-name">
      <?php echo $wo['recipient']['name']; ?>
      </span>
   </a>
   <?php  if($wo['config']['user_lastseen'] == 1 && $wo['recipient']['showlastseen'] != 0) { ?>
   <div class="messages-last-seen" >
      <?php echo Wo_UserStatus($wo['recipient']['user_id'],$wo['recipient']['lastseen']); ?>
   </div>
   <?php  } ?>
   <div class="clear"></div>
</div>