while ($row = mysql_fetch_assoc($request))
{
// We need this to get the recipients.
$pms[] = $row['ID_PM'];
// This is the main stuff though.
$pmessages[$row['ID_PM']] = array(
'id' => $row['ID_PM'],
'from' => array(
'id' => $row['ID_MEMBER_FROM'],
'name' => $row['RealName'],
),
'recipients' => array(
'to' => array(),
'bbc' => array(),
),
'labels' => explode(',', $row['labels']),
'sent' => timeformat($row['msgtime']),
'subject' => $row['subject'],
'body' => $row['body'],
);
$templables = explode(',', $row['messageLabels']);
foreach ($pmessages[$row['ID_PM']]['labels'] as $num => $label)
{
if($label == -1)
$templables[$label] = 'inbox';
$pmessages[$row['ID_PM']]['labels'][$num] = $templables[$label];
}
}