From: lkehresman Date: Wed, 8 Dec 1999 20:13:14 +0000 (+0000) Subject: reconstructed the left folder list X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=ff89ac8a64bfe112bb528df0d143f90a5b73c76e reconstructed the left folder list bugfixed: reply and forward work again beautified many things git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@71 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/mailbox.php b/functions/mailbox.php index b5fa548d..eb7607a2 100644 --- a/functions/mailbox.php +++ b/functions/mailbox.php @@ -11,6 +11,7 @@ // select mailbox fputs($imapConnection, "mailboxSelect SELECT \"$mailbox\"\n"); $read = fgets($imapConnection, 1024); + $unseen = false; while ((substr($read, 0, 16) != "mailboxSelect OK") && (substr($read, 0, 17) != "mailboxSelect BAD")) { if (substr(Chop($read), -6) == "EXISTS") { $array = explode(" ", $read); @@ -20,6 +21,25 @@ } } + function unseenMessages($imapConnection, &$numUnseen) { + fputs($imapConnection, "1 SEARCH UNSEEN NOT DELETED\n"); + $read = fgets($imapConnection, 1024); + $unseen = false; + + if (strlen($read) > 10) { + $unseen = true; + $ary = explode(" ", $read); + $numUnseen = count($ary) - 2; + } + else { + $unseen = false; + $numUnseen = 0; + } + + $read = fgets($imapConnection, 1024); + return $unseen; + } + /** This function sends a request to the IMAP server for headers, 50 at a time ** until $end is reached. I originally had it do them all at one time, but found ** it slightly faster to do it this way. @@ -183,10 +203,8 @@ function copyMessages($imapConnection, $from_id, $to_id, $folder) { fputs($imapConnection, "mailboxStore COPY $from_id:$to_id \"$folder\"\n"); $read = fgets($imapConnection, 1024); - echo ">>> $read
"; while ((substr($read, 0, 15) != "mailboxStore OK") && (substr($read, 0, 15) != "mailboxStore NO")) { $read = fgets($imapConnection, 1024); - echo ">>> $read
"; } if (substr($read, 0, 15) == "mailboxStore NO") { @@ -244,7 +262,7 @@ while ($count < count($read)) { $read[$count] = "^^$read[$count]"; - if (strpos(strtolower($read[$count]), "") == true) { + if (strpos(strtolower($read[$count]), "") == true) { $useHTML = false; @@ -277,14 +295,12 @@ $line = str_replace(">", ">", $line); } - $wrap_at = 80; // Make this configurable int the config file some time + $wrap_at = 86; // Make this configurable int the config file some time if (strlen($line) - 2 >= $wrap_at) // -2 because of the ^^ at the beginning $line = wordWrap($line, $wrap_at); $line = str_replace(" ", " ", $line); $line = str_replace("\t", "        ", $line); - $line = str_replace("\n", "", $line); - $line = str_replace("\r", "", $line); /** if >> or > are found at the beginning of a line, I'll assume that was replied text, so make it different colors **/ diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 9d40e699..9b069dcd 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -11,6 +11,7 @@ function printMessageInfo($imapConnection, $t, $i, $from, $subject, $dateString, $answered, $seen, $mailbox, $sort, $startMessage) { $senderName = getSenderName($from); $urlMailbox = urlencode($mailbox); + $subject = trim($subject); echo "\n"; if ($seen == false) { echo " \n"; diff --git a/src/compose.php b/src/compose.php index 4ac944e8..db405d08 100644 --- a/src/compose.php +++ b/src/compose.php @@ -29,8 +29,7 @@ } echo "
\n"; - echo "
"; - echo "\n"; + echo "
\n"; echo " \n"; echo " \n"; echo " \n"; + echo " \n"; echo " \n"; echo " \n"; + echo " \n"; + echo " "; + echo " "; + echo " \n"; echo "
\n"; echo " To: \n"; @@ -55,6 +54,7 @@ echo "
"; echo "
\n"; echo " Subject:\n"; @@ -64,13 +64,18 @@ else if ($forward_subj) echo "
"; else - echo "
"; + echo " "; + echo "  
"; echo "
\n"; + echo " \n"; + echo "
"; + echo "
\n"; - - echo "
"; - echo ""; - echo "
"; + echo "
"; echo "
"; ?> \ No newline at end of file diff --git a/src/compose_send.php b/src/compose_send.php index b5057d66..016ef3c7 100644 --- a/src/compose_send.php +++ b/src/compose_send.php @@ -32,6 +32,7 @@ displayPageHeader("None"); plain_error_message("You have not entered a subject."); echo "
\n"; + echo "
"; echo "
"; echo "
"; echo "
Subject:
"; diff --git a/src/left_main.php b/src/left_main.php index 2c13f745..3b2929e2 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -31,7 +31,7 @@ } - + "; - echo "
$org_name
"; - echo "Folders
"; - echo "
"; - echo "\n"; + echo "
"; + echo "Folders
"; + echo "(refresh folder list)

"; + echo "\n"; for ($i = 0;$i < count($str); $i++) { $mailbox = Chop($str[$i]); $mailbox = findMailboxName($mailbox); @@ -63,16 +62,23 @@ echo "  "; $mailboxURL = urlencode($mailbox); + selectMailbox($imapConnection, $mailbox, $numNessages); + $unseen = unseenMessages($imapConnection, $numUnseen); + if ($unseen) + echo ""; echo ""; echo readShortMailboxName($mailbox, "."); if (($move_to_trash == true) && ($mailbox == $trash_folder)) { $urlMailbox = urlencode($mailbox); - selectMailbox($imapConnection, $mailbox, $numNessages); echo "    (empty)"; } - echo "
\n"; + echo "
\n"; + if ($numUnseen > 0) { + echo " 
($numUnseen)"; + } + echo "
\n"; } - echo "
"; + echo ""; fclose($imapConnection);