Next/previous is working a bit better
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 22 Nov 1999 21:20:08 +0000 (21:20 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 22 Nov 1999 21:20:08 +0000 (21:20 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@17 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/date.php3
functions/mailbox.php3
functions/mailbox_display.php3
src/right_main.php3

index b24b46fa4bc054bb08ef5379a94cee7037619817..83aae61a9d402d3bcdfafa87e43144705b63156e 100644 (file)
    }
 
    function getTimeStamp($dateParts) {
-      if (eregi("mon|tue|wed|thu|fri|sat|sun", $dateParts[0], $tmp)) {
+//      if (eregi("mon|tue|wed|thu|fri|sat|sun", $dateParts[0], $tmp)) {
          $d[0] = getHour($dateParts[4]);
          $d[1] = getMinute($dateParts[4]);
          $d[2] = getSecond($dateParts[4]);
          $d[4] = getDayOfMonth($dateParts[1]);
          $d[5] = getYear($dateParts[3]);
          return mktime($d[0], $d[1], $d[2], $d[3], $d[4], $d[5]);
-      }
-      $d[0] = getHour($dateParts[3]);
-      $d[1] = getMinute($dateParts[3]);
-      $d[2] = getSecond($dateParts[3]);
-      $d[3] = getMonthNum($dateParts[1]);
-      $d[4] = getDayOfMonth($dateParts[0]);
-      $d[5] = getYear($dateParts[2]);
-      return mktime($d[0], $d[1], $d[2], $d[3], $d[4], $d[5]);
+//      }
+//      $d[0] = getHour($dateParts[3]);
+//      $d[1] = getMinute($dateParts[3]);
+//      $d[2] = getSecond($dateParts[3]);
+//      $d[3] = getMonthNum($dateParts[1]);
+//      $d[4] = getDayOfMonth($dateParts[0]);
+//      $d[5] = getYear($dateParts[2]);
+//      return mktime($d[0], $d[1], $d[2], $d[3], $d[4], $d[5]);
    }
 ?>
index bb7a00a298e0948aec75709cddb67ffa5278ea3b..4508e419f533c3cc2b6d204124878e8815077a38 100644 (file)
             $read = substr($read, strpos($read, "FLAGS")+6, strlen($read));
             $read = trim($read);
             $flags = explode(" ", $read);;
-            $i = 0;
-            while ($i < count($flags)) {
-               $flags[$i] = substr($flags[$i], 1, strlen($flags[$i]));
-               $i++;
+            $s = 0;
+            while ($s < count($flags)) {
+               $flags[$s] = substr($flags[$s], 1, strlen($flags[$s]));
+               $s++;
             }
          } else {
             $flags[0] = "None";
index 83bcca29ef197fffdd2bbb0668009d5e40835a86..2666e3a84dfb19dd8c0cf05db572c26f6c5a04f7 100644 (file)
@@ -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)";
     ** 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\"]<BR>";
 
          $messages[$i]["FLAG_DELETED"] = false;
          $messages[$i]["FLAG_ANSWERED"] = false;
       $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
       echo "</TR>";
 
       // 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 "</TABLE>\n";
index eb8e37827a7c74e3b0746b10d254b4feafe44c8c..ab5cd7dc3dd203debb5534d5f1cd7ea2fb38e07b 100644 (file)
@@ -74,7 +74,7 @@
 
    // switch to the mailbox, and get the number of messages in it.
    selectMailbox($imapConnection, $mailbox, $numMessages);
-   $numMessages = $numMessages - 1;  // I did this so it's 0 based like the message array
+//   $numMessages = $numMessages - 1;  // I did this so it's 0 based like the message array
 
    // make a URL safe $mailbox for use in the links
    $urlMailbox = urlencode($mailbox);