/** * The custom bbeditor * @param string $name * @param int $rows * @param int $cols * @param string $content * @return string */ function bbeditor($name, $rows = 5, $cols = 50, $content = "") { $b = "<table class='bbedit' cellpadding='0' cellspacing='0'>"; $b .= "<tr><td class='toolbar'>" . bbcode_buttons($name) . "<td></tr>"; $b .= "<tr><td class='editarea'><textarea id = '{$name}' rows = '{$rows}' cols = '{$cols}' name = '{$name}'>{$content}</textarea><td></tr>"; $b .= "<tr><td class='smilies'>" . displaysmileys($name) . "<td></tr>"; $b .= "</table>"; return $b; }
$db->join("left", "{PREFIX}forum_topics", "topic_id", "post_topic"); $db->select("post_id = '" . $db->escape($_GET['post']) . "'"); $db->nextRecord(); if ($db->topic_locked == "1") { throw new Exception("Topic is locked"); } $user = new Acl($db->post_user); $allowed = false; ?> <form method="post"> <input type="hidden" name="secure_input" value="<?php echo $_SESSION['secure_token_last']; ?> "> <?php echo bbcode_buttons("editor"); ?> <br /> <input type="hidden" name="topic_id" value="<?php echo $db->post_topic; ?> " /> <textarea cols="80" id="editor" name="content" rows="15"><?php echo isset($_POST['content']) ? $_POST['content'] : "[quote=" . $user->name . "]" . $db->post_content . "[/quote]"; ?> </textarea><br /> <input type="submit" name="reply" value="<?php echo _t("Quote"); ?> " /> <input type="submit" name="preview" value="<?php echo _t("Preview");