} else { $mail_path = ".DIR"; //default is .DIR $mail_title = "收件箱"; } if (isset($_GET["start"])) { $start = $_GET["start"]; } else { $start = 999999; } //default*/ if (strstr($mail_path, '..')) { html_error_quit("读取邮件数据失败!"); } $mail_fullpath = bbs_setmailfile($currentuser["userid"], $mail_path); $mail_num = bbs_getmailnum2($mail_fullpath); if ($mail_num < 0 || $mail_num > 30000) { html_error_quit("Too many mails!"); } $num = 19; if ($start > $mail_num - 19) { $start = $mail_num - 19; } if ($start < 0) { $start = 0; if ($num > $mail_num) { $num = $mail_num; } } $maildata = bbs_getmails($mail_fullpath, $start, $num); if ($maildata == FALSE) {
if (isset($_GET["dir"])) { $dirname = $_GET["dir"]; } else { $dirname = ".DIR"; } if (isset($_GET["title"])) { $title = $_GET["title"]; } else { $title = "收件箱"; } $title_encode = rawurlencode($title); if (strstr($dirname, "..") || strstr($dirname, "/")) { html_error_quit("错误的参数"); } $dir = bbs_setmailfile($currentuser["userid"], $dirname); $total = bbs_getmailnum2($dir); if ($total <= 0 || $total > 30000) { html_error_quit("读取邮件数据失败!"); } if ($num < 0 || $num >= $total) { html_error_quit("错误的参数"); } $articles = array(); if (bbs_get_records_from_num($dir, $num, $articles)) { $file = $articles[0]["FILENAME"]; } else { html_error_quit("错误的参数"); } $filename = bbs_setmailfile($currentuser["userid"], $file); if (!file_exists($filename)) { html_error_quit("信件不存在...");
} } //system mailboxs $mail_box = array(".DIR", ".SENT", ".DELETED"); $mail_boxtitle = array("收件箱", "发件箱", "垃圾箱"); $mail_boxnums = array(bbs_getmailnum2(bbs_setmailfile($currentuser["userid"], ".DIR")), bbs_getmailnum2(bbs_setmailfile($currentuser["userid"], ".SENT")), bbs_getmailnum2(bbs_setmailfile($currentuser["userid"], ".DELETED"))); //custom mailboxs $mail_cusbox = bbs_loadmaillist($currentuser["userid"]); $totle_mails = $mail_boxnums[0] + $mail_boxnums[1] + $mail_boxnums[2]; $i = 2; if ($mail_cusbox != -1) { foreach ($mail_cusbox as $mailbox) { $i++; $mail_box[$i] = $mailbox["pathname"]; $mail_boxtitle[$i] = $mailbox["boxname"]; $mail_boxnums[$i] = bbs_getmailnum2(bbs_setmailfile($currentuser["userid"], $mailbox["pathname"])); $totle_mails += $mail_boxnums[$i]; } } $mailboxnum = $i + 1; $mail_used_space = bbs_getmailusedspace(); bbs_getmailnum($currentuser["userid"], $total, $unread, 0, 0); ?> <table class="main wide adj"> <col class="center"/><col class="center"/><col class="center"/><col class="center"/> <caption>您的邮箱中共有 <?php echo $totle_mails; ?> 封邮件,占用空间 <?php echo $mail_used_space; ?>
function atomic_mailread() { global $currentuser; atomic_mail_header(); $mail_fullpath = bbs_setmailfile($currentuser["userid"], ".DIR"); $mail_num = bbs_getmailnum2($mail_fullpath); if ($mail_num <= 0 || $mail_num > 30000) { atomic_error("读取邮件数据失败!"); } if (isset($_GET["num"])) { $num = @intval($_GET["num"]); } else { atomic_error("错误的参数"); } if ($num <= 0 || $num > $mail_num) { atomic_error("错误的参数"); } $articles = array(); if (bbs_get_records_from_num($mail_fullpath, $num - 1, $articles)) { $filename = bbs_setmailfile($currentuser["userid"], $articles[0]["FILENAME"]); } else { atomic_error("错误的参数"); } $html = "<p>"; $html .= '<a href="?act=mailpost">写信</a> <a href="?act=mailpost&num=' . $num . '">回信</a> '; if ($num > 1) { $html .= '<a href="?act=mailread&num=' . ($num - 1) . '">上一篇</a> '; } $html .= '<a href="?act=mail&start=' . $num . '">收件箱</a> '; if ($num < $mail_num) { $html .= '<a href="?act=mailread&num=' . ($num + 1) . '">下一篇</a> '; } $html .= "</p>"; echo $html; echo bbs2_readfile_text($filename, 0, 2); bbs_setmailreaded($mail_fullpath, $num - 1); atomic_footer(); }
public function getMailNum() { return bbs_getmailnum2($this->getFullPath()); }