Пример #1
0
                $error_msg_array[] = gettext("Could not save message. Make sure you have enough available free space.");
                $valid = false;
            }
        } else {
            if ($saved_mid = pm_save_message($t_subject, $t_content, $t_to_uid, $t_to_uid_others)) {
                pm_save_attachment_id($saved_mid, $aid);
                header_redirect("lpm.php?webtag={$webtag}&mid={$saved_mid}&message_saved=true");
                exit;
            } else {
                $error_msg_array[] = gettext("Could not save message. Make sure you have enough available free space.");
                $valid = false;
            }
        }
    }
}
light_html_draw_top(sprintf("title=%s", gettext("Send New PM")), "robots=noindex,nofollow");
// preview message
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>\n";
    $pm_preview_array['TLOGON'] = $t_new_recipient_array['LOGON'];
    $pm_preview_array['TNICK'] = $t_new_recipient_array['NICK'];
    $pm_preview_array['TO_UID'] = $t_new_recipient_array['TO_UID'];
    $preview_fuser = user_get($uid);
    $pm_preview_array['FLOGON'] = $preview_fuser['LOGON'];
    $pm_preview_array['FNICK'] = $preview_fuser['NICKNAME'];
    $pm_preview_array['FROM_UID'] = $preview_fuser['UID'];
    $pm_preview_array['SUBJECT'] = $t_subject;
    $pm_preview_array['CREATED'] = time();
    $pm_preview_array['AID'] = $aid;
    $pm_preview_array['CONTENT'] = $t_content;
    light_pm_display($pm_preview_array, PM_FOLDER_OUTBOX, true);
Пример #2
0
function light_html_draw_error($message, $href = null, $method = 'get', array $buttons = array(), array $vars = array())
{
    light_html_draw_top();
    light_navigation_bar();
    light_html_display_msg(gettext('Error'), $message, $href, $method, $buttons, $vars);
    light_html_draw_bottom();
    exit;
}
Пример #3
0
            $error_msg_array[] = gettext("Error creating post! Please try again in a few minutes.");
        }
    } else {
        $error_msg_array[] = sprintf(gettext("You can only post once every %s seconds. Please try again later."), forum_get_setting('minimum_post_frequency', null, 0));
    }
}
if (!isset($t_fid)) {
    $t_fid = 1;
}
if ($new_thread && !($folder_dropdown = folder_draw_dropdown($t_fid, "t_fid", "", FOLDER_ALLOW_NORMAL_THREAD, USER_PERM_THREAD_CREATE, "", "post_folder_dropdown"))) {
    light_html_draw_error(gettext("You cannot create new threads."));
}
if (isset($thread_data['CLOSED']) && $thread_data['CLOSED'] > 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
    light_html_draw_error(gettext("This thread is closed, you cannot post in it!"));
}
light_html_draw_top(sprintf("title=%s", gettext("Post message")));
echo "<h1>", gettext("Post message"), "</h1>\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
if (!$new_thread && isset($thread_data['CLOSED']) && $thread_data['CLOSED'] > 0 && session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
    light_html_display_warning_msg(gettext("Warning: this thread is closed for posting to normal users."));
}
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>";
    if ($t_to_uid == 0) {
        $preview_message['TLOGON'] = gettext("ALL");
        $preview_message['TNICK'] = gettext("ALL");
    } else {
        if ($t_to_uid > 0) {
            $preview_tuser = user_get($t_to_uid);
Пример #4
0
            }
        } else {
            if ($pm_message_array = pm_message_get($mid)) {
                if ($pm_message_array['TYPE'] != PM_OUTBOX) {
                    pm_edit_refuse();
                }
                $parsed_message = new MessageTextParse(pm_get_content($mid));
                $t_content = $parsed_message->getMessage();
                $t_subject = $pm_message_array['SUBJECT'];
            } else {
                pm_edit_refuse();
            }
        }
    }
}
light_html_draw_top(sprintf("title=%s", gettext("Edit Message")));
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>\n";
    light_pm_display($pm_message_array, PM_FOLDER_OUTBOX, true);
}
echo "<form accept-charset=\"utf-8\" name=\"f_post\" action=\"lpm_edit.php\" method=\"post\" target=\"_self\">\n";
echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo "  ", form_input_hidden('mid', htmlentities_array($mid)), "\n";
echo "<div class=\"post\">\n";
echo "<h3>", gettext("Edit Message"), "</h3>\n";
echo "<div class=\"post_inner\">\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array, '720', 'left');
}
echo "<div class=\"post_thread_title\">", gettext("Subject"), ":", light_form_input_text("t_subject", isset($t_subject) ? htmlentities_array($t_subject) : "", 30, 64), "</div>\n";
echo "<div class=\"post_to\">", gettext("To"), ":", word_filter_add_ob_tags(format_user_name($pm_message_array['TLOGON'], $pm_message_array['TNICK']), true), "</div>\n";
Пример #5
0
                $pm_folder_drafts = PM_FOLDER_DRAFTS;
                if (isset($return_msg)) {
                    header_redirect("lmessages.php?webtag={$webtag}&msg={$return_msg}&message_saved=true");
                    exit;
                } else {
                    header_redirect("lpm.php?webtag={$webtag}&folder={$pm_folder_drafts}&mid={$saved_mid}&message_saved=true");
                    exit;
                }
            } else {
                $error_msg_array[] = gettext("Could not save message. Make sure you have enough available free space.");
                $valid = false;
            }
        }
    }
}
light_html_draw_top(array('title' => gettext('Send New PM'), 'js' => array('js/fineuploader.min.js', 'js/attachments.js')));
light_navigation_bar(array('back' => "lpm.php?webtag={$webtag}"));
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>\n";
    $pm_preview_array['RECIPIENTS'] = $to_logon_array;
    $preview_from_user = user_get($_SESSION['UID']);
    $pm_preview_array['FROM_LOGON'] = $preview_from_user['LOGON'];
    $pm_preview_array['FROM_NICKNAME'] = $preview_from_user['NICKNAME'];
    $pm_preview_array['FROM_UID'] = $preview_from_user['UID'];
    $pm_preview_array['SUBJECT'] = $subject;
    $pm_preview_array['CREATED'] = time();
    $pm_preview_array['CONTENT'] = $content;
    $pm_preview_array['ATTACHMENTS'] = $attachments;
    light_pm_display($pm_preview_array, true);
}
echo "<form accept-charset=\"utf-8\" name=\"f_post\" action=\"lpm_write.php\" method=\"post\" target=\"_self\">\n";
Пример #6
0
                    } else {
                        if ($_REQUEST['mark_read_type'] == THREAD_MARK_READ_FOLDER && (isset($folder) && is_numeric($folder))) {
                            if (threads_mark_folder_read($folder)) {
                                header_redirect("lthread_list.php?webtag={$webtag}&mode={$mode}&folder={$folder}&mark_read_success=true");
                                exit;
                            } else {
                                $error_msg_array[] = gettext("Failed to mark selected threads as read");
                                $valid = false;
                            }
                        }
                    }
                }
            }
        } else {
            unset($_REQUEST['mark_read_submit'], $_REQUEST['mark_read_confirm']);
            light_html_draw_top();
            light_navigation_bar();
            light_html_display_msg(gettext("Confirm"), gettext("Are you sure you want to mark the selected threads as read?"), 'lthread_list.php', 'post', array('mark_read_submit' => gettext("Confirm"), 'cancel' => gettext("Cancel")), array_merge($_REQUEST, array('mark_read_confirm' => 'Y')));
            light_html_draw_bottom();
            exit;
        }
    }
}
light_html_draw_top(array('js' => array('js/thread_list.js')));
if (forums_get_available_count() > 1 || !forum_get_default()) {
    light_navigation_bar(array('back' => "lforums.php?webtag={$webtag}", 'nav_links' => array(array('text' => gettext('New Discussion'), 'url' => "lpost.php?webtag={$webtag}", 'class' => 'post_new', 'image' => 'mobile_post'))));
} else {
    light_navigation_bar(array('nav_links' => array(array('text' => gettext('New Discussion'), 'url' => "lpost.php?webtag={$webtag}", 'class' => 'post_new', 'image' => 'mobile_post'))));
}
light_draw_thread_list($mode, $folder, $page);
light_html_draw_bottom();
Пример #7
0
require_once BH_INCLUDE_PATH . 'constants.inc.php';
require_once BH_INCLUDE_PATH . 'html.inc.php';
require_once BH_INCLUDE_PATH . 'light.inc.php';
require_once BH_INCLUDE_PATH . 'pm.inc.php';
require_once BH_INCLUDE_PATH . 'session.inc.php';
// End Required includes
// Check we're logged in correctly
if (!session::logged_in()) {
    light_html_guest_error();
}
if (isset($_GET['mid']) && is_numeric($_GET['mid'])) {
    $mid = $_GET['mid'] > 0 ? $_GET['mid'] : 0;
} else {
    if (isset($_POST['mid']) && is_numeric($_POST['mid'])) {
        $mid = $_POST['mid'] > 0 ? $_POST['mid'] : 0;
    } else {
        $mid = null;
    }
}
// Check that PM system is enabled
light_pm_enabled();
// Prune old messages for the current user
pm_user_prune_folders($_SESSION['UID']);
light_html_draw_top(array('js' => array('js/pm.js')));
if (isset($mid) && is_numeric($mid)) {
    light_navigation_bar(array('back' => "lpm.php?webtag={$webtag}"));
} else {
    light_navigation_bar(array('nav_links' => array(array('text' => gettext('Send New PM'), 'url' => "lpm_write.php?webtag={$webtag}", 'class' => 'pm_send_new', 'image' => 'mobile_post'))));
}
light_draw_pm_inbox();
light_html_draw_bottom();
Пример #8
0
                    exit;
                }
            } else {
                light_html_draw_top(array('title' => gettext("User Registration")));
                light_navigation_bar();
                light_html_display_msg(gettext("Successfully created user account"), gettext("Your user account has been created successfully! Click the continue button below to login"), 'index.php', 'get', array('continue' => gettext("Continue")), array('final_uri' => $final_uri));
                light_html_draw_bottom();
                exit;
            }
        } else {
            $error_msg_array[] = gettext("Error creating user record");
            $valid = false;
        }
    }
}
light_html_draw_top(array('title' => gettext('User Registration'), 'js' => array('js/register.js')));
light_navigation_bar();
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
echo "<form accept-charset=\"utf-8\" name=\"form_register\" action=\"", get_request_uri(), "\" method=\"post\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo "<div class=\"register\">\n";
echo "<h3>", gettext("Register"), "</h3>\n";
echo "<div class=\"register_inner\">\n";
if (isset($user_agree_rules) && $user_agree_rules == 'Y') {
    echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
    echo "  ", form_input_hidden('user_agree_rules', htmlentities_array($user_agree_rules)), "\n";
    echo "  <div class=\"register_username\"><span>", gettext("Username"), ":</span>", light_form_input_text("user_logon", null, 20, 15) . "</div>\n";
    echo "  <div class=\"register_password\"><span>", gettext("Password"), ":</span>", light_form_input_password("user_password", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_password\"><span>", gettext("Confirm Password"), ":</span>", light_form_input_password("user_password", null, 20, 32), "</div>\n";
Пример #9
0
$perm_folder_moderate = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID']);
if (!($thread_data = thread_get($tid, $perm_folder_moderate, false, $perm_folder_moderate))) {
    light_html_draw_top(array('title' => gettext("Error")));
    light_navigation_bar();
    light_html_display_error_msg(gettext("The requested thread could not be found or access was denied."));
    light_html_draw_bottom();
    exit;
}
if (!($message = messages_get($tid, $pid, 1))) {
    light_html_draw_top(array('title' => gettext("Error")));
    light_navigation_bar();
    light_html_display_error_msg(gettext("That post does not exist in this thread!"));
    light_html_draw_bottom();
    exit;
}
light_html_draw_top(array('title' => $thread_data['TITLE']));
light_navigation_bar(array('back' => "lmessages.php?webtag={$webtag}&amp;msg={$return_msg}"));
light_messages_top($msg, $thread_data['TITLE'], $thread_data['INTEREST'], $thread_data['STICKY'], $thread_data['CLOSED'], $thread_data['ADMIN_LOCK'], $thread_data['DELETED'] == 'Y');
$first_msg = $message['PID'];
$message['CONTENT'] = message_get_content($tid, $message['PID']);
if ($thread_data['POLL_FLAG'] == 'Y') {
    if ($message['PID'] == 1) {
        light_poll_display($tid, $thread_data['LENGTH'], $thread_data['FID'], false, $thread_data['CLOSED'], false, false);
        $last_pid = $message['PID'];
    } else {
        light_message_display($tid, $message, $thread_data['LENGTH'], $first_msg, $thread_data['FID'], false, $thread_data['CLOSED'], false, true, false);
        $last_pid = $message['PID'];
    }
} else {
    light_message_display($tid, $message, $thread_data['LENGTH'], $first_msg, $thread_data['FID'], false, $thread_data['CLOSED'], false, false, false);
    $last_pid = $message['PID'];
Пример #10
0
function light_html_draw_error($error_msg, $href = false, $method = 'get', $button_array = false, $var_array = false, $target = "_self")
{
    light_html_draw_top();
    light_html_display_msg(gettext('Error'), $error_msg, $href, $method, $button_array, $var_array, $target);
    light_html_draw_bottom();
    exit;
}
Пример #11
0
    light_html_draw_bottom();
    exit;
}
if (isset($_POST['delete'])) {
    if (post_delete($tid, $pid)) {
        post_add_edit_text($tid, $pid);
        if (session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid) && $preview_message['FROM_UID'] != session::get_value('UID')) {
            admin_add_log_entry(DELETE_POST, array($t_fid, $tid, $pid));
        }
        header_redirect("lmessages.php?webtag={$webtag}&msg={$msg}");
        exit;
    } else {
        $error_msg_array[] = gettext("Error deleting post");
    }
}
light_html_draw_top(sprintf('title=%s %s.%s', gettext("Delete Message"), $tid, $pid), "robots=noindex,nofollow");
echo "<h3>", gettext("Delete Message"), " {$tid}.{$pid}</h3>\n";
if ($preview_message['TO_UID'] == 0) {
    $preview_message['TLOGON'] = gettext("ALL");
    $preview_message['TNICK'] = gettext("ALL");
} else {
    $preview_tuser = user_get($preview_message['TO_UID']);
    $preview_message['TLOGON'] = $preview_tuser['LOGON'];
    $preview_message['TNICK'] = $preview_tuser['NICKNAME'];
}
$preview_tuser = user_get($preview_message['FROM_UID']);
$preview_message['FLOGON'] = $preview_tuser['LOGON'];
$preview_message['FNICK'] = $preview_tuser['NICKNAME'];
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
Пример #12
0
    exit;
}
if (isset($_POST['delete'])) {
    if (post_delete($tid, $pid)) {
        post_add_edit_text($tid, $pid);
        if (session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid) && $preview_message['FROM_UID'] != $_SESSION['UID']) {
            admin_add_log_entry(DELETE_POST, array($t_fid, $tid, $pid));
        }
        header_redirect("lmessages.php?webtag={$webtag}&msg={$return_msg}&delete_success={$msg}");
        exit;
    } else {
        $error_msg_array[] = gettext("Error deleting post");
    }
}
$page_title = sprintf(gettext("Delete message %s"), $msg);
light_html_draw_top(array('title' => $page_title));
light_navigation_bar(array('back' => "lmessages.php?webtag={$webtag}&msg={$return_msg}"));
echo "<h3>", $page_title, "</h3>\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
echo "<form accept-charset=\"utf-8\" name=\"f_delete\" action=\"ldelete.php\" method=\"post\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo "  ", form_input_hidden('msg', htmlentities_array($msg)), "\n";
echo "  ", form_input_hidden('return_msg', htmlentities_array($return_msg)), "\n";
if (thread_is_poll($tid) && $pid == 1) {
    light_poll_display($tid, $thread_data['LENGTH'], $thread_data['FID'], false, $thread_data['CLOSED'], false, false);
} else {
    light_message_display($tid, $preview_message, $thread_data['LENGTH'], $pid, $thread_data['FID'], false, $thread_data['CLOSED'], false, false, true);
}
Пример #13
0
    if (isset($_POST['poll_change_vote'])) {
        poll_delete_vote($tid);
        header_redirect("lmessages.php?webtag={$webtag}&msg={$msg}");
    }
}
if (!($folder_data = thread_get_folder($tid))) {
    light_html_display_error_msg(gettext("The requested folder could not be found or access was denied."));
    return;
}
$perm_folder_moderate = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID']);
if (!($thread_data = thread_get($tid, $perm_folder_moderate, false, $perm_folder_moderate))) {
    light_html_display_error_msg(gettext("The requested thread could not be found or access was denied."));
    return;
}
if (isset($_SESSION['POSTS_PER_PAGE']) && is_numeric($_SESSION['POSTS_PER_PAGE'])) {
    $posts_per_page = max(min($_SESSION['POSTS_PER_PAGE'], 30), 10);
} else {
    $posts_per_page = 20;
}
if (!($messages = messages_get($tid, $pid, $posts_per_page))) {
    light_html_display_error_msg(gettext("That post does not exist in this thread!"));
    return;
}
light_html_draw_top(array('js' => array('js/messages.js')));
$nav_links = array(array('text' => gettext('Show messages'), 'url' => '#', 'class' => 'navigation', 'html' => light_messages_navigation_strip($tid, $pid, $thread_data['LENGTH'], 10), 'image' => 'mobile_navigation'));
if (!$thread_data['CLOSED'] && session::check_perm(USER_PERM_POST_CREATE, $folder_data['FID'])) {
    array_unshift($nav_links, array('text' => gettext('Reply to All'), 'url' => "lpost.php?webtag={$webtag}&reply_to={$tid}.0&return_msg={$tid}.{$pid}", 'class' => 'reply_all', 'image' => 'mobile_reply_all'));
}
light_navigation_bar(array('back' => "lthread_list.php?webtag={$webtag}", 'nav_links' => $nav_links));
light_draw_messages($tid, $pid, $thread_data, $messages);
light_html_draw_bottom();
Пример #14
0
if ($new_thread && !($folder_dropdown = folder_draw_dropdown($fid, "fid", "", FOLDER_ALLOW_NORMAL_THREAD, USER_PERM_THREAD_CREATE, "", "post_folder_dropdown"))) {
    light_html_draw_error(gettext("You cannot create new threads."));
}
if (isset($thread_data['CLOSED']) && $thread_data['CLOSED'] > 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
    light_html_draw_error(gettext("This thread is closed, you cannot post in it!"));
}
if (isset($return_msg)) {
    $back = "lmessages.php?webtag={$webtag}&msg={$return_msg}";
} else {
    if (isset($tid) && is_numeric($tid) && isset($reply_to_pid) && is_numeric($reply_to_pid)) {
        $back = "lmessages.php?webtag={$webtag}&msg={$tid}.{$reply_to_pid}";
    } else {
        $back = "lthread_list.php?webtag={$webtag}";
    }
}
light_html_draw_top(array('title' => gettext('Post message'), 'js' => array('js/fineuploader.min.js', 'js/attachments.js')));
light_navigation_bar(array('back' => $back));
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
if (!$new_thread && isset($thread_data['CLOSED']) && $thread_data['CLOSED'] > 0 && session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
    light_html_display_warning_msg(gettext("Warning: this thread is closed for posting to normal users."));
}
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>";
    $preview_message['RECIPIENTS'] = $to_logon_array;
    $preview_fuser = user_get($_SESSION['UID']);
    $preview_message['FROM_LOGON'] = $preview_fuser['LOGON'];
    $preview_message['FROM_NICKNAME'] = $preview_fuser['NICKNAME'];
    $preview_message['FROM_UID'] = $preview_fuser['UID'];
    $preview_message['CONTENT'] = $content;
Пример #15
0
                    $to_uid = $edit_message['TO_UID'];
                    $from_uid = $edit_message['FROM_UID'];
                    $parsed_message = new MessageTextParse($edit_message['CONTENT']);
                    $t_content = $parsed_message->getMessage();
                    $t_sig = $parsed_message->getSig();
                } else {
                    light_html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'lthread_list.php', 'get', array('back' => gettext("Back")));
                }
            } else {
                light_html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'lthread_list.php', 'get', array('back' => gettext("Back")));
            }
        }
    }
}
$page_title = sprintf(gettext("Edit message %s"), $msg);
light_html_draw_top("title={$page_title}");
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>";
    light_message_display($tid, $edit_message, $thread_data['LENGTH'], $pid, $thread_data['FID'], false, false, false, false, true);
}
echo "<form accept-charset=\"utf-8\" name=\"f_edit\" action=\"ledit.php\" method=\"post\" target=\"_self\">\n";
echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo form_input_hidden("msg", htmlentities_array($msg));
echo "<div class=\"post\">\n";
echo sprintf("<h3>%s %s</h3>", gettext("Edit message"), $msg);
echo "<div class=\"post_inner\">\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
echo "<div class=\"post_content\">", gettext("Content"), ":", light_form_textarea("t_content", htmlentities_array($t_content), 10, 50, false, 'textarea editor mobile'), "</div>";
if ($allow_sig == true) {
Пример #16
0
    if (isset($_POST['tid']) && is_numeric($_POST['tid'])) {
        $tid = $_POST['tid'];
        if (isset($_POST['pollvote']) && is_array($_POST['pollvote'])) {
            $poll_votes = $_POST['pollvote'];
            if (poll_check_tabular_votes($tid, $poll_votes)) {
                poll_vote($tid, $poll_votes);
            } else {
                light_html_draw_top(sprintf("title=%s", gettext("Error")));
                light_html_display_error_msg(gettext("You must vote in every group."));
                light_html_draw_bottom();
                exit;
            }
        } else {
            light_html_draw_top(sprintf("title=%s", gettext("Error")));
            light_html_display_error_msg(gettext("You must select an option to vote for!"));
            light_html_draw_bottom();
            exit;
        }
    }
} else {
    if (isset($_POST['pollchangevote'])) {
        if (isset($_POST['tid']) && is_numeric($_POST['tid'])) {
            $tid = $_POST['tid'];
            $pid = 1;
            poll_delete_vote($tid);
        }
    }
}
light_html_draw_top();
light_draw_messages($tid, $pid);
light_html_draw_bottom();
Пример #17
0
                        light_html_draw_error(gettext("You are not permitted to edit this message."), 'lmessages.php', 'get', array('back' => gettext("Back")), array('msg' => $return_msg));
                    }
                    $parsed_message = new MessageTextParse($edit_message['CONTENT']);
                    $content = $parsed_message->getMessage();
                    $sig = $parsed_message->getSig();
                } else {
                    light_html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'lthread_list.php', 'get', array('back' => gettext("Back")));
                }
            } else {
                light_html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'lthread_list.php', 'get', array('back' => gettext("Back")));
            }
        }
    }
}
$page_title = sprintf(gettext("Edit message %s"), $msg);
light_html_draw_top(array('title' => $page_title, 'js' => array('js/fineuploader.min.js', 'js/attachments.js')));
light_navigation_bar(array('back' => "lmessages.php?webtag={$webtag}&msg={$return_msg}"));
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>";
    light_message_display($tid, $edit_message, $thread_data['LENGTH'], $pid, $thread_data['FID'], false, false, false, false, true);
}
echo "<form accept-charset=\"utf-8\" name=\"f_edit\" action=\"ledit.php\" method=\"post\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo form_input_hidden("msg", htmlentities_array($msg));
echo form_input_hidden('return_msg', htmlentities_array($return_msg)), "\n";
echo "<div class=\"post\">\n";
echo "<h3>", $page_title, "</h3>\n";
echo "<div class=\"post_inner\">\n";
echo "<div class=\"post_to\">", gettext("To"), ":\n";
echo "<div class=\"recipients\">\n";
Пример #18
0
            $user_prefs = array('POST_PAGE' => $page_prefs);
            if (!user_update_prefs($_SESSION['UID'], $user_prefs)) {
                $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later.");
                $valid = false;
            }
        } else {
            if (!isset($message_data['EDITABLE']) || $message_data['EDITABLE'] == 0) {
                pm_edit_refuse();
            }
            $parsed_message = new MessageTextParse(pm_get_content($mid));
            $t_content = $parsed_message->getMessage();
            $t_subject = $message_data['SUBJECT'];
        }
    }
}
light_html_draw_top(array('title' => gettext('Edit Message'), 'js' => array('js/fineuploader.min.js')));
light_navigation_bar(array('back' => "lpm.php?webtag={$webtag}&mid={$mid}"));
if ($valid && isset($_POST['preview'])) {
    echo "<h3>", gettext("Message Preview"), "</h3>\n";
    light_pm_display($message_data, true);
}
echo "<form accept-charset=\"utf-8\" name=\"f_post\" action=\"lpm_edit.php\" method=\"post\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo "  ", form_input_hidden('mid', htmlentities_array($mid)), "\n";
echo "<div class=\"post\">\n";
echo "<h3>", gettext("Edit Message"), "</h3>\n";
echo "<div class=\"post_inner\">\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
}
Пример #19
0
    light_html_draw_bottom();
    exit;
}
if (!($folder_data = folder_get($thread_data['FID']))) {
    light_html_draw_top(sprintf("title=%s", gettext("Error")));
    light_html_display_error_msg(gettext("The requested folder could not be found or access was denied."));
    light_html_draw_bottom();
    exit;
}
if (!($message = messages_get($tid, $pid, 1))) {
    light_html_draw_top(sprintf("title=%s", gettext("Error")));
    light_html_display_error_msg(gettext("That post does not exist in this thread!"));
    light_html_draw_bottom();
    exit;
}
light_html_draw_top("title={$thread_data['TITLE']}");
light_messages_top($msg, $thread_data['TITLE'], $thread_data['INTEREST'], $thread_data['STICKY'], $thread_data['CLOSED'], $thread_data['ADMIN_LOCK'], $thread_data['DELETED'] == 'Y');
$first_msg = $message['PID'];
$message['CONTENT'] = message_get_content($tid, $message['PID']);
if ($thread_data['POLL_FLAG'] == 'Y') {
    if ($message['PID'] == 1) {
        light_poll_display($tid, $thread_data['LENGTH'], $thread_data['FID'], false, $thread_data['CLOSED'], false, false);
        $last_pid = $message['PID'];
    } else {
        light_message_display($tid, $message, $thread_data['LENGTH'], $first_msg, $thread_data['FID'], false, $thread_data['CLOSED'], false, true, false, false);
        $last_pid = $message['PID'];
    }
} else {
    light_message_display($tid, $message, $thread_data['LENGTH'], $first_msg, $thread_data['FID'], false, $thread_data['CLOSED'], false, false, false, false);
    $last_pid = $message['PID'];
}