Beispiel #1
0
        $new_top = '0';
    } else {
        $new_top = '1';
    }
    $db->query("UPDATE fw_forum_threads SET top='{$new_top}' WHERE id='{$id}'");
    $location = $_SERVER['HTTP_REFERER'];
    header("Location: {$location}");
    die;
}
if (isset($_POST['submit_edit_post'])) {
    $id = $_POST['post_id'];
    $post = $db->get_single("SELECT author FROM fw_forum_posts WHERE id='{$id}'");
    if ($post['author'] != $_SESSION['fw_user']['id']) {
        Common::check_priv("{$priv}");
    }
    $text = strip_forum_tags($_POST['post_text']);
    if (isset($_POST['thread_id'])) {
        $title = $_POST['post_title'];
        if ($_POST['parent'] != $_POST['old_parent']) {
            $parent = $_POST['parent'];
            $forums_list = Common::get_nodes_list($forums_list);
            foreach ($forums_list as $k => $v) {
                if ($v['id'] == $parent) {
                    $forum_url = $v['full_url'];
                }
            }
            $m_url = $db->get_single("SELECT url FROM fw_tree WHERE module='forum' LIMIT 1");
            $smarty->assign("redirect_url", BASE_URL . '/' . $m_url['url'] . '/' . $forum_url . 'thread_' . $_POST['thread_id']);
        } else {
            $parent = $_POST['old_parent'];
        }
Beispiel #2
0
    }
    if ($check) {
        $parent = String::secure_user_input($_POST['thread_id']);
        $get_subscribers = $db->get_all("SELECT * FROM fw_send_forum_answers WHERE thread_id='{$parent}'");
        //Common::dumper($get_subscribers,1);
        if (count($get_subscribers) > 0) {
            $smarty->assign("site_url", BASE_URL);
            $smarty->assign("message", $thread['message']);
            $smarty->assign("reply", $_POST['np_text']);
            $smarty->assign("thread_url", $_SERVER['HTTP_REFERER']);
            $message = $smarty->fetch(BASE_PATH . '/modules/forum/front/templates/send_answer.txt');
            foreach ($get_subscribers as $k => $v) {
                Mail::send_mail($v['mail'], ADMIN_MAIL, 'Новое сообщение в форуме', $message, '', 'text', 'standard', 'Windows-1251');
            }
        }
        $text = strip_forum_tags($_POST['np_text']);
        if (FORUM_PREMODERATION == 'on') {
            $set_status = '1';
        } else {
            $set_status = '1';
        }
        $db->query("INSERT INTO fw_forum_posts(parent,author,text,publish_date,status) VALUES('{$parent}','{$author}','{$text}','" . time() . "','{$set_status}')");
        $location = $_SERVER['HTTP_REFERER'];
        header("Location: {$location}");
    }
}
//----------------------------- ОТОБРАЖЕНИЯ КОНТЕНТА -------------------------------
switch (TRUE) {
    case count($url) == 1 && isset($_GET['send_answers']):
        $page_found = true;
        $mail = $_SESSION['fw_user']['mail'];