/[drupal]/contributions/modules/mail_archive/mail_archive.module
ViewVC logotype

Diff of /contributions/modules/mail_archive/mail_archive.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.12 by jeremy, Thu Jan 27 03:54:20 2005 UTC revision 1.13 by jeremy, Thu Jan 27 03:57:55 2005 UTC
# Line 1126  function mail_archive_message_delete($li Line 1126  function mail_archive_message_delete($li
1126    return form($output);    return form($output);
1127  }  }
1128    
 function mail_archive_message_delete($lid, $mid) {  
   echo "<pre>\n";  
   $message = db_fetch_object(db_query('SELECT mid, lid, path, attachments FROM {mail_archive_message_index} WHERE lid = %d AND mid = %d', $lid, $mid));  
   
   if (user_access('administer mail archive')) {  
     if ($output = mail_archive_retrieve_message($message->path, $mid .'.0')) {  
       echo htmlspecialchars($output);  
     }  
     else {  
       echo "\n". t('[this message has no headers]') ."\n";  
     }  
   }  
   
   // display body of message  
   if ($output = mail_archive_retrieve_message($message->path, $mid .'.1')) {  
     echo htmlspecialchars($output);  
   }  
   else {  
     echo "\n". t('[this message has no body]') ."\n";  
   }  
   
   if ($message->attachments) {  
     $attachments = mail_archive_get_attachments($mid);  
     for ($i = 0; $i < $message->attachments; $i++) {  
       $part = $i + 2;  
       if ($attachments[$part]->type == 0)  { // text  
         echo "\n\n--Multipart\n";  
         $subtype = $attachments[$part]->subtype;  
         echo t("Content-Type: %type\n", array('%type' => "TEXT/$subtype"));  
         $filename = $attachments[$part]->filename;  
         echo t(" filename=\"%name\"\n\n", array('%name' => "$filename"));  
         if ($output = mail_archive_retrieve_message($message->path, "$mid.". $part)) {  
           echo htmlspecialchars($output);  
         }  
         else {  
           echo "\n". t('[failed to load attachment]') ."\n";  
         }  
       }  
     }  
   }  
   
   // don't return, we simply displayed it to the screen.  
   echo "</pre>\n";  
 }  
   
1129  function mail_archive_get_attachments($mid) {  function mail_archive_get_attachments($mid) {
1130    $result = db_query('SELECT mid, created, filename, bytes, type, subtype, encoding, part FROM {mail_archive_attachments_index WHERE mid = %d', $mid);    $result = db_query('SELECT mid, created, filename, bytes, type, subtype, encoding, part FROM {mail_archive_attachments_index WHERE mid = %d', $mid);
1131    while ($attachment = db_fetch_object($result)) {    while ($attachment = db_fetch_object($result)) {

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.3