add_breadcrumb(array("link" => FORUM . "newthread.php?forum_id=0", "title" => $locale['forum_0057'])); $thread_data = array('forum_id' => isset($_POST['forum_id']) ? form_sanitizer($_POST['forum_id'], 0, "forum_id") : 0, 'thread_id' => 0, 'thread_subject' => isset($_POST['thread_subject']) ? form_sanitizer($_POST['thread_subject'], '', 'thread_subject') : '', 'thread_author' => $userdata['user_id'], 'thread_views' => 0, 'thread_lastpost' => time(), 'thread_lastpostid' => 0, 'thread_lastuser' => $userdata['user_id'], 'thread_postcount' => 1, 'thread_poll' => 0, 'thread_sticky' => isset($_POST['thread_sticky']) ? TRUE : FALSE, 'thread_locked' => isset($_POST['thread_sticky']) ? TRUE : FALSE, 'thread_hidden' => 0); $post_data = array('forum_id' => isset($_POST['forum_id']) ? form_sanitizer($_POST['forum_id'], 0, "forum_id") : 0, "forum_cat" => 0, 'thread_id' => 0, 'post_id' => 0, 'post_message' => isset($_POST['post_message']) ? form_sanitizer($_POST['post_message'], '', 'post_message') : '', 'post_showsig' => isset($_POST['post_showsig']) ? TRUE : FALSE, 'post_smileys' => !isset($_POST['post_smileys']) || isset($_POST['post_message']) && preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $_POST['post_message']) ? FALSE : TRUE, 'post_author' => $userdata['user_id'], 'post_datestamp' => time(), 'post_ip' => USER_IP, 'post_ip_type' => USER_IP_TYPE, 'post_edituser' => 0, 'post_edittime' => 0, 'post_editreason' => '', 'post_hidden' => 0, 'notify_me' => isset($_POST['notify_me']) ? TRUE : FALSE, 'post_locked' => 0); // go for a new thread posting. // check data // and validate // do not run attach, and do not run poll. if (isset($_POST['post_newthread']) && $defender->safe()) { require_once INCLUDES . "flood_include.php"; // all data is sanitized here. if (!flood_control("post_datestamp", DB_FORUM_POSTS, "post_author='" . $userdata['user_id'] . "'")) { // have notice // get the forum data. // run permissions for posting // if (PHPFusion\Forums\Functions::verify_forum($thread_data['forum_id'])) { $forum = new PHPFusion\Forums\Forum(); $forum_data = dbarray(dbquery("SELECT f.*, f2.forum_name AS forum_cat_name\n\t\t\t\t\tFROM " . DB_FORUMS . " f\n\t\t\t\t\tLEFT JOIN " . DB_FORUMS . " f2 ON f.forum_cat=f2.forum_id\n\t\t\t\t\tWHERE f.forum_id='" . intval($thread_data['forum_id']) . "'\n\t\t\t\t\tAND " . groupaccess('f.forum_access') . "\n\t\t\t\t\t")); if ($forum_data['forum_type'] == 1) { redirect(INFUSIONS . "forum/index.php"); } define_forum_mods($forum_data); // Use the new permission settings $forum->setForumPermission($forum_data); $permission = $forum->getForumPermission(); $forum_data['lock_edit'] = $forum_settings['forum_edit_lock'] == 1 ? TRUE : FALSE; if ($permission['can_post'] && $permission['can_access']) { $post_data['forum_cat'] = $forum_data['forum_cat']; // create a new thread. dbquery_insert(DB_FORUM_THREADS, $thread_data, 'save', array('primary_key' => 'thread_id', 'keep_session' => TRUE)); $post_data['thread_id'] = dblastid();
function display_image_attach($file, $width = 50, $height = 50, $rel = "") { return PHPFusion\Forums\Functions::display_image_attach($file, $width, $height, $rel); }
function get_forum($forum_id = 0, $forum_branch = 0) { return PHPFusion\Forums\Functions::get_forum($forum_id = 0, $forum_branch = 0); }