$msize = round($msize / 1024, 1) . " MB"; } else { $msize = round($msize, 1) . " kB"; } $datestr = date("d.m.y", strtotime($mail_senddate)); setlocale(LC_TIME, $LANG); if (date("z") - date("z", strtotime($mail_senddate)) < 6) { $datestr = strftime("%a %H:%M", strtotime($mail_senddate)); } if (date("d.m.y") == date("d.m.y", strtotime($mail_senddate))) { $datestr = date("H:i", strtotime($mail_senddate)); } $subj = str_replace("'", "", $subj); $subj = str_replace("\"", "", $subj); # TODO: strip <*****@*****.**>, htmlspecialchars print "<li name=\"msgli\" id=\"msg" . utf8_encode($headrs->msgno) . "\" style=\" " . $delstyle . $seenstr . $colorstr . "\"><div name=\"msglistentry\" style=\"position:absolute;left:8px;top:16px;display:none;z-index:999\" ><a href=\"delmsg.php?acc=" . $accnr . "&folder=" . $imapfolder . "&msgid=" . $headrs->msgno . "\" type = \"delmsg\"><img src=\"./iui/stop.png\" ></a></div><a onClick=\"JavaScript:document.getElementById('msg" . $headrs->msgno . "').style.color='black';document.getElementById('rb').style.display='none';showDelIcons(false);showdelicons=false;\" href=\"details.php?acc=" . $accnr . "&folder=" . $imapfolder . "&msgid=" . $headrs->msgno . "\" style=\"padding-left:25px;padding-right:45px;" . $attpadd . "\">" . imap_utf8_workaround(_decodeHeader($subj)) . "<div align=\"right\" style=\"color:#194fdb;font-size:14px;font-weight:bold;position:absolute;right:10px;top:3px;\">" . $datestr . "</div><div style=\"font-size:11px;position:absolute;right:10px;bottom:3px;\">" . $msize . "</div>\n\t<div style=\"font-weight:normal;font-size:14px;padding-right:25px;\">" . imap_utf8_workaround(_decodeHeader($headrs->subject)) . "</div>\n\t" . $attimg . "\n\t</a></li>\n"; } imap_close($mbox); if ($end - 25 > 0 && !$loadprev) { ?> <li id="nextLoader"><a onclick = "removeOldListentries('<?php echo $MC->Nmsgs; ?> ','<?php echo $end; ?> ','<?php echo $imapfolder; ?> ','<?php echo $offset;
function get_part($stream, $msg_number, $mime_type, $structure = false, $part_number = false) { if (!$structure) { $structure = imap_fetchstructure($stream, $msg_number); } if ($structure) { if ($mime_type == get_mime_type($structure)) { if (!$part_number) { $part_number = "1"; } $text = imap_fetchbody($stream, $msg_number, $part_number); if ($structure->encoding == 3) { return imap_base64($text); } else { if ($structure->encoding == 4) { return quoted_printable_decode($text); } else { if ($structure->encoding == 1) { return imap_utf8_workaround($text); } else { if ($structure->encoding == 0) { return $text; } else { return imap_utf8_workaround($text); } } } } } if ($structure->type == 1) { while (list($index, $sub_structure) = each($structure->parts)) { if ($part_number) { $prefix = $part_number . '.'; } $data = get_part($stream, $msg_number, $mime_type, $sub_structure, $prefix . ($index + 1)); if ($data) { return $data; } } // END OF WHILE } // END OF MULTIPART } // END OF STRUTURE return false; }