made it so searched results are bold
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Jul 2000 15:34:21 +0000 (15:34 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Jul 2000 15:34:21 +0000 (15:34 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@660 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php
src/read_body.php

index e3e23b2b4cdb180e82002aed4e458d8e32a9f2ed..fe7e7cbcfb7975351f8e02cf79ea9cf5ad85ca7e 100755 (executable)
@@ -45,6 +45,8 @@
    }
         
    function sqimap_get_small_header ($imap_stream, $id, $sent) {
    }
         
    function sqimap_get_small_header ($imap_stream, $id, $sent) {
+      global $where, $what;
+
       fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Cc Subject Message-Id X-Priority)]\r\n");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
 
       fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Cc Subject Message-Id X-Priority)]\r\n");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
 
          }
       }
 
          }
       }
 
+      if ($where == "SUBJECT") {
+         $subject = eregi_replace($what, "<b>\\0</b>", $subject);
+      }
+      
       $header = new small_header;
       if ($sent == true)
          $header->from = $to;
       $header = new small_header;
       if ($sent == true)
          $header->from = $to;
     **  Queries the IMAP server and gets all header information.
     ******************************************************************************/
    function sqimap_get_header ($imap_stream, $read) {
     **  Queries the IMAP server and gets all header information.
     ******************************************************************************/
    function sqimap_get_header ($imap_stream, $read) {
+      global $where, $what;
+
       $hdr = new msg_header();
       $i = 0;
       // Set up some defaults
       $hdr = new msg_header();
       $i = 0;
       // Set up some defaults
             $hdr->subject = trim(substr($read[$i], 8, strlen($read[$i]) - 9));
             if (strlen(Chop($hdr->subject)) == 0)
                $hdr->subject = _("(no subject)");
             $hdr->subject = trim(substr($read[$i], 8, strlen($read[$i]) - 9));
             if (strlen(Chop($hdr->subject)) == 0)
                $hdr->subject = _("(no subject)");
+
+            if ($where == "SUBJECT") {
+               $hdr->subject = eregi_replace($what, "<b>\\0</b>", $hdr->subject);
+            }
             $i++;
          }
          /** CC **/
             $i++;
          }
          /** CC **/
     ******************************************************************************/
    function sqimap_get_message_body ($imap_stream, &$header) {
       $id = $header->id;
     ******************************************************************************/
    function sqimap_get_message_body ($imap_stream, &$header) {
       $id = $header->id;
-      //fputs ($imap_stream, "a001 FETCH $id:$id BODY[TEXT]\r\n");
-      //$read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
-       
-      /*
-      $i = 0;
-      $j = 0;
-      while ($i < count($read)-1) {
-         if ( ($i != 0) ) {
-            $body[$j] = $read[$i];
-            $j++;
-         }
-         $i++;
-      }
-      */
       return decodeMime($imap_stream, $body, &$header);
    }
 
       return decodeMime($imap_stream, $body, &$header);
    }
 
index 573869a19d48c2c3711398940f95805097353316..dc3c308af3c261d72ceeb560417b753cf75f1ef4 100644 (file)
    $body = formatBody($imapConnection, $message, $color, $wrap_at);
    echo "<BR>";
 
    $body = formatBody($imapConnection, $message, $color, $wrap_at);
    echo "<BR>";
 
+   $whatnew = str_replace(" ", "&nbsp;", $what);
+   if ($where == "BODY" || $where == "TEXT") {
+      $body = eregi_replace($whatnew, "<b><font color=\"$color[2]\">\\0</font></b>", $body);
+   }
    echo "$body";
 
    echo "   </TD></TR>\n";
    echo "$body";
 
    echo "   </TD></TR>\n";