From: lkehresman Date: Sun, 23 Jul 2000 15:31:05 +0000 (+0000) Subject: - made the date like Netscape Messenger: if today show time, if this week X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=d68a3926944cc2ecf743b0e9389fa5f463445910 - made the date like Netscape Messenger: if today show time, if this week show day and time, else show month day year. - Fixed error in the way we send the "from" header -- had been sending: Luke Ehresman without the quites.. needed them! - Fixed error when parsing url messages. If it is longer than the word wrap length, it doesn't wrap it. - fixed bug reported to list about next/prev not working (needed urlMailbox) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@622 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index c00e389e..52043b39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Version 0.5pre1 -- DEVELOPMENT ------------------------------ +- Date display now is similar to Netscape Messenger +- Many bugs have been reported to the list, and been squashed +- Help system developed - Folder list now shows configurable details about messages - It is now possible to select multiple subscribes/unsubscribes - Removed a bunch of annoying "success" screens, improved navigation diff --git a/INSTALL b/INSTALL index 77181a7e..b15089c0 100644 --- a/INSTALL +++ b/INSTALL @@ -1,3 +1,6 @@ +Installing SquirrelMail +======================= + Table of Contents: 1. (PHP4) Configure your webserver to work with PHP4 2. (IMAP) Setting up IMAP (not covered) diff --git a/functions/date.php b/functions/date.php index 6384d941..21326aee 100644 --- a/functions/date.php +++ b/functions/date.php @@ -181,7 +181,19 @@ } function getDateString($stamp) { - return date("M j, Y", $stamp); + $now = time(); + $midnight = $now - ($now % 86400) + 14400; + + if ($midnight < $stamp) { + // Today + return date("g:i a", $stamp); + } else if ($midnight - 604800 < $stamp) { + // This week + return date("D, g:i a", $stamp); + } else { + // before this week + return date("M j, Y", $stamp); + } } function getTimeStamp($dateParts) { diff --git a/functions/page_header.php b/functions/page_header.php index 57282df0..7b15f38f 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -62,7 +62,7 @@ if ($target != "") $target = " target=\"$target\""; - + echo ''.$text.''; } @@ -97,7 +97,7 @@ echo "  \n"; displayInternalLink ("src/options.php", _("Options"), "right"); echo "  \n"; - displayInternalLink ("src/webmail.php?right_frame=help.php", _("Help"), "Help Me!"); + displayInternalLink ("src/help.php", _("Help"), "right"); echo "  \n"; do_hook("menuline"); diff --git a/functions/strings.php b/functions/strings.php index 1270e027..a11a6fab 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -53,27 +53,31 @@ $i = 0; $line_len = strlen($words[$i])+1; $line = ""; - while ($i < count($words)) { - while ($line_len < $wrap) { - $line = "$line$words[$i] "; - $i++; - $line_len = $line_len + strlen($words[$i])+1; - } - $line_len = strlen($words[$i])+1; - if ($line_len < $wrap) { - if ($i < count($words)) // don't
the last line - $line = "$line\n"; - } else { - $endline = $words[$i]; - while ($line_len >= $wrap) { - $bigline = substr($endline, 0, $wrap); - $endline = substr($endline, $wrap, strlen($endline)); - $line_len = strlen($endline); - $line = "$line$bigline
"; + if (count($words) > 1) { + while ($i < count($words)-1) { + while ($line_len < $wrap) { + $line = "$line$words[$i] "; + $i++; + $line_len = $line_len + strlen($words[$i])+1; + } + $line_len = strlen($words[$i])+1; + if ($line_len < $wrap) { + if ($i < count($words)) // don't
the last line + $line = "$line\n"; + } else { + $endline = $words[$i]; + while ($line_len >= $wrap) { + $bigline = substr($endline, 0, $wrap); + $endline = substr($endline, $wrap, strlen($endline)); + $line_len = strlen($endline); + $line = "$line$bigline
"; + } + $line = "$line$endline
"; + $i++; } - $line = "$line$endline
"; - $i++; } + } else { + $line = $words[0]; } $line = str_replace(">", ">", $line); diff --git a/src/compose.php b/src/compose.php index 85aba181..ccf4f7eb 100644 --- a/src/compose.php +++ b/src/compose.php @@ -75,7 +75,7 @@ $body = ""; for ($i=0; $i < count($body_ary); $i++) { if ($i==0 && $forward_id) { - $tmp = "-------- " . _("Original Message") . " --------"; + $tmp = "-------- " . _("Original Message") . " --------\n"; $tmp .= _("Subject") . ": " . $orig_header->subject . "\n"; $tmp .= " " . _("From") . ": " . $orig_header->from . "\n"; $tmp .= " " . _("To") . ": " . $orig_header->to[0] . "\n"; @@ -151,7 +151,7 @@ echo "// -->\n\n"; } - echo "\n
\n"; + echo "\n\n"; if ($reply_id) { echo "\n"; } diff --git a/src/read_body.php b/src/read_body.php index 4b7fbc18..1440363b 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -179,7 +179,7 @@ $subject = decodeHeader(htmlspecialchars(stripslashes($message->header->subject))); echo "
"; - echo "\n"; + echo "
\n"; echo " "; + echo "
"; echo " "; echo " "; @@ -200,11 +200,11 @@ $prev = findPreviousMessage(); $next = findNextMessage(); if ($prev != -1) - echo "" . _("Previous") . " | "; + echo "" . _("Previous") . " | "; else echo _("Previous") . " | "; if ($next != -1) - echo "" . _("Next") . ""; + echo "" . _("Next") . ""; else echo _("Next"); } @@ -272,6 +272,8 @@ } echo "
"; echo "
"; + echo "\n"; echo " \n"; + echo "
\n"; $body = formatBody($imapConnection, $message, $color, $wrap_at); @@ -280,6 +282,8 @@ echo "$body"; echo "
"; + echo "\n"; echo " "; echo "
 
\n";