+ else
+ {
+ $flag = '';
+ $flag_end = '';
+ }
+ if (!isset($msg['FLAG_SEEN']) || $msg['FLAG_SEEN'] == false)
+ {
+ $bold = '<b>';
+ $bold_end = '</b>';
+ }
+ else
+ {
+ $bold = '';
+ $bold_end = '';
+ }
+ if ($mailbox == $sent_folder)
+ {
+ $italic = '<i>';
+ $italic_end = '</i>';
+ }
+ else
+ {
+ $italic = '';
+ $italic_end = '';
+ }
+ if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED'])
+ {
+ $fontstr = "<font color=\"$color[9]\">";
+ $fontstr_end = '</font>';
+ }
+ else
+ {
+ $fontstr = '';
+ $fontstr_end = '';
+ }
+
+ for ($i=0; $i < count($message_highlight_list); $i++) {
+ if (trim($message_highlight_list[$i]['value']) != '') {
+ if ($message_highlight_list[$i]['match_type'] == 'to_cc') {
+ if (strpos('^^'.strtolower($msg['TO']), strtolower($message_highlight_list[$i]['value'])) || strpos('^^'.strtolower($msg['CC']), strtolower($message_highlight_list[$i]['value']))) {
+ $hlt_color = $message_highlight_list[$i]['color'];
+ continue;
+ }
+ } else if (strpos('^^'.strtolower($msg[strtoupper($message_highlight_list[$i]['match_type'])]),strtolower($message_highlight_list[$i]['value']))) {
+ $hlt_color = $message_highlight_list[$i]['color'];
+ continue;
+ }
+ }
+ }
+
+ if (!isset($hlt_color))
+ $hlt_color = $color[4];
+
+ if ($where && $what) {
+ $search_stuff = '&where='.urlencode($where).'&what='.urlencode($what);
+ }
+
+ if ($checkall == 1)
+ $checked = ' checked';
+ else
+ $checked = '';
+
+ for ($i=1; $i <= count($index_order); $i++) {
+ switch ($index_order[$i]) {
+ case 1: # checkbox
+ echo " <td width=1% bgcolor=$hlt_color align=center><input type=checkbox name=\"msg[$t]\" value=".$msg["ID"]."$checked></TD>\n";
+ break;
+ case 2: # from
+ echo " <td width=30% bgcolor=$hlt_color>$italic$bold$flag$fontstr$senderName$fontstr_end$flag_end$bold_end$italic_end</td>\n";
+ break;
+ case 3: # date
+ echo " <td nowrap width=1% bgcolor=$hlt_color><center>$bold$flag$fontstr".$msg["DATE_STRING"]."$fontstr_end$flag_end$bold_end</center></td>\n";
+ break;
+ case 4: # subject
+ echo " <td bgcolor=$hlt_color>$bold";
+ if (! isset($search_stuff)) { $search_stuff = ''; }
+ echo "<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0$search_stuff\"";
+ do_hook("subject_link");
+ echo ">$flag";
+ if (strlen($subject) > 55)
+ echo substr($subject, 0, 50) . '...';
+ else
+ echo $subject;
+ echo "$flag_end</a>$bold_end</td>\n";
+ break;
+ case 5: # flags
+ $stuff = false;
+ echo " <td bgcolor=$hlt_color align=center width=1% nowrap><b><small>\n";
+ if (isset($msg['FLAG_ANSWERED']) &&
+ $msg['FLAG_ANSWERED'] == true) {
+ echo "A\n";
+ $stuff = true;
+ }
+ if ($msg['TYPE0'] == 'multipart') {
+ echo "+\n";
+ $stuff = true;
+ }
+ if (ereg('(1|2)',substr($msg['PRIORITY'],0,1))) {
+ echo "<font color=$color[1]>!</font>\n";
+ $stuff = true;
+ }
+ if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED']) {
+ echo "<font color=\"$color[1]\">D</font>\n";
+ $stuff = true;
+ }
+
+ if (!$stuff) echo " \n";
+ echo "</small></b></td>\n";
+ break;
+ case 6: # size
+ echo " <td bgcolor=$hlt_color width=1%>$bold$fontstr".show_readable_size($msg['SIZE'])."$fontstr_end$bold_end</td>\n";
+ break;
+ }
+ }
+
+
+ echo "</tr>\n";