From 53828ec5d74eed70e1cfe121cc93dc09508206b7 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Fri, 4 Jan 2002 14:10:03 +0000 Subject: [PATCH] Modifications to respect way back to search from reading. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2092 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 13 +++++++++---- functions/imap_search.php | 11 ++++++++--- functions/mailbox_display.php | 1 + src/search.php | 2 +- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index dbb59f4e..64ff78d7 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -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, "\\0", $hdr->subject); } + + /* + if ($where == 'SUBJECT') { + $hdr->subject = $what; + // $hdr->subject = eregi_replace($what, "\\0", $hdr->subject); + } + */ + $i++; } /** CC **/ diff --git a/functions/imap_search.php b/functions/imap_search.php index 2512eecc..25899ebd 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -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, '' . _("Found") . ' ' . count($messagelist) . ' ' . _("messages") . '', diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 6596b86a..aaf4071c 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -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']) { diff --git a/src/search.php b/src/search.php index 2c615bc8..da284ff2 100644 --- a/src/search.php +++ b/src/search.php @@ -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); -- 2.25.1