\n";
echo " ".tra("Inbox")."\n";
echo " | ".tra("Write")."\n";
echo " | ".tra("Forum index")."\n";
echo "\n";
}
function pm_create_new($error = null) {
page_head(tra("Private messages")." : ".tra("Create new"));
pm_header();
if (post_str("preview", true) == tra("Preview")) {
$options = new output_options;
echo "
\n";
echo "\n";
echo output_transform(post_str("content", true), $options);
echo "
\n";
}
global $logged_in_user;
$replyto = get_int("replyto", true);
$userid = get_int("userid", true);
$subject = null;
$content = null;
if ($replyto) {
$message = mysql_query("SELECT * FROM private_messages WHERE userid=".$logged_in_user->id." AND id=$replyto");
if ($message) {
$message = mysql_fetch_object($message);
$content = "[quote]".$message->content."[/quote]\n";
$userid = $message->senderid;
$user = get_user_from_id($userid);
if ($user != null) {
$writeto = $userid." (".$user->name.")";
}
$subject = $message->subject;
if (substr($subject, 0, 3) != "re:") {
$subject = "re: ".$subject;
}
}
} elseif ($userid) {
$user = get_user_from_id($userid);
if ($user != null) {
$writeto = $userid." (".$user->name.")";
}
} else {
$writeto = post_str("to", true);
$subject = stripslashes(post_str("subject", true));
$content = stripslashes(post_str("content", true));
}
$content = htmlspecialchars($content);
$subject = htmlspecialchars($subject);
if ($error != null) {
echo "".$error."
\n";
}
echo "