X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fmailbox_display.php3;h=2666e3a84dfb19dd8c0cf05db572c26f6c5a04f7;hp=83bcca29ef197fffdd2bbb0668009d5e40835a86;hb=54a8ae32ccfb5259f230e5d2b55e1ccdd3752d76;hpb=926da13e320077a43c18149ae43f64403bfff62f diff --git a/functions/mailbox_display.php3 b/functions/mailbox_display.php3 index 83bcca29..2666e3a8 100644 --- a/functions/mailbox_display.php3 +++ b/functions/mailbox_display.php3 @@ -7,10 +7,7 @@ ** **/ - function printMessageInfo($imapConnection, $i, $from, $subject, $date, $answered, $seen) { -// getMessageHeaders($imapConnection, $i, $from, $subject, $date); - $dateParts = explode(" ", trim($date)); - $dateString = getDateString($dateParts); // this will reformat the date string into a good format for us. + function printMessageInfo($imapConnection, $i, $from, $subject, $dateString, $answered, $seen) { $senderName = getSenderName($from); if (strlen(Chop($subject)) == 0) $subject = "(no subject)"; @@ -34,18 +31,17 @@ ** This function loops through a group of messages in the mailbox and shows them **/ function showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort) { - $i = 1; + $i = 0; $j = 1; while ($j <= $numMessages) { getMessageHeaders($imapConnection, $j, $from, $subject, $date); getMessageFlags($imapConnection, $j, $flags); - echo "$date --"; - $messages[$i]["DATE"] = getTimeStamp(explode(" ", trim($date))); + $messages[$i]["TIME_STAMP"] = getTimeStamp(explode(" ", trim($date))); + $messages[$i]["DATE_STRING"] = getDateString(explode(" ", trim($date))); $messages[$i]["ID"] = $j; $messages[$i]["FROM"] = $from; $messages[$i]["SUBJECT"] = $subject; -// echo "$messages[$i][\"DATE\"]
"; $messages[$i]["FLAG_DELETED"] = false; $messages[$i]["FLAG_ANSWERED"] = false; @@ -71,10 +67,9 @@ $numMessages = $i; if ($sort == 0) - $msgs = ary_sort($messages, "DATE", -1); + $msgs = ary_sort($messages, "TIME_STAMP", -1); else - $msgs = ary_sort($messages, "DATE", 1); - + $msgs = ary_sort($messages, "TIME_STAMP", 1); if ($startMessage + 24 < $numMessages) { $nextGroup = $startMessage + 24 + 1; // +1 to go to beginning of next group @@ -118,8 +113,8 @@ echo ""; // loop through and display the info for each message. - for ($i = $startMessage;$i <= $endMessage; $i++) { - printMessageInfo($imapConnection, $msgs[$i]["ID"], $msgs[$i]["FROM"], $msgs[$i]["SUBJECT"], $msgs[$i]["DATE"], $msgs[$i]["FLAG_ANSWERED"], $msgs[$i]["FLAG_SEEN"]); + for ($i = $startMessage - 1;$i <= $endMessage - 1; $i++) { + printMessageInfo($imapConnection, $msgs[$i]["ID"], $msgs[$i]["FROM"], $msgs[$i]["SUBJECT"], $msgs[$i]["DATE_STRING"], $msgs[$i]["FLAG_ANSWERED"], $msgs[$i]["FLAG_SEEN"]); } echo "\n";