$total_attachment_size += $attachment['filesize']; } } } if (is_array($image_attachments_array) && sizeof($image_attachments_array) > 0) { foreach ($image_attachments_array as $key => $attachment) { if ($attachment_link = attachments_make_link($attachment, false)) { echo " <tr>\n"; echo " <td align=\"center\" width=\"1%\">", form_checkbox("delete_other_attachment[{$attachment['hash']}]", "Y"), "</td>\n"; echo " <td align=\"left\" valign=\"top\" style=\"white-space: nowrap\" class=\"postbody\">{$attachment_link}</td>\n"; if (!is_md5($aid) && is_md5($attachment['aid'])) { echo " <td align=\"left\" valign=\"top\" style=\"white-space: nowrap\" class=\"postbody\">"; if ($message_link = attachments_get_message_link($attachment['aid'])) { echo "<a href=\"{$message_link}\" target=\"_blank\">", gettext("View Message"), "</a>"; } else { if ($message_link = attachments_get_pm_link($attachment['aid'])) { echo "<a href=\"{$message_link}\" target=\"_blank\">", gettext("View Message"), "</a>"; } else { echo ' '; } } echo "</td>\n"; } else { echo " <td align=\"left\"> </td>\n"; } echo " <td align=\"right\" valign=\"top\" style=\"white-space: nowrap\" class=\"postbody\">", format_file_size($attachment['filesize']), "</td>\n"; echo " <td align=\"left\" width=\"25\"> </td>\n"; echo " </tr>\n"; $total_attachment_size += $attachment['filesize']; } }
echo " <table class=\"posthead\" width=\"100%\">\n"; if (($attachments_array = attachments_get_all($_SESSION['UID'])) !== false) { echo " <tr>\n"; echo " <td class=\"subhead_checkbox\" align=\"center\" width=\"1%\">", form_checkbox("toggle_main", "toggle_main"), "</td>\n"; echo " <td align=\"left\" colspan=\"4\" class=\"subhead\">", gettext("Attachments"), "</td>\n"; echo " </tr>\n"; foreach ($attachments_array as $key => $attachment) { if (($attachment_link = attachments_make_link($attachment, false, true)) !== false) { echo " <tr>\n"; echo " <td align=\"center\" width=\"1%\">", form_checkbox("attachments_delete[{$attachment['hash']}]", "Y"), "</td>\n"; echo " <td align=\"left\" valign=\"middle\" style=\"white-space: nowrap\" class=\"postbody\">{$attachment_link}</td>\n"; echo " <td align=\"left\" valign=\"middle\" style=\"white-space: nowrap\" class=\"postbody\">"; if (($message_link = attachments_get_message_link($attachment['hash'])) !== false) { echo "<a href=\"{$message_link}\" target=\"_blank\">", gettext("View Message"), "</a>"; } else { if (($message_link = attachments_get_pm_link($attachment['hash'])) !== false) { echo "<a href=\"{$message_link}\" target=\"_blank\">", gettext("View Message"), "</a>"; } else { echo ' '; } } echo "</td>\n"; if (isset($attachment['filesize']) && $attachment['filesize'] > 0) { echo " <td align=\"right\" valign=\"middle\" style=\"white-space: nowrap\" class=\"postbody\">", format_file_size($attachment['filesize']), "</td>\n"; } else { echo " <td align=\"right\" valign=\"middle\" class=\"postbody\">", gettext("Unknown size"), "</td>\n"; } echo " <td align=\"left\" width=\"25\"> </td>\n"; echo " </tr>\n"; } }