** Returns some general header information -- FROM, DATE, and SUBJECT
******************************************************************************/
class small_header {
- var $from, $subject, $date;
+ var $from, $subject, $date, $to;
}
function sqimap_get_small_header ($imap_stream, $id, $sent) {
$from = _("Unknown Sender");
$g = 0;
for ($i = 0; $i < count($read); $i++) {
- if ($sent == true) {
- if (eregi ("^to:", $read[$i])) {
- $from = sqimap_find_displayable_name(substr($read[$i], 3));
- }
- } else {
- if (eregi ("^from:", $read[$i])) {
- $from = sqimap_find_displayable_name(substr($read[$i], 5));
- }
- }
-
+ if (eregi ("^to:", $read[$i])) {
+ $to = sqimap_find_displayable_name(substr($read[$i], 3));
+ }
+ if (eregi ("^from:", $read[$i])) {
+ $from = sqimap_find_displayable_name(substr($read[$i], 5));
+ }
if (eregi ("^date:", $read[$i])) {
$date = substr($read[$i], 5);
} else if (eregi ("^subject:", $read[$i])) {
}
$header = new small_header;
- $header->from = $from;
+ if ($sent == true)
+ $header->from = $to;
+ else
+ $header->from = $from;
$header->date = $date;
$header->subject = $subject;
+ $header->to = $to;
return $header;
}
if ($mailbox == $sent_folder) { $italic = "<i>"; $italic_end = "</i>"; }
for ($i=0; $i < count($message_highlight_list); $i++) {
- if (eregi($message_highlight_list[$i]["value"],$msg["FROM"])) {
+ if (eregi($message_highlight_list[$i]["value"],$msg[strtoupper($message_highlight_list[$i]["match_type"])])) {
$hlt_color = $message_highlight_list[$i]["color"];
continue;
}
$from[$q] = $hdr->from;
$date[$q] = $hdr->date;
$subject[$q] = $hdr->subject;
+ $to[$q] = $hdr->to;
$flags[$q] = sqimap_get_flags ($imapConnection, $q+1);
}
$messages[$j]["ID"] = $j+1;
$messages[$j]["FROM"] = decodeHeader($from[$j]);
$messages[$j]["SUBJECT"] = decodeHeader($subject[$j]);
+ $messages[$j]["TO"] = decodeHeader($to[$j]);
$num = 0;
while ($num < count($flags[$j])) {
$message_highlight_list[$i]["name"] = $ary[0];
$message_highlight_list[$i]["color"] = $ary[1];
$message_highlight_list[$i]["value"] = $ary[2];
+ $message_highlight_list[$i]["match_type"] = $ary[3];
}
?>
$newcolor = ereg_replace("#", "", $newcolor);
$newcolor = "$newcolor";
$value = ereg_replace(",", " ", $value);
- setPref($data_dir, $username, "highlight$id", $name.",".$newcolor.",".$value);
+ setPref($data_dir, $username, "highlight$id", $name.",".$newcolor.",".$value.",".$match_type);
$message_highlight_list[$id]["name"] = $name;
$message_highlight_list[$id]["color"] = $newcolor;
$message_highlight_list[$id]["value"] = $value;
+ $message_highlight_list[$id]["match_type"] = $match_type;
}
include("../src/load_prefs.php");
displayPageHeader($color, "None");
echo " " . $message_highlight_list[$i]["name"];
echo " </td>\n";
echo " <td bgcolor=" . $message_highlight_list[$i]["color"] . ">\n";
- echo " " . $message_highlight_list[$i]["value"];
+ echo " ".$message_highlight_list[$i]["match_type"]." = " . $message_highlight_list[$i]["value"];
echo " </td>\n";
echo "</tr>\n";
}
continue;
}
}
- if (!$selected_choose)
+ if (!$message_highlight_list[$id]["color"])
+ $selected_choose = " checked";
+ else if (!$selected_choose)
$selected_input = " checked";
echo "<form action=\"msg_highlight.php\">\n";
echo _("Match") . ":";
echo " </td>\n";
echo " <td width=60%>\n";
+ echo " <select name=match_type>\n";
+ if ($message_highlight_list[$id]["match_type"] == "from") echo " <option value=\"from\" selected>From\n";
+ else echo " <option value=\"from\">From\n";
+ if ($message_highlight_list[$id]["match_type"] == "to") echo " <option value=\"to\" selected>To\n";
+ else echo " <option value=\"to\">To\n";
+ if ($message_highlight_list[$id]["match_type"] == "subject") echo " <option value=\"subject\" selected>Subject\n";
+ else echo " <option value=\"subject\">Subject\n";
+ echo " </select>\n";
echo " <input type=\"text\" value=\"".$message_highlight_list[$id]["value"]."\" name=\"value\">";
echo " </td>\n";
echo " </tr>\n";
echo " " . $message_highlight_list[$i]["name"];
echo " </td>\n";
echo " <td bgcolor=" . $message_highlight_list[$i]["color"] . ">\n";
- echo " " . $message_highlight_list[$i]["value"];
+ echo " ".$message_highlight_list[$i]["match_type"]." = " . $message_highlight_list[$i]["value"];
echo " </td>\n";
echo "</tr>\n";
}