redirect('admin/emails_main.php'); } } if ($proceed) { $email = orsee_db_load_array("emails", $message_id, "message_id"); if (!isset($email['message_id'])) { redirect('admin/emails_main.php'); } } if ($proceed) { if (!$email['has_attachments']) { redirect('admin/emails_view.php?message_id=' . urlencode($message_id)); } } if ($proceed) { $attachments = email__dbstring_to_attachment_array($email['attachment_data'], false); if (!isset($attachments[$k])) { redirect('admin/emails_view.php?message_id=' . urlencode($message_id)); } } if ($proceed) { // mime type $mime_type = $attachments[$k]['mimetype']; if (!$mime_type || $mime_type == 'application/x-download') { $mime_type = downloads__mime_type(pathinfo($attachments[$k]['filename'], PATHINFO_EXTENSION)); } if (!$mime_type) { $mime_type = "text/*"; } $filename = str_replace(" ", "_", $attachments[$k]['filename']); ob_end_clean();
function email__show_attachments($email) { // attachments if ($email['has_attachments']) { echo '<TR><TD colspan="3" ><TABLE width="100%" CELLPADDING="0" CELLSPACING="0">'; echo '<TR><TD>' . lang('attachments') . ':</TD></TR>'; $attachments = email__dbstring_to_attachment_array($email['attachment_data'], false); echo '<TR><TD>'; foreach ($attachments as $k => $attachment) { echo '<A HREF="emails_download_attachment.php?message_id=' . urlencode($email['message_id']) . '&k=' . urlencode($k) . '">' . $attachment['filename'] . '</A> '; } echo '</TD></TR></TABLE></TD></TR>'; } }