If a message has attachments, it is shown in the message index by putting
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 12 Oct 2000 14:35:58 +0000 (14:35 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 12 Oct 2000 14:35:58 +0000 (14:35 +0000)
a "+" in the flags area.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@792 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
config/config_default.php
functions/imap_messages.php
functions/mailbox_display.php

index dad842b..418a5f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 Version 0.6pre1 -- DEVELOPMENT
 ------------------------------
+- Attachments are shown in message index (shown as a "+")
 - Updated attachment plugin support and passing values to hooks (see plugins.txt)
 - Added file and message size in many locations
 - Made message index order customizable (from, subject, date) can be (date, from, subject)
index b8bbcb9..116742c 100644 (file)
@@ -9,7 +9,7 @@
 //
 
     // don't change
-    $config_version = "x53";
+    $config_version = "x61";
 
 //  Organization's logo picture (blank if none)
     $org_logo = "../images/sm_logo.jpg";
index c085044..f9da824 100755 (executable)
@@ -46,7 +46,7 @@
         
    function sqimap_get_small_header ($imap_stream, $id, $sent) {
 
-      fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Cc Subject Message-Id X-Priority)]\r\n");
+      fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Cc Subject Message-Id X-Priority Content-Type)]\r\n");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
 
       $subject = _("(no subject)");
             $subject = htmlspecialchars(eregi_replace ("^subject: ", "", $read[$i]));
             if (trim($subject) == "")
                $subject = _("(no subject)");
+         } else if (eregi ("^content-type:", $read[$i])) {
+            $type = substr($read[$i], 14);
+            $type = strtolower(trim($type));
+            if ($pos = strpos($type, ";"))
+               $type = substr($type, 0, $pos);
+            $type = explode("/", $type);
          }
+         
       }
 
       // If there isn't a date, it takes the internal date and uses
       $header->message_id = $messageid;
       $header->cc = $cc;
       $header->size = $size;
+      $header->type0 = $type[0];
+      $header->type1 = $type[1];
 
       return $header;
    }
index 6d29d7c..c06adbe 100644 (file)
                echo "   <td bgcolor=$hlt_color>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0$search_stuff\">$flag$subject$flag_end</a>$bold_end</td>\n";
                break;
             case 5: # flags
-               if ($msg["FLAG_ANSWERED"] == true) echo "   <td bgcolor=$hlt_color width=1%><b><small>A</small></b></td>\n";
-               elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo "   <td bgcolor=$hlt_color width=1%><b><small><font color=$color[1]>!</font></small></b></td>\n";
-               else    echo "   <td bgcolor=$hlt_color width=1%>&nbsp;</td>\n";
+               $stuff = false;
+               echo "   <td bgcolor=$hlt_color width=1%><b><small>\n";
+               if ($msg["FLAG_ANSWERED"] == true) {
+                  echo "A\n";
+                  $stuff = true;
+               } 
+               if ($msg["TYPE0"] == "multipart") {
+                  echo "+\n";
+                  $stuff = true;
+               } 
+               if (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) {
+                  echo "<font color=$color[1]>!</font>\n";
+                  $stuff = true;
+               }
+               if (!$stuff) echo "&nbsp;\n";
+               echo "</small></b></td>\n";
                break;
             case 6: # size   
                echo "   <td bgcolor=$hlt_color width=1%>$bold".show_readable_size($msg['SIZE'])."$bold_end</td>\n";
                $priority[$q] = $hdr->priority;
                $cc[$q] = $hdr->cc;
                $size[$q] = $hdr->size;
+               $type[$q] = $hdr->type0;
 
                $flags[$q] = sqimap_get_flags ($imapConnection, $q+1);
             }
                                $messages[$j]["PRIORITY"] = $priority[$j];
             $messages[$j]["CC"] = $cc[$j];
             $messages[$j]["SIZE"] = $size[$j];
+            $messages[$j]["TYPE0"] = $type[$j];
 
             # fix SUBJECT-SORT to remove Re:
             if (substr($messages[$j]["SUBJECT-SORT"], 0, 3) == "re:" ||