示例#1
0
    echo "<div class=\"post_inner\">\n";
    echo "<div class=\"post_folder\">", gettext("Select folder"), ":", light_folder_draw_dropdown($fid, "fid"), "</div>";
    echo "<div class=\"post_thread_title\">", gettext("Thread title"), ":", light_form_input_text("threadtitle", htmlentities_array($threadtitle), 30, 64), "</div>";
} else {
    if (!($reply_message = messages_get($tid, $reply_to_pid))) {
        light_html_display_error_msg(gettext("That post does not exist in this thread!"));
        light_html_draw_bottom();
        exit;
    }
    $reply_message['CONTENT'] = message_get_content($tid, $reply_to_pid);
    if ((!isset($reply_message['CONTENT']) || $reply_message['CONTENT'] == "") && $thread_data['POLL_FLAG'] != 'Y' && $reply_to_pid != 0) {
        light_html_display_error_msg(gettext("Message not found. Check that it hasn't been deleted."));
        light_html_draw_bottom();
        exit;
    } else {
        echo "<h3>", gettext("Post Reply"), ": ", word_filter_add_ob_tags(thread_get_title($tid), true), "</h3>\n";
        echo "<div class=\"post_inner\">\n";
        echo form_input_hidden("reply_to", htmlentities_array("{$tid}.{$reply_to_pid}"));
        echo form_input_hidden('return_msg', htmlentities_array($return_msg)), "\n";
    }
}
echo "<div class=\"post_to\">", gettext("To"), ":", light_form_input_text("to_logon", isset($to_logon) ? htmlentities_array($to_logon) : "", 30, null, null, gettext("Leave blank for all")), "</div>";
echo "<div class=\"post_content\">", gettext("Content"), ":", light_form_textarea("content", htmlentities_array(strip_paragraphs($content)), 10, 50, null, 'textarea'), "</div>";
echo "<div class=\"post_buttons\">";
echo light_form_submit("post", gettext("Post"));
echo light_form_submit("preview", gettext("Preview"));
if (isset($return_msg)) {
    echo "<a href=\"lmessages.php?webtag={$webtag}&amp;msg={$return_msg}\" class=\"button\" target=\"_self\"><span>", gettext("Cancel"), "</span></a>\n";
} else {
    if (isset($tid) && is_numeric($tid) && isset($reply_to_pid) && is_numeric($reply_to_pid)) {
        echo "<a href=\"lmessages.php?webtag={$webtag}&amp;msg={$tid}.{$reply_to_pid}\" class=\"button\" target=\"_self\"><span>", gettext("Cancel"), "</span></a>\n";
require_once BH_INCLUDE_PATH . 'threads.inc.php';
require_once BH_INCLUDE_PATH . 'user.inc.php';
require_once BH_INCLUDE_PATH . 'user_rel.inc.php';
require_once BH_INCLUDE_PATH . 'word_filter.inc.php';
// Check we're logged in correctly
if (!session::logged_in()) {
    html_guest_error();
}
$error_msg_array = array();
if (isset($_POST['save'])) {
    $valid = true;
    if (isset($_POST['set_interest']) && is_array($_POST['set_interest'])) {
        foreach ($_POST['set_interest'] as $thread) {
            if ($valid && is_numeric($thread)) {
                if (!thread_set_interest($thread, 0)) {
                    $thread_title = thread_get_title($thread);
                    $error_msg_array[] = sprintf(gettext("Could not update interest on thread '%s'"), $thread_title);
                    $valid = false;
                }
            }
        }
        if ($valid) {
            header_redirect("edit_subscriptions.php?webtag={$webtag}&updated=true");
            exit;
        }
    }
}
if (isset($_GET['page']) && is_numeric($_GET['page'])) {
    $page = $_GET['page'];
} else {
    if (isset($_POST['page']) && is_numeric($_POST['page'])) {