X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=e4d3c6816d33eb1502c9d31f175e74fec830a8ab;hb=e4821f6c30b9211cf836ae706aa79356f780bb0a;hp=638529a20701de8394c47b07d92f0d325c69fac6;hpb=98fe1e9ffb8c254a739f853d3b83c667b9f9f65e;p=squirrelmail.git diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 638529a2..e4d3c681 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -19,7 +19,7 @@ $senderName = sqimap_find_displayable_name($msg["FROM"]); $urlMailbox = urlencode($mailbox); - $subject = trim(stripslashes($msg["SUBJECT"])); + $subject = trim($msg["SUBJECT"]); echo "\n"; if ($msg["FLAG_FLAGGED"] == true) { $flag = ""; $flag_end = ""; } @@ -27,15 +27,17 @@ if ($mailbox == $sent_folder) { $italic = ""; $italic_end = ""; } for ($i=0; $i < count($message_highlight_list); $i++) { - if ($message_highlight_list[$i]["match_type"] == "to_cc") { - if (eregi($message_highlight_list[$i]["value"],$msg["TO"]) || eregi($message_highlight_list[$i]["value"],$msg["CC"])) { + 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; - } - } else if (eregi($message_highlight_list[$i]["value"],$msg[strtoupper($message_highlight_list[$i]["match_type"])])) { - $hlt_color = $message_highlight_list[$i]["color"]; - continue; - } + } + } } if (!$hlt_color) @@ -48,10 +50,11 @@ echo " \n"; echo " $italic$bold$flag$senderName$flag_end$bold_end$italic_end\n"; echo "
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; - if ($msg["FLAG_ANSWERED"] == true) echo " A"; - elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo " !"; - else echo "  "; - echo " $bold$flag$subject$flag_end$bold_end\n"; + + if ($msg["FLAG_ANSWERED"] == true) echo " A\n"; + elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo " !\n"; + else echo "  \n"; + echo " $bold$flag$subject$flag_end$bold_end\n"; echo "\n"; } @@ -63,6 +66,12 @@ global $msgs, $msort; global $sent_folder; global $message_highlight_list; + global $auto_expunge; + + if ($auto_expunge) { + sqimap_mailbox_expunge($imapConnection, $mailbox); + sqimap_mailbox_select($imapConnection, $mailbox); + } if (!$use_cache) { if ($numMessages >= 1) { @@ -170,26 +179,30 @@ global $folder_prefix, $sent_folder; global $imapServerAddress; - // do a check to see if the config stuff has already been included or not -// if (!isset($imapServerAddress)) -// include("../config/config.php"); - // if cache isn't already set, do it now if (!session_is_registered("msgs")) session_register("msgs"); if (!session_is_registered("msort")) session_register("msort"); + if ($startMessage + ($show_num - 1) < $numMessages) { $endMessage = $startMessage + ($show_num-1); } else { $endMessage = $numMessages; } - + + if ($endMessage < $startMessage) { + $startMessage = $startMessage - $show_num; + if ($startMessage < 1) + $startMessage = 1; + } + $nextGroup = $startMessage + $show_num; $prevGroup = $startMessage - $show_num; $urlMailbox = urlencode($mailbox); + do_hook("mailbox_index_before"); /** This is the beginning of the message list table. It wraps around all messages */ echo ""; @@ -222,6 +235,7 @@ echo "
"; echo "\n\n\n
"; + do_hook("mailbox_form_before"); echo "\n"; echo " \n"; echo " "; } else if ($startMessage == $endMessage) { // if there's only one message in the box, handle it different. - $i = $startMessage - 1; + $i = $startMessage; reset($msort); do { $key = key($msort); @@ -334,5 +348,7 @@ echo "" . _("Next") . "\n"; } echo "
\n"; @@ -290,7 +304,7 @@ if ($numMessages == 0) { // if there's no messages in this folder echo "

". _("THIS FOLDER IS EMPTY") ."
 
"; /** End of message-list table */ + + do_hook("mailbox_index_after"); } ?>