$forum = isset($_GET['forum']) ? intval($_GET['forum']) : (isset($forum) ? intval($forum) : 0); $forum = $forum_handler->get($forum); } foreach (array('start', 'topic_id', 'post_id', 'pid', 'isreply', 'isedit', 'contents_preview') as $getint) { ${$getint} = isset($_GET[$getint]) ? intval($_GET[$getint]) : (!empty(${$getint}) ? ${$getint} : 0); } foreach (array('order', 'viewmode', 'hidden', 'newbb_form', 'icon', 'op') as $getstr) { ${$getstr} = isset($_GET[$getstr]) ? $_GET[$getstr] : (!empty(${$getstr}) ? ${$getstr} : ''); } $topic_handler =& xoops_getmodulehandler('topic', 'newbb'); $topic_status = $topic_handler->get(@$topic_id, 'topic_status'); $forum_form_action = empty($admin_form_action) ? "post.php" : $admin_form_action; // admin/index.php also uses this form $forum_form = new XoopsThemeForm('', 'forumform', $forum_form_action, 'post', true); $forum_form->setExtra('enctype="multipart/form-data"'); if (newbb_checkSubjectPrefixPermission($forum)) { if ($forum->getVar('allow_subject_prefix')) { $subject_add = new XoopsFormElementTray(_MD_TOPIC_SUBJECTC, ''); $subjectpres = explode(',', $xoopsModuleConfig['subject_prefix']); $subjectpres = array_map('trim', $subjectpres); if (count($subjectpres) > 1) { foreach ($subjectpres as $subjectpre) { $subject_array[] = trim($subjectpre); } $subject_select = new XoopsFormSelect('', 'subject_pre', $subject_pre); $subject_select->addOptionArray($subject_array); $subject_add->addElement(new XoopsFormLabel($subject_select->render())); } $forum_form->addElement($subject_add); } }
} } } else { $error_upload = $uploader->getErrors(); } } $postid = $post_handler->insert($forumpost); if (!$postid) { include_once XOOPS_ROOT_PATH . '/header.php'; xoops_error('Could not insert forum post'); include_once XOOPS_ROOT_PATH . '/footer.php'; exit; } newbb_setsession("LP", time()); // Recording last post time if (newbb_checkSubjectPrefixPermission($forum) && !empty($_POST['subject_pre'])) { $subject_pre = intval($_POST['subject_pre']); $sbj_res = $post_handler->insertnewsubject($forumpost->getVar('topic_id'), $subject_pre); } // RMV-NOTIFY // Define tags for notification message if ($approved && !empty($xoopsModuleConfig['notification_enabled']) && !empty($isnew)) { $tags = array(); $tags['THREAD_NAME'] = $_POST['subject']; $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/viewtopic.php?post_id=' . $postid . '&topic_id=' . $forumpost->getVar('topic_id') . '&forum=' . $forumpost->getVar('forum_id'); $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $postid; include_once 'include/notification.inc.php'; $forum_info = newbb_notify_iteminfo('forum', $forum->getVar('forum_id')); $tags['FORUM_NAME'] = $forum_info['name']; $tags['FORUM_URL'] = $forum_info['url']; $notification_handler =& xoops_gethandler('notification');