if (strlen($where) > 0) { $where = $where . ' and '; } $where = $where . " (submit_status.{$field} {$temp}) "; if ($get != 'top' && $get != 'bottom') { if (strlen($get_page) > 0) { $get_page = $get_page . '&'; } $get_page = $get_page . $get . '=' . intval(urlencode(stripslashes($_GET[$get]))); } } } if (strlen($_GET['user_id']) > 0) { if (is_numeric($_GET['user_id'])) { $status_user_id = get_to_mysql($_GET['user_id']); $status_user_name = user_id_to_name($status_user_id); } if (!is_numeric($_GET['user_id']) || strlen($status_user_name) <= 0) { $status_user_name = get_to_mysql($_GET['user_id']); $status_user_id = name_to_user_id($status_user_name); } if (empty($status_user_id)) { redirect('error.php?msg=' . urlencode('No such user')); } $where = " (submit_status.user_id={$status_user_id}) "; $get_page = 'user_id=' . $status_user_id; } status_mysql_condition('pro_id', 'pro_id='); status_mysql_condition('contest_id', 'contest_id='); status_mysql_condition('result', 'result='); status_mysql_condition('language', 'language=');
$from_user_id = $row['from_user_id']; $mail_time = htmlspecialchars($row['mail_time']); $title = htmlspecialchars($row['title']); $content = htmlspecialchars($row['content']); if ($my_user_id != $to_user_id && $my_user_id != $from_user_id) { redirect("error.php?msg=" . urlencode("You cannot read this mail!")); } if ($to_user_id == $my_user_id) { $query = "update mails set readed=1 where mail_id=" . intval($mail_id); oj_query($query); } set_ojinfo('title', 'ECUST Online Judge - Read mail'); include 'include/header.php'; echo "<br><div style='background: #CAF'>"; if ($_GET['sender']) { echo "To: " . htmlspecialchars(user_id_to_name($to_user_id)); } else { echo "From: " . htmlspecialchars($from_user_name = user_id_to_name($from_user_id)); } echo "<br>Title: {$title}<br>"; echo "Time: {$mail_time}<br>"; echo "</div>"; echo "<div style='background: #CCF;padding-bottom: 20px'>"; echo "<hr/><pre class='mail'>{$content}</pre>"; echo "</div>"; echo '<center>'; if (!$_GET['sender']) { echo '[<a href="mailsend.php?name=' . urlencode($from_user_name) . '">Reply</a>]'; } echo '</center>'; include 'include/footer.php';
echo "From"; } else { echo "To"; } ?> </th> <th>Title</th> <th>Date</th> </tr> <?php $rank_i = $rank_top; while ($row = mysql_fetch_row($ret)) { $rank_i++; $mail_id = $row[0]; $user_id = $row[1]; $user_name = user_id_to_name($user_id); $mail_time = $row[2]; $title = htmlspecialchars($row[3]); if ($receive) { $readed = $row[4]; } else { $url_sender = '&sender=1'; } echo "<tr>"; echo "<td>{$rank_i}</td>"; echo '<td><a href="user.php?user_name=' . urlencode($user_name) . '">' . htmlspecialchars($user_name) . '</a></td>'; $not_readed = ''; if ($receive && $readed == 0) { $not_readed = 'style="font-weight:bold"'; } echo '<td ' . $not_readed . '><a href="mailshow.php?mail_id=' . $mail_id . $url_sender . '">' . $title . '</a></td>';