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}&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}&msg={$tid}.{$reply_to_pid}\" class=\"button\" target=\"_self\"><span>", gettext("Cancel"), "</span></a>\n"; } else { echo "<a href=\"lthread_list.php?webtag={$webtag}\" class=\"button\" target=\"_self\"><span>", gettext("Cancel"), "</span></a>\n"; } } echo "</div>"; if (attachments_check_dir() && (session::check_perm(USER_PERM_POST_ATTACHMENTS | USER_PERM_POST_READ, $fid) || $new_thread)) { echo "<div class=\"attachments post_attachments\">", gettext('Attachments'), ":\n"; echo " ", attachments_form($_SESSION['UID'], $attachments), "\n"; echo "</div>\n"; } echo "</div>"; echo "</div>"; echo "</form>\n"; if (!$new_thread && $reply_to_pid > 0) { echo "<h3>", gettext("In reply to"), ":</h3>\n"; if ($thread_data['POLL_FLAG'] == 'Y' && $reply_message['PID'] == 1) { light_poll_display($tid, $thread_data['LENGTH'], $thread_data['FID'], $thread_data['CLOSED'], false, true); } else { light_message_display($tid, $reply_message, $thread_data['LENGTH'], $reply_to_pid, $thread_data['FID'], false, false, false, false, true); } } light_html_draw_bottom();
function light_poll_display($tid, $msg_count, $folder_fid, $in_list = true, $closed = false, $limit_text = true, $is_preview = false) { $webtag = get_webtag(); forum_check_webtag_available($webtag); $total_votes = 0; $user_votes = 0; $guest_votes = 0; $poll_data = poll_get($tid); $poll_results = poll_get_votes($tid); $user_poll_votes_array = poll_get_user_votes($tid); poll_get_total_votes($tid, $total_votes, $user_votes, $guest_votes); $request_uri = get_request_uri(); $poll_display = "<div class=\"poll\">\n"; $poll_display .= "<form accept-charset=\"utf-8\" method=\"post\" action=\"{$request_uri}\" target=\"_self\">\n"; $poll_display .= form_csrf_token_field(); $poll_display .= form_input_hidden('webtag', htmlentities_array($webtag)); $poll_display .= form_input_hidden('msg', htmlentities_array("{$tid}.1")); if ((!is_array($user_poll_votes_array) || $poll_data['CHANGEVOTE'] == POLL_VOTE_MULTI) && ($_SESSION['UID'] > 0 || $poll_data['ALLOWGUESTS'] == POLL_GUEST_ALLOWED && forum_get_setting('poll_allow_guests', 'Y')) && ($poll_data['CLOSES'] == 0 || $poll_data['CLOSES'] > time()) && !$is_preview) { foreach ($poll_results as $question_id => $poll_question) { $poll_display .= "<h3>" . word_filter_add_ob_tags($poll_question['QUESTION'], true) . "</h3>\n"; if ($poll_data['OPTIONTYPE'] == POLL_OPTIONS_DROPDOWN) { $dropdown_options_array = array_map('poll_dropdown_options_callback', $poll_question['OPTIONS_ARRAY']); $poll_display .= light_form_dropdown_array("poll_vote[{$question_id}]", $dropdown_options_array); } else { foreach ($poll_question['OPTIONS_ARRAY'] as $option_id => $option) { if (sizeof($poll_question['OPTIONS_ARRAY']) == 1 || $poll_question['ALLOW_MULTI'] == 'Y') { $poll_display .= light_form_checkbox("poll_vote[{$question_id}][{$option_id}]", 'Y', word_filter_add_ob_tags($option['OPTION_NAME'])); } else { $poll_display .= light_form_radio("poll_vote[{$question_id}]", $option_id, word_filter_add_ob_tags($option['OPTION_NAME'])); } } } } } else { if ($poll_data['SHOWRESULTS'] == POLL_SHOW_RESULTS || $poll_data['CLOSES'] > 0 && $poll_data['CLOSES'] < time()) { $poll_display .= "<div class=\"poll_results\">\n"; foreach ($poll_results as $poll_question) { $poll_display .= "<h3>" . word_filter_add_ob_tags($poll_question['QUESTION'], true) . "</h3>\n"; $poll_display .= light_poll_graph_display($poll_question['OPTIONS_ARRAY']); } $poll_display .= "</div>\n"; } else { $poll_display .= "<div class=\"poll_results\">\n"; foreach ($poll_results as $poll_question) { $poll_display .= "<h3>" . word_filter_add_ob_tags($poll_question['QUESTION'], true) . "</h3>\n"; foreach ($poll_question['OPTIONS_ARRAY'] as $option) { $poll_display .= word_filter_add_ob_tags($option['OPTION_NAME']); } } $poll_display .= "</div>\n"; } } if (!$is_preview) { $poll_display .= "<div class=\"poll_vote_counts\">" . poll_format_vote_counts($poll_data, $user_votes, $guest_votes) . "</div>\n"; if ($poll_data['CLOSES'] <= time() && $poll_data['CLOSES'] != 0) { $poll_display .= "<div class=\"poll_vote_closed\">" . gettext("Poll has ended") . "</div>\n"; if (is_array($user_poll_votes_array) && sizeof($user_poll_votes_array) > 0) { $poll_display .= poll_display_user_votes($user_poll_votes_array); } } else { if (is_array($user_poll_votes_array) && sizeof($user_poll_votes_array) > 0) { $poll_display .= poll_display_user_votes($user_poll_votes_array); if ($poll_data['CHANGEVOTE'] == POLL_VOTE_MULTI) { $poll_display .= "<div class=\"poll_buttons\">" . light_form_submit('poll_submit', gettext("Vote")) . "</div>"; } if ($poll_data['CHANGEVOTE'] != POLL_VOTE_CANNOT_CHANGE) { $poll_display .= "<div class=\"poll_buttons\">" . light_form_submit('poll_change_vote', gettext("Change vote")) . "</div>\n"; } if ($poll_data['VOTETYPE'] == POLL_VOTE_PUBLIC && $poll_data['CHANGEVOTE'] < POLL_VOTE_MULTI && $poll_data['POLLTYPE'] != POLL_TABLE_GRAPH) { $poll_display .= "<div class=\"poll_type_warning\">" . gettext("<b>Warning</b>: This is a public ballot. Your name will be visible next to the option you vote for.") . "</div>\n"; } } else { if ($_SESSION['UID'] > 0 || $poll_data['ALLOWGUESTS'] == POLL_GUEST_ALLOWED && forum_get_setting('poll_allow_guests', 'Y')) { $poll_display .= "<div class=\"poll_buttons\">" . light_form_submit('poll_submit', gettext("Vote")) . "</div>"; if ($poll_data['VOTETYPE'] == POLL_VOTE_PUBLIC && $poll_data['CHANGEVOTE'] < POLL_VOTE_MULTI && $poll_data['POLLTYPE'] != POLL_TABLE_GRAPH) { $poll_display .= "<div class=\"poll_type_warning\">" . gettext("<b>Warning</b>: This is a public ballot. Your name will be visible next to the option you vote for.") . "</div>\n"; } } } } } $poll_display .= "</form>\n"; $poll_display .= "</div>\n"; $poll_data['CONTENT'] = $poll_display; light_message_display($tid, $poll_data, $msg_count, 1, $folder_fid, $in_list, $closed, $limit_text, true, $is_preview); }
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}&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']; } light_html_draw_bottom();
$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"; if (isset($edit_message['RECIPIENTS']) && sizeof($edit_message['RECIPIENTS']) > 0) { foreach ($edit_message['RECIPIENTS'] as $recipient) { echo word_filter_add_ob_tags(format_user_name($recipient['LOGON'], $recipient['NICKNAME']), true), "\n"; }
} 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); } echo "<form accept-charset=\"utf-8\" name=\"f_delete\" action=\"ldelete.php\" method=\"post\" target=\"_self\">\n"; echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; echo " ", form_input_hidden('msg', htmlentities_array($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); } echo "<div class=\"post_buttons\">"; echo light_form_submit("delete", gettext("Delete")); echo light_form_submit("cancel", gettext("Cancel")); echo "</div>\n"; echo "</form>\n"; light_html_draw_bottom();