Example #1
0
            } else {
                // Notify of new post
                $notification_handler->triggerEvent('thread', $topic_id, 'new_post', $tags);
            }
            $notification_handler->triggerEvent('global', 0, 'new_post', $tags);
            $notification_handler->triggerEvent('forum', $forum, 'new_post', $tags);
            $myts =& MyTextSanitizer::getInstance();
            $tags['POST_CONTENT'] = $myts->stripSlashesGPC($HTTP_POST_VARS['message']);
            $tags['POST_NAME'] = $myts->stripSlashesGPC($HTTP_POST_VARS['subject']);
            $notification_handler->triggerEvent('global', 0, 'new_fullpost', $tags);
        }
        // If user checked notification box, subscribe them to the
        // appropriate event; if unchecked, then unsubscribe
        if (!empty($xoopsUser) && !empty($xoopsModuleConfig['notification_enabled'])) {
            if (!empty($HTTP_POST_VARS['notify'])) {
                $notification_handler->subscribe('thread', $forumpost->getTopicId(), 'new_post');
            } else {
                $notification_handler->unsubscribe('thread', $forumpost->getTopicId(), 'new_post');
            }
        }
        if ($HTTP_POST_VARS['viewmode'] == "flat") {
            redirect_header("viewtopic.php?topic_id=" . $forumpost->topic() . "&post_id=" . $postid . "&order=" . $order . "&viewmode=flat&pid=" . $pid . "&forum=" . $forum . "#forumpost" . $postid . "", 2, _MD_THANKSSUBMIT);
            exit;
        } else {
            $post_id = $forumpost->postid();
            redirect_header("viewtopic.php?topic_id=" . $forumpost->topic() . "&post_id=" . $postid . "&order=" . $order . "&viewmode=thread&pid=" . $pid . "&forum=" . $forum . "#forumpost" . $postid . "", 2, _MD_THANKSSUBMIT);
            exit;
        }
    }
    include XOOPS_ROOT_PATH . '/footer.php';
}