\n"; $str .= "function addcontent(text) {\n"; $str .= " document.post_form.message.value += text;\n"; $str .= " document.post_form.message.focus();\n"; $str .= "}\n"; $str .= "\n"; $title = "En titel"; $message = "Something useful"; if($fid && $tid && $pid) { include_once("posts.php"); $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml"); if($pid != -1) $post = $posts->getPost($pid); if($post || $pid == -1) { $title = ""; $message = ""; switch($task) { case "new": $title = "Title"; $message = "Message"; break; case "reply": if(substr($post->title, 0, 4) != "Re: ") $title = "Re: " . $post->title; else $title = $post->title; $message = ""; break; case "edit": $title = $post->title; $message = $post->message; break; case "quote": if(substr($post->title, 0, 4) != "Re: ") $title = "Re: " . $post->title; else $title = $post->title; $user = $users->getUser($post->user); $message = "[quote title=" . $user->name . " wrote on " . date("r", $post->date) ."]" . $post->message . "[/quote]"; break; default: $str .= error("No mode supplied!"); return $str; break; } $str .= "
\n"; if($pid != -1) $str .= $posts->show(); } else { $str .= error("Message " . $pid . " not found!"); } } else { $str .= error("No message supplied!"); } return $str; } ?>