瀏覽代碼

where/what support

stekkel 23 年之前
父節點
當前提交
d74844d073
共有 3 個文件被更改,包括 18 次插入15 次删除
  1. 9 5
      functions/mailbox_display.php
  2. 4 5
      src/read_body.php
  3. 5 5
      src/search.php

+ 9 - 5
functions/mailbox_display.php

@@ -15,13 +15,13 @@
 require_once('../functions/strings.php');
 require_once('../functions/html.php');
 require_once('../class/html.class.php');
-require_once('../functions/imap_utf7_decode_local.php');
+require_once('../functions/imap_mailbox.php');
 
 /* Default value for page_selector_max. */
 define('PG_SEL_MAX', 10);
 
 function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, 
-                          $start_msg) {
+                          $start_msg, $where, $what) {
     global $checkall,
            $color, $msgs, $msort,
            $default_use_priority,
@@ -109,6 +109,11 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox,
         $fontstr_end = '';
     }
 
+    if ($where && $what) {
+        $searchstr = '&where='.$where.'&what='.$what;
+    } else {
+        $searchstr = '';
+    }	
     /**
     * AAAAH! Make my eyes stop bleeding!
     * Who wrote this?!
@@ -178,8 +183,7 @@ function printMessageInfo($imapConnection, $t, $i, $key, $mailbox,
                 }
                 $td_str .= '<a href="read_body.php?mailbox='.$urlMailbox
 		             .'&amp;passed_id='. $msg["ID"]
-                             . '&amp;startMessage='.$start_msg
-			     .'&amp;show_more=0"';
+                             . '&amp;startMessage='.$start_msg.$searchstr.'"';
                 do_hook("subject_link");
                 if ($subject != $msg['SUBJECT']) {
                     $title = get_html_translation_table(HTML_SPECIALCHARS);
@@ -628,7 +632,7 @@ function displayMessageArray($imapConnection, $num_msgs, $start_msg,
     } while (isset ($key) && ($k < $i));
     do {
       printMessageInfo($imapConnection, $t, $i, $key, $mailbox, 
-		       $real_startMessage);
+		       $real_startMessage, $where, $what);
       $key = key($msort);
       $t++;
       $i++;

+ 4 - 5
src/read_body.php

@@ -389,16 +389,15 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp
 
    $msgs_url = $base_uri . 'src/';
    if (isset($where) && isset($what)) {
-      if ($pos == '') {
-          $pos=0;
-      }
-      $msgs_url .= 'search.php?where='.urlencode($where).'&amp;pos='.$pos.
+      $msgs_url .= 'search.php?where='.urlencode($where).
                    '&amp;what='.urlencode($what).'&amp;mailbox='.$urlMailbox;
+      $msgs_str = _("Search results");		   
    } else {
       $msgs_url .= 'right_main.php?sort='.$sort.'&amp;startMessage='.
                   $startMessage.'&amp;mailbox='.$urlMailbox;
+      $msgs_str = _("Message List");
    }
-   $s .= '<a href="'. $msgs_url.'">'._("Message List").'</a>';
+   $s .= '<a href="'. $msgs_url.'">'.$msgs_str.'</a>';
    $s .= $topbar_delimiter;
    
    $delete_url = $base_uri . 'src/delete_message.php?mailbox='.$urlMailbox.

+ 5 - 5
src/search.php

@@ -12,7 +12,7 @@
 require_once('../src/validate.php');
 require_once('../functions/imap.php');
 require_once('../functions/imap_search.php');
-require_once('../functions/imap_utf7_decode_local.php');
+require_once('../functions/imap_mailbox.php');
 require_once('../functions/array.php');
 require_once('../functions/strings.php');
 
@@ -159,7 +159,7 @@ function save_recent($save_index, $username, $data_dir) {
     }
 }
 
-function printSearchMessages($msgs,$mailbox, $cnt, $imapConnection, $usecache = false, $newsort = false) {
+function printSearchMessages($msgs,$mailbox, $cnt, $imapConnection, $where, $what, $usecache = false, $newsort = false) {
     global $sort, $color;
     
     $msort = calc_msort($msgs, $sort);
@@ -181,7 +181,7 @@ function printSearchMessages($msgs,$mailbox, $cnt, $imapConnection, $usecache =
        printHeader($mailbox, 6, $color, false);
 
        displayMessageArray($imapConnection, $cnt, 1, 
-		          $msort, $mailbox, $sort, $color, $cnt);
+		          $msort, $mailbox, $sort, $color, $cnt, $where, $what);
 
        mail_message_listing_end($cnt, '', $msg_cnt_str, $color); 
     }
@@ -448,7 +448,7 @@ if ($search_all == 'all') {
             $msgs = sqimap_search($imapConnection, $where, $what, $mailbox, $color, 0, $search_all, $count_all);
 	    $count_all = count($msgs);
             printSearchMessages($msgs, $mailbox, $count_all, $imapConnection, 
-	                        false, false);
+	                        $where, $what, false, false);
             array_push($perbox_count, $count_all);
         }
     }
@@ -472,7 +472,7 @@ else {
         $msgs = sqimap_search($imapConnection, $where, $what, $mailbox, $color, 0, $search_all, $count_all);
 	if (count($msgs)) {
            printSearchMessages($msgs, $mailbox, count($msgs), $imapConnection,
-	                       false, false);
+	                       $where, $what, false, false);
 	} else {
            echo '<br><center>' . _("No Messages Found") . '</center>';
 	}