<?php
$message_count = Wo_CountMessages(array(
    'new' => true,
    'user_id' => $wo['recipient']['user_id']
));
?>
<div class="messages-recipients-list mobileopenlist <?php echo ($wo['session_active_background'] == $wo['recipient']['user_id']) ? 'active' : ''; ?>" id="messages-recipient-<?php echo $wo['recipient']['user_id']; ?>" onclick="Wo_GetUserMessages(<?php echo $wo['recipient']['user_id']; ?>,'<?php echo $wo['recipient']['name']; ?>','<?php echo $wo['recipient']['username']; ?>');" title="<?php echo $wo['recipient']['name']; ?> 
(<?php echo Wo_Time_Elapsed_String($wo['recipient']['lastseen']); ?>)">
	<span class="msg_ava_name" style="cursor:pointer;color:#555;">
		<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'];?>">
			<?php if ($wo['recipient']['lastseen'] > (time() - 60)) { ?>
				<div class="online_dot"><div class="dot"></div></div>
			<?php }?>
		</div>
		<span class="messages-user-name"><?php echo $wo['recipient']['name']; ?></span>
	</span>
	<?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>