X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=838e402c915bfb8c4803ed5a0d10a8a81a493e65;hb=32c7898caf59016a8b858f2dc3beb7f9e0049064;hp=4f7e458a23aa4e99aa6a0b9452a0ee7505f876d6;hpb=8467bf0073db31214fb8643e06186c40821d9e1a;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 4f7e458a..838e402c 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -3,67 +3,182 @@ include("../functions/strings.php"); include("../functions/page_header.php"); include("../functions/imap.php"); + include("../functions/mime.php"); include("../functions/mailbox.php"); include("../functions/date.php"); + include("../src/load_prefs.php"); + $imapConnection = loginToImapServer($username, $key, $imapServerAddress); selectMailbox($imapConnection, $mailbox, $numMessages); - echo "
\n"; - displayPageHeader($mailbox); - $body = fetchBody($imapConnection, $passed_id); - getMessageHeaders($imapConnection, $passed_id, $passed_id, $f, $s, $d); - - $subject = $s[0]; - $d[0] = ereg_replace(" ", " ", $d[0]); -// $date = explode(" ", trim($d[0])); -// $date = getDateString($date); - $date = $d[0]; - $from_name = getSenderName($f[0]); + // $message contains all information about the message + // including header and body + $message = fetchMessage($imapConnection, $passed_id, $mailbox); + + echo ""; + echo "\n"; + displayPageHeader($color, $mailbox); + + /** translate the subject and mailbox into url-able text **/ + $url_subj = urlencode(trim(stripslashes($message["HEADER"]["SUBJECT"]))); $urlMailbox = urlencode($mailbox); + $url_replyto = urlencode($message["HEADER"]["REPLYTO"]); + + $url_replytoall = urlencode($message["HEADER"]["REPLYTO"]); + $url_replytoallcc = urlencode(getLineOfAddrs($message["HEADER"]["TO"]) . ", " . getLineOfAddrs($message["HEADER"]["CC"])); + + $dateString = getLongDateString($message["HEADER"]["DATE"]); + + /** TEXT STRINGS DEFINITIONS **/ + $echo_more = _("more"); + $echo_less = _("less"); + + /** FORMAT THE TO STRING **/ + $i = 0; + $to_string = ""; + $to_ary = $message["HEADER"]["TO"]; + while ($i < count($to_ary)) { + $to_ary[$i] = htmlspecialchars($to_ary[$i]); + if ($to_string) + $to_string = "$to_string";
- echo " Message List ";
+ echo "
|