Make an Inbox block for privatemsg Question

I would like to make a block for printing messages from the user. 

I already have a snippet of code which print me the last 5 messages, but I want to add more information like the author and the date.

Snippet of code

global $user;

$query = _privatemsg_assemble_query('list', $user, 'inbox');

$list = array();
$count=0;
foreach ($query-&gt;execute() as $thread) {
  if ($count &lt;=5) {
    $list[] = l($thread-&gt;subject, 'messages/view/'. $thread-&gt;thread_id);
    $count++;
  } else { 
    break;
  }
}
 if ($list) { 
  print theme('item_list', array('items'=&gt;$list));
}
   else {
echo '&lt;p&gt;You still have no message yet&lt;/p&gt;';
}
Using print_r($thread); in your code gives this. 

stdClass Object
(
    [thread_id] =&gt; 2
    [subject] =&gt; Testing
    [last_updated] =&gt; 1443004733
    [has_tokens] =&gt; 0
    [is_new] =&gt; 0
    [last_reply_to_mid] =&gt; 2
    [participants] =&gt; user_187,user_298
)


The below gives an array of the participants names.

    $participants = $thread-&gt;participants;
    $msg_users = explode(",",$participants);
    $prefix = 'user_';

    $authors = array();
    foreach ($msg_users as $msg_user) {
        if (substr($msg_user, 0, strlen($prefix)) == $prefix) {
        $msg_user = substr($msg_user, strlen($prefix));
        $msg_user_names = user_load($msg_user)-&gt;name;
        $authors[] = $msg_user_names;
    }
}


And something like the below gives  the date.

print date("Y-m-d\TH:i:s\Z", $thread-&gt;last_updated);


I'm sure you can work out what to based on that. 

ps. I've wanted this exact thing so thanks for the snippet :)