$post->parent = $parent->id; $parent = $db->selectObject("bb_post", "id=" . $parent->parent); } $parent = $db->selectObject("bb_post", "id=" . $post->parent); } } else { if (isset($_POST['bb'])) { $bb = $db->selectObject("bb_board", "id=" . $_POST['bb']); } } } if ($bb && $user) { $bbloc = pathos_core_makeLocation($loc->mod, $loc->src, "b" . $bb->id); if ($post == null && pathos_permissions_check("create_thread", $bbloc) || !isset($post->id) && pathos_permissions_check("reply", $bbloc) || (isset($post->id) && pathos_permissions_check("edit_post", $bbloc) || $user->id == $post->poster)) { $post->board_id = $bb->id; $post = bb_post::update($_POST, $post); $post->updated = time(); if (isset($post->id)) { $post->editor = $user->id; $post->editted = time(); $db->updateObject($post, "bb_post"); } else { $post->poster = $user->id; $post->posted = time(); $config = $db->selectObject("bbmodule_config", "location_data='" . serialize($loc) . "'"); if (!isset($config->id)) { $config->email_title_thread = "Exponent Forum : New Thread Posted"; $config->email_title_reply = "Exponent Forum : New Reply Posted"; $config->email_from_thread = "Forum Manager <forum@" . HOSTNAME . ">"; $config->email_from_reply = "Forum Manager <forum@" . HOSTNAME . ">"; $config->email_address_thread = "forum@" . HOSTNAME;
$bb = $db->selectObject("bb_board", "id=" . $_GET['bb']); } else { if (isset($_GET['parent'])) { $parent = $db->selectObject("bb_post", "id=" . $_GET['parent']); if ($parent) { $bb = $db->selectObject("bb_board", "id=" . $parent->board_id); $loc = unserialize($bb->location_data); $post->parent = $parent->id; } } } } if ($bb && $user) { $loc = pathos_core_makeLocation($loc->mod, $loc->src, "b" . $bb->id); if ($post == null && pathos_permissions_check("create_thread", $loc) || !isset($post->id) && pathos_permissions_check("reply", $loc) || isset($post->id) && (pathos_permissions_check("edit_post", $loc) || $post->poster == $user->id)) { $post->board_id = $bb->id; $form = bb_post::form($post); $form->location($loc); $form->meta("action", "save_post"); $template = new template("bbmodule", "_form_editPost", $loc); $template->assign("is_edit", isset($post->id) ? 1 : 0); $template->assign("is_reply", isset($post->parent) ? 1 : 0); if (isset($post->parent) || !isset($post->id)) { $form->registerBefore("submit", "monitor", "Notify me of future replies to this thread", new checkboxcontrol(true, true)); } $template->assign("form_html", $form->toHTML()); $template->output(); } } else { echo SITE_404_HTML; }