removed making search results highlighted -- messed up other parsing badly
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Jul 2000 16:16:57 +0000 (16:16 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 31 Jul 2000 16:16:57 +0000 (16:16 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@661 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php
functions/mime.php
functions/strings.php
functions/url_parser.php
src/read_body.php

index fe7e7cbcfb7975351f8e02cf79ea9cf5ad85ca7e..4aecad1b3b7359e2c57f34bca8af9973653998e9 100755 (executable)
@@ -45,7 +45,6 @@
    }
         
    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);
          }
       }
 
-      if ($where == "SUBJECT") {
-         $subject = eregi_replace($what, "<b>\\0</b>", $subject);
-      }
-      
       $header = new small_header;
       if ($sent == true)
          $header->from = $to;
index 2e559fbb63bbbc3166659988eaaad2e2b034899d..e864b7b7a8476f2d00d2eec39e34fa0241209cb5 100644 (file)
          $body .= "</TD></TR><TR><TD BGCOLOR=\"$color[0]\">";
          $num = 0;
 
-         /** make this recurisve at some point **/
          $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
          $body .= "</TD></TR></TABLE>";
       }
index 7906d1385ad4c2186ece26a70649d993a1e81105..c3f2e4c0ad6f18857482efb404a88d8e6b502ba1 100644 (file)
    }
 
    function translateText($body, $wrap_at, $charset) {
+      global $where, $what; // from searching
+
       if (!isset($url_parser_php)) {
          include "../functions/url_parser.php";
       }
index cc0accca1f8d0769d2fa6e2f5a95697e1d661004..64e308a5dbc8fa33f288081d6bcf430b9b152f3c 100644 (file)
    }
 
    function parseEmail ($body) {
+      global $color;
+      /*
+        This is here in case we ever decide to use highlighting of searched
+        text.  this does it for email addresses
+        
+      if ($what && ($where == "BODY" || $where == "TEXT")) {
+         eregi ("([a-z]|[0-9]|_|\.|-)+\@([a-z]|[0-9]|_|-)+(\.([a-z]|[0-9]|_|-)+)*", $body, $regs);
+         $oldaddr = $regs[0];
+         if ($oldaddr) {
+            $newaddr = eregi_replace ($what, "<b><font color=\"$color[2]\">$what</font></font></b>", $oldaddr);
+            $body = str_replace ($oldaddr, "<a href=\"../src/compose.php?send_to=$oldaddr\">$newaddr</a>", $body); 
+         }
+      } else { 
+         $body = eregi_replace ("([a-z]|[0-9]|_|\.|-)+\@([a-z]|[0-9]|_|-)+(\.([a-z]|[0-9]|_|-)+)*", "<a href=\"../src/compose.php?send_to=\\0\">\\0</a>", $body);
+      }
+      */
       $body = eregi_replace ("([a-z]|[0-9]|_|\.|-)+\@([a-z]|[0-9]|_|-)+(\.([a-z]|[0-9]|_|-)+)*", "<a href=\"../src/compose.php?send_to=\\0\">\\0</a>", $body);
       return $body;
    }
index dc3c308af3c261d72ceeb560417b753cf75f1ef4..bd9fa35a8c7545215b3465984ba9a25f4138ded5 100644 (file)
    echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=97% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
 
    echo "   <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n";
-   $body = formatBody($imapConnection, $message, $color, $wrap_at);
    echo "<BR>";
+   
+   $body = formatBody($imapConnection, $message, $color, $wrap_at);
 
-   $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";