signature; } replyToThread($_GET['thread'], $user->id, $_POST['content'].$forum_signature, $parent_post); notify_subscribers($_GET['thread']); header('Location: thread.php?id='.$_GET['thread']); } $logged_in_user = get_logged_in_user(true, '../'); if (empty($_GET['thread'])) { // TODO: Standard error page. echo "No thread ID specified.
"; exit(); } if (!empty($_GET['post'])) { $post = getPost($_GET['post']); } $thread = getThread($_GET['thread']); $forum = getForum($thread->forum); $category = getCategory($forum->category); $helpdesk = $category->is_helpdesk; // TODO: Write a function for this. if ($helpdesk) { page_head('Questions and problems', $logged_in_user); } else { page_head('Message boards', $logged_in_user); } show_forum_title($forum, $thread, $helpdesk); start_forum_table(array("Author", "Message")); // TODO: Use the same sorting method that the user had in the thread view. show_posts($thread, 'modified-new',-2, false, false, $helpdesk); show_message_row($thread, $category, $post); end_forum_table(); page_tail(); function show_message_row($thread, $category, $post=NULL) { global $logged_in_user; echo "

"; if ($logged_in_user->has_profile) { echo "id, "\">", $logged_in_user->name, ""; } else { echo $logged_in_user->name; } echo " "; if ($post) { echo " to id>Message ID $post->id:"; } else { echo " your answer:"; } if ($category->is_helpdesk) { echo "
Please use this form ONLY to answer or discuss this particular question or problem. "; } echo "

    Add my signature to this reply "; echo "\n"; } function quote_text($text, $cols) { $quoteChar = ">"; $lines = explode("\n", $text); $lineChars = strlen($quoteChar); $final = $quoteChar; for ($i = 0; $i < count($lines); $i++) { $words = explode(" ", $lines[$i]); for ($j = 0; $j < count($words); $j++) { $wordLen = strlen($words[$j]); if (($lineChars + $wordLen) >= $cols) { $final = $final . "\n" . $quoteChar; $lineChars = strlen($quoteChar); } $final = $final . " " . $words[$j]; $lineChars += $wordLen + 1; } $final = $final . "\n" . $quoteChar; $lineChars = strlen($quoteChar); } return $final; } ?>