From: lkehresman Date: Mon, 31 Jul 2000 15:34:21 +0000 (+0000) Subject: made it so searched results are bold X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=508c06bf020df744a978fc85b6222bfa24f95d54 made it so searched results are bold git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@660 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_messages.php b/functions/imap_messages.php index e3e23b2b..fe7e7cbc 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -45,6 +45,8 @@ } 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); @@ -76,6 +78,10 @@ } } + if ($where == "SUBJECT") { + $subject = eregi_replace($what, "\\0", $subject); + } + $header = new small_header; if ($sent == true) $header->from = $to; @@ -154,6 +160,8 @@ ** 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 @@ -272,6 +280,10 @@ $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, "\\0", $hdr->subject); + } $i++; } /** CC **/ @@ -328,20 +340,6 @@ ******************************************************************************/ 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); } diff --git a/src/read_body.php b/src/read_body.php index 573869a1..dc3c308a 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -320,6 +320,10 @@ $body = formatBody($imapConnection, $message, $color, $wrap_at); echo "
"; + $whatnew = str_replace(" ", " ", $what); + if ($where == "BODY" || $where == "TEXT") { + $body = eregi_replace($whatnew, "\\0", $body); + } echo "$body"; echo " \n";