fixed some bugs in date sorting.. It is now timezone independent
[squirrelmail.git] / src / read_body.php
index 022ddd014ba3748316cc00112fb990f6b8ed31d7..1440363b5ee3c722c52f127e6aafa9727459b79c 100644 (file)
       $read = sqimap_read_data ($imapConnection, "a003", true, $a, $b); 
       
       echo "<br>";
-      echo "<table width=95% cellpadding=2 cellspacing=0 border=0 align=center>\n";
+      echo "<table width=100% cellpadding=2 cellspacing=0 border=0 align=center>\n";
       echo "   <TR><TD BGCOLOR=\"$color[9]\" WIDTH=100%><center><b>" . _("Viewing full header") . "</b> - ";
       echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more\">";
-      echo ""._("View message") . "</a></b></center></td></tr>\n";
+      echo ""._("View message") . "</a></b></center></td></tr></table>\n";
+      echo "<table width=99% cellpadding=2 cellspacing=0 border=0 align=center>\n";
       echo "<tr><td><pre>";
       for ($i=1; $i < count($read)-1; $i++) {
          $read[$i] = htmlspecialchars($read[$i]);
@@ -46,7 +47,7 @@
              substr($read[$i], 0, 1) != "&" && 
              trim($read[$i])) {
             $pre = substr($read[$i], 0, strpos($read[$i], ":"));
-            $read[$i] = str_replace("$pre", "<b>$pre</b>", $read[$i]);
+            $read[$i] = str_replace("$pre", "<b>$pre</b>", decodeHeader($read[$i]));
          }
          echo "$read[$i]";
       }
    $subject = decodeHeader(htmlspecialchars(stripslashes($message->header->subject)));
 
    echo "<BR>";
-   echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=98% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
+   echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
    echo "   <TR><TD BGCOLOR=\"$color[9]\" WIDTH=100%>";
    echo "      <TABLE WIDTH=100% CELLSPACING=0 BORDER=0 COLS=2 CELLPADDING=3>";
    echo "         <TR>";
       $prev = findPreviousMessage();
       $next = findNextMessage();
       if ($prev != -1)
-         echo "<a href=\"read_body.php?passed_id=$prev&mailbox=$mailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Previous") . "</A>&nbsp;|&nbsp;";
+         echo "<a href=\"read_body.php?passed_id=$prev&mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Previous") . "</A>&nbsp;|&nbsp;";
       else
          echo _("Previous") . "&nbsp;|&nbsp;";
       if ($next != -1)
-         echo "<a href=\"read_body.php?passed_id=$next&mailbox=$mailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Next") . "</A>";
+         echo "<a href=\"read_body.php?passed_id=$next&mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Next") . "</A>";
       else
          echo _("Next");
    }
    }
    echo "</TABLE>";
    echo "   </TD></TR>";
+   echo "</table>";
+   echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
 
    echo "   <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n";
-   $body = formatBody($message, $color, $wrap_at);
+   $body = formatBody($imapConnection, $message, $color, $wrap_at);
    echo "<BR>";
 
    echo "$body";
 
    echo "   </TD></TR>\n";
+   echo "</table>";
+   echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
    echo "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>";
    echo "</TABLE>\n";