uid, time(), $message); $posts->add($post); $posts->thread->name = $title; $posts->thread->tid = $tid; $posts->thread->lastpost = time(); $posts->write(); notify("forum", "New thread: http://www.executionroom.com/forum/?fid=". $fid . "&tid=" . $tid); } else { error("No forum id supplied!"); } break; case "reply": if($fid && $tid && $pid) { include_once("posts.php"); $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml"); $reply = $posts->getPost($pid); if($reply) { $post = new Post($posts->nextkey(), $title, $current_uid, time(), $message); $reply->add($post); $posts->thread->lastpost = time(); $posts->write(); notify("forum", "New reply: http://www.executionroom.com/forum/?fid=". $fid . "&tid=" . $tid); } else { error("Message " . $pid . " not found!"); } } else { error("No message supplied!"); } break; case "edit": if($fid && $tid && $pid) { include_once("posts.php"); $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml"); $edit = $posts->getPost($pid); if($edit) { if($posts->thread->tid == $edit->pid) $posts->thread->name = $title; $edit->title = $title; $edit->message = $message . "\nEdited at: " . date("r", time()); $posts->thread->lastpost = time(); $posts->write(); notify("forum", "Message has been edited: http://www.executionroom.com/forum/?fid=". $fid . "&tid=" . $tid); } else { error("Message " . $pid . " not found!"); } } else { error("No message supplied!"); } break; case "quote": if($fid && $tid && $pid) { include_once("posts.php"); $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml"); $quote = $posts->getPost($pid); if($quote) { $post = new Post($posts->nextkey(), $title, $current_uid, time(), $message); $quote->add($post); $posts->thread->lastpost = time(); $posts->write(); notify("forum", "New reply (quote): http://www.executionroom.com/forum/?fid=". $fid . "&tid=" . $tid); } else { error("Message " . $pid . " not found!"); } } else { error("No message supplied!"); } break; } echo "

Return to thread.

\n"; ?>