uid, time(), $message); $posts->add($post); $posts->thread->name = $title; $posts->thread->tid = $tid; $posts->thread->lastpost = time(); $posts->write(); $m = "New thread \"" . $title . "\" at " . $FORUM_URL . "/?fid=". $fid . "&tid=" . $tid. "#firstunread\n"; $m .= $message; notify("forum", $m); } 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(); $m = "New reply \"" . $title . "\" at " . $FORUM_URL . "/?fid=". $fid . "&tid=" . $tid. "#firstunread\n"; $m .= $message; notify("forum", $m); } 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(); $m = "Message \"" . $title . "\" has been edited: " . $FORUM_URL . "/?fid=". $fid . "&tid=" . $tid. "#firstunread\n"; $m .= $message; notify("forum", $m); } 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(); $m = "New reply (quote) \"" . $title . "\": " . $FORUM_URL . "/?fid=". $fid . "&tid=" . $tid. "#firstunread\n"; $m .= $message; notify("forum", $m); } else { error("Message " . $pid . " not found!"); } } else { error("No message supplied!"); } break; } echo "

Return to thread.

\n"; ?>