From 8442ac0819d9e82e8c8bd8ac67f8cabedef9ca3f Mon Sep 17 00:00:00 2001 From: lkehresman Date: Mon, 31 Jul 2000 14:24:37 +0000 Subject: [PATCH] - fixed bug when deleting last message, sends you to previous list - fixed bug about translate_text missing an argument - added functionality in conf.pl to detect themes - fixed a number of ; + $nm =~ s/[\n|\r]//g; + $theme_name[$#theme_name+1] = $nm; + $theme_path[$#theme_path+1] = $filename; + } + $cnt++; + } + print "\n"; + for ($cnt=0; $cnt <= $#theme_path; $cnt++) { + $filename = $theme_path[$cnt]; + if (! (-e $filename)) { + print " Removing $filename (file not found)\n"; + $offset = 0; + @new_theme_name = (); + @new_theme_path = (); + for ($x=0; $x < $#theme_path; $x++) { + if ($theme_path[$x] eq $filename) { + $offset = 1; + } + if ($offset == 1) { + $new_theme_name[$x] = $theme_name[$x+1]; + $new_theme_path[$x] = $theme_path[$x+1]; + } else { + $new_theme_name[$x] = $theme_name[$x]; + $new_theme_path[$x] = $theme_path[$x]; + } + } + @theme_name = @new_theme_name; + @theme_path = @new_theme_path; + } + } + print "\nDetection complete!\n\n"; + + closedir DIR; } elsif ($input =~ /^\s*\?\s*/) { print ".-------------------------.\n"; + print "| t (detect themes) |\n"; print "| + (add theme) |\n"; print "| - N (remove theme) |\n"; print "| m N (mark default) |\n"; diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index e3025453..ac5ba8e4 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -170,22 +170,26 @@ global $folder_prefix, $sent_folder; global $imapServerAddress; - // do a check to see if the config stuff has already been included or not -// if (!isset($imapServerAddress)) -// include("../config/config.php"); - // if cache isn't already set, do it now if (!session_is_registered("msgs")) session_register("msgs"); if (!session_is_registered("msort")) session_register("msort"); + if ($startMessage + ($show_num - 1) < $numMessages) { $endMessage = $startMessage + ($show_num-1); } else { $endMessage = $numMessages; } + + if ($endMessage < $startMessage) { + $startMessage = $startMessage - $show_num; + if ($startMessage < 1) + $startMessage = 1; + } + $nextGroup = $startMessage + $show_num; $prevGroup = $startMessage - $show_num; $urlMailbox = urlencode($mailbox); diff --git a/functions/strings.php b/functions/strings.php index 05e155fb..7906d138 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -114,44 +114,39 @@ } function translateText($body, $wrap_at, $charset) { - include ("../functions/url_parser.php"); - /** Add any parsing you want to in here */ + if (!isset($url_parser_php)) { + include "../functions/url_parser.php"; + } + $body_ary = explode("\n", $body); - - for ($i = 0; $i < count($body_ary); $i++) { + for ($i=0; $i < count($body_ary); $i++) { $line = $body_ary[$i]; - $line = "^^$line"; - - //$line = str_replace(">", ">", $line); - //$line = str_replace("<", "<", $line); - //$line = htmlspecialchars($line); - - if (strlen($line) >= $wrap_at) // -2 because of the ^^ at the beginning - $line = wordWrap($line, $wrap_at); - $line = charset_decode($charset, $line); - + $line = str_replace(" ", " ", $line); $line = str_replace("\t", "        ", $line); $line = nl2br($line); + $line = parseEmail ($line); + $line = parseUrl ($line); + + $line = "^^$line"; // gotta do this because if not, strpos() returns 0 + // which in PHP is the same as false. Now it returns 2 if (strpos(trim(str_replace(" ", "", $line)), ">>") == 2) { - $line = substr($line, 2, strlen($line)); - $line = "$line
\n"; + $line = substr($line, 2); + $line = "$line\n"; } else if (strpos(trim(str_replace(" ", "", $line)), ">") == 2) { - $line = substr($line, 2, strlen($line)); - $line = "$line
\n"; + $line = substr($line, 2); + $line = "$line\n"; } else { - $line = substr($line, 2, strlen($line)); - $line = "$line
\n"; - } - - $line = parseEmail ($line); - $line = parseUrl ($line); - $new_body[$i] = "$line"; + $line = substr($line, 2); + } + + $body_ary[$i] = "$line
"; } - $bdy = implode("\n", $new_body); - return $bdy; + $body = implode("\n", $body_ary); + + return $body; } /* SquirrelMail version number -- DO NOT CHANGE */ diff --git a/src/compose.php b/src/compose.php index 9c8acbaa..1fc27a8d 100644 --- a/src/compose.php +++ b/src/compose.php @@ -152,7 +152,8 @@ echo "// -->\n\n"; } - echo "\n
\n"; + //echo "\n\n"; + echo "\n\n"; if ($reply_id) { echo "\n"; } diff --git a/src/download.php b/src/download.php index ef6df67e..bb7adb36 100644 --- a/src/download.php +++ b/src/download.php @@ -25,7 +25,7 @@ include("../src/load_prefs.php"); function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) { - global $where, $what; + global $where, $what, $charset; displayPageHeader($color, "None"); echo "
"; @@ -46,7 +46,7 @@ if ($type1 == "html") echo $body; else - echo translateText($body, $wrap_at); + echo translateText($body, $wrap_at, $charset); echo "
"; } @@ -67,6 +67,7 @@ $header = $message->header; $body = mime_fetch_body($imapConnection, $passed_id, $passed_ent_id); + $charset = $header->charset; $type0 = $header->type0; $type1 = $header->type1; $filename = decodeHeader($header->filename); diff --git a/src/help.php b/src/help.php index e8c4b43c..3b1e6232 100644 --- a/src/help.php +++ b/src/help.php @@ -87,8 +87,8 @@
-
-
+
+
@@ -184,6 +184,6 @@ } } ?> -  +  diff --git a/src/options.php b/src/options.php index 1f7d38b3..769a48c2 100644 --- a/src/options.php +++ b/src/options.php @@ -152,7 +152,7 @@ - diff --git a/src/options_display.php b/src/options_display.php index 43333dcf..5dabd931 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -40,7 +40,7 @@ : -\n"; reset ($languages); while (list($code, $name)=each($languages)) { @@ -85,7 +85,7 @@ : -
"; else @@ -96,7 +96,7 @@ : -
"; else @@ -107,7 +107,7 @@ : -= 10 && $editor_size <= 255) echo "
"; else @@ -118,7 +118,7 @@ : -\n"; if ($left_size == 100) echo "