Modifications to respect way back to search from reading.
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 4 Jan 2002 14:10:03 +0000 (14:10 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 4 Jan 2002 14:10:03 +0000 (14:10 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2092 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php
functions/imap_search.php
functions/mailbox_display.php
src/search.php

index dbb59f4..64ff78d 100755 (executable)
@@ -448,12 +448,17 @@ function sqimap_messages_copy ($imap_stream, $start, $end, $mailbox) {
          /** SUBJECT **/
          else if (strtolower(substr($read[$i], 0, 8)) == "subject:") {
             $hdr->subject = trim(substr($read[$i], 8, strlen($read[$i]) - 9));
-            if (strlen(Chop($hdr->subject)) == 0)
+            if (strlen(Chop($hdr->subject)) == 0) {
                $hdr->subject = _("(no subject)");
-
-            if ($where == "SUBJECT") {
-               $hdr->subject = eregi_replace($what, "<b>\\0</b>", $hdr->subject);
             }
+            
+            /*  
+            if ($where == 'SUBJECT') {
+                $hdr->subject = $what;
+               // $hdr->subject = eregi_replace($what, "<b>\\0</b>", $hdr->subject);
+            }
+            */
+            
             $i++;
          }
          /** CC **/
index 2512eec..25899eb 100644 (file)
@@ -17,9 +17,12 @@ require_once('../functions/array.php');
 require_once('../functions/mailbox_display.php');
 require_once('../functions/mime.php');
 
-function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
+function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color, $search_position = '') {
 
     global $msgs, $message_highlight_list, $squirrelmail_language, $languages, $index_order;
+    global $pos;
+
+    $pos = $search_position;
 
     $urlMailbox = urlencode($mailbox);
     $isid = sqimap_session_id();
@@ -141,10 +144,12 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
 
     if (count($messagelist) > 0) {
         $j=0;
-        if (!isset ($msg)) { $msg = ""; }
+        if (!isset ($msg)) { 
+            $msg = ''; 
+        }
 
         mail_message_listing_beginning( $imapConnection,
-            "move_messages.php?msg=$msg&mailbox=$urlMailbox&where=" . urlencode($search_where) . "&what=".urlencode($search_what),
+            "move_messages.php?msg=$msg&mailbox=$urlMailbox&pos=$pos&where=" . urlencode($search_where) . "&what=".urlencode($search_what),
             $mailbox,
             -1,
             '<b>' . _("Found") . ' ' . count($messagelist) . ' ' . _("messages") . '</b>',
index 6596b86..aaf4071 100644 (file)
@@ -21,6 +21,7 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $start
     global $default_use_priority;
     global $message_highlight_list;
     global $index_order;
+    global $pos;            /* Search postion (if any)  */
 
     $color_string = $color[4];
     if ($GLOBALS['alt_index_colors']) {
index 2c615bc..da284ff 100644 (file)
@@ -123,7 +123,7 @@ $where = "where$pos";
 
 if (isset($$where) && $$where && isset($$what) && $$what) {
     sqimap_mailbox_select($imapConnection, $mailbox);
-    sqimap_search($imapConnection, $$where, $$what, $mailbox, $color);
+    sqimap_search($imapConnection, $$where, $$what, $mailbox, $color, $pos);
 }
 do_hook("search_bottom");
 sqimap_logout ($imapConnection);