diff --git a/html/inc/forum.inc b/html/inc/forum.inc index 8170d14afd..93a67074c0 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -7,6 +7,7 @@ require_once('../inc/time.inc'); require_once('../inc/forum_moderators.inc'); require_once('../inc/text_transform.inc'); require_once('../inc/util.inc'); +require_once('../inc/forum_pm.inc'); define('AVATAR_WIDTH', 100); define('AVATAR_HEIGHT',100); diff --git a/html/inc/forum_pm.inc b/html/inc/forum_pm.inc new file mode 100644 index 0000000000..8ac88d1283 --- /dev/null +++ b/html/inc/forum_pm.inc @@ -0,0 +1,88 @@ +\n"; + echo " Inbox\n"; + echo " | Write\n"; + echo " | Forum index\n"; + echo "\n"; +} + +function pm_create_new($error = null) { + page_head("Private messages : Create new"); + pm_header(); + + global $logged_in_user; + $replyto = get_int("replyto", true); + $userid = get_int("userid", true); + + 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 = post_str("subject", true); + $content = post_str("content", true); + } + + $subject = htmlspecialchars($subject); + + if ($error != null) { + echo "