} if ($new_thread) { echo form_input_hidden("newthread", "Y"); echo "<h3>", gettext("Create new thread"), "</h3>\n"; 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)) {
if (isset($_POST['pollsubmit'])) { 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);
function light_draw_my_forums() { $webtag = get_webtag(); forum_check_webtag_available($webtag); if (isset($_GET['page']) && is_numeric($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } if (isset($_GET['webtag_error']) && strlen(trim($_GET['webtag_error'])) > 0) { light_html_display_error_msg(gettext("Invalid forum or forum is not available")); } if (session::logged_in()) { $forums_array = get_my_forums(FORUMS_SHOW_ALL, $page); if (isset($forums_array['forums_array']) && sizeof($forums_array['forums_array']) > 0) { foreach ($forums_array['forums_array'] as $forum) { echo "<div class=\"forum\">\n"; echo "<h3><a href=\"lthread_list.php?webtag={$forum['WEBTAG']}\">{$forum['FORUM_NAME']}</a></h3>\n"; echo "<div class=\"forum_inner\">\n"; echo "<div class=\"forum_info\">", $forum['FORUM_DESC'], "</div>"; echo "<ul>\n"; echo "<li>\n"; echo "<span class=\"forum_messages\">"; if (isset($forum['UNREAD_TO_ME']) && $forum['UNREAD_TO_ME'] > 0) { if (isset($forum['UNREAD_MESSAGES']) && is_numeric($forum['UNREAD_MESSAGES']) && $forum['UNREAD_MESSAGES'] > 0) { echo sprintf(gettext("%s Unread Messages"), format_number($forum['UNREAD_MESSAGES'])), " (", sprintf(gettext("%s Unread "To: Me""), format_number($forum['UNREAD_TO_ME'])), ")\n"; } else { echo sprintf(gettext("%s Unread "To: Me""), format_number($forum['UNREAD_TO_ME'])); } } else { if (isset($forum['UNREAD_MESSAGES']) && is_numeric($forum['UNREAD_MESSAGES']) && $forum['UNREAD_MESSAGES'] > 0) { echo sprintf(gettext("%s Unread Messages"), format_number($forum['UNREAD_MESSAGES'])); } else { echo gettext("No Unread Messages"); } } echo "</span>\n"; echo "</li>\n"; echo "<li>"; if (isset($forum['LAST_VISIT']) && $forum['LAST_VISIT'] > 0) { echo "<span class=\"forum_last_visit\">", gettext("Last Visited"), ": ", format_date_time($forum['LAST_VISIT']), "</span>\n"; } else { echo "<span class=\"forum_last_visit\">", gettext("Last Visited"), ": ", gettext("Never"), "</span>\n"; } echo "</li>\n"; echo "</ul>\n"; echo "</div>\n"; echo "</div>\n"; } html_page_links("lforums.php?webtag={$webtag}", $page, $forums_array['forums_count'], 10); } else { echo "<h3>", gettext("There are no forums available. Please login to view your forums."), "</h3>\n"; } } else { $forums_array = get_forum_list($page); if (isset($forums_array['forums_array']) && sizeof($forums_array['forums_array']) > 0) { foreach ($forums_array['forums_array'] as $forum) { echo "<div class=\"forum\">\n"; echo "<h3><a href=\"lthread_list.php?webtag={$forum['WEBTAG']}\">{$forum['FORUM_NAME']}</a></h3>\n"; echo "<div class=\"forum_inner\">\n"; echo "<div class=\"forum_info\">", $forum['FORUM_DESC'], "</div>"; echo "<ul>\n"; echo "<li>\n"; echo "<span class=\"forum_messages\">", format_number($forum['MESSAGES']), " ", gettext("Messages"), "</span>\n"; echo "</li>\n"; echo "</ul>\n"; echo "</div>\n"; echo "</div>\n"; } html_page_links("lforums.php?webtag={$webtag}", $page, $forums_array['forums_count'], 10); } else { echo "<h3>", gettext("There are no forums available. Please login to view your forums."), "</h3>\n"; } } }
$return_msg = $_GET['return_msg']; } else { $return_msg = $msg; } } if (!($edit_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; } if (thread_is_poll($tid) && $pid == 1) { light_html_draw_top(array('title' => gettext("Error"))); light_navigation_bar(); light_html_display_error_msg(gettext("Cannot edit polls in Mobile mode")); light_html_draw_bottom(); exit; } if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) { light_html_email_confirmation_error(); exit; } if (!session::check_perm(USER_PERM_POST_EDIT | USER_PERM_POST_READ, $fid)) { light_html_draw_error(gettext("You cannot edit posts in this folder")); } if (!($thread_data = thread_get($tid))) { light_html_draw_error(gettext("The requested thread could not be found or access was denied.")); } $error_msg_array = array(); $show_sigs = session::show_sigs();
echo "<body>\n"; } if (forum_check_webtag_available($webtag, false)) { if (isset($_GET['msg']) && validate_msg($_GET['msg'])) { list($tid, $pid) = explode('.', $_GET['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 (!($messages = messages_get($tid, $pid, 10))) { light_html_display_error_msg(gettext("That post does not exist in this thread!")); return; } if (browser_mobile()) { 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); } else { if (isset($_GET['mid']) && is_numeric($_GET['mid'])) { if (!session::logged_in()) { light_html_guest_error();
} if ((session::get_value('UID') != $preview_message['FROM_UID'] || session::check_perm(USER_PERM_PILLORIED, 0)) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) { light_html_draw_top(sprintf("title=%s", gettext("Error")), "robots=noindex,nofollow"); light_post_edit_refuse(); light_html_draw_bottom(); exit; } if (forum_get_setting('require_post_approval', 'Y') && isset($preview_message['APPROVED']) && $preview_message['APPROVED'] == 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) { light_html_draw_top(sprintf("title=%s", gettext("Error")), "robots=noindex,nofollow"); light_post_edit_refuse(); light_html_draw_bottom(); exit; } } else { light_html_draw_top(sprintf("title=%s", gettext("Error")), "robots=noindex,nofollow"); light_html_display_error_msg(sprintf(gettext("Message %s was not found"), $msg)); 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(); light_navigation_bar(); light_thread_list_draw_top(SEARCH_RESULTS); echo "", html_style_image('search'), " ", gettext("Found"), ": 0 ", gettext("matches"), "<br /><br />\n"; } light_html_draw_bottom(); exit; } } light_html_draw_top(); light_navigation_bar(); if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { light_html_display_error_array($error_msg_array); } else { if (isset($search_no_matches) && $search_no_matches == true) { light_html_display_error_msg(gettext("Search Returned No Results")); } } echo "<form accept-charset=\"utf-8\" id=\"search_form\" method=\"post\" action=\"lsearch.php\" target=\"_self\">\n"; echo " ", form_csrf_token_field(), "\n"; echo form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; echo "<div class=\"search\">\n"; echo "<h3>", gettext("Search discussions"), "</h3>\n"; echo "<div class=\"search_inner\">\n"; echo "<div class=\"search_keywords\">", gettext("Keywords"), ":", light_form_input_text("search_string", isset($search_arguments['search_string']) ? htmlentities_array($search_arguments['search_string']) : '', 30), "</div>\n"; echo "<div class=\"search_user\">", gettext("Username (optional)"), ":", light_form_input_text("username", isset($search_arguments['username']) ? htmlentities_array($search_arguments['username']) : '', 30), "</div>\n"; echo "<div class=\"search_folder\">", gettext("Folder(s)"), ":", $folder_dropdown, "</div>\n"; echo "<div class=\"search_date\">", gettext("Posted From"), ":", light_form_dropdown_array("date_from", $search_date_from_array, isset($search_arguments['date_from']) && in_array($search_arguments['date_from'], array_keys($search_date_from_array)) ? $search_arguments['date_from'] : SEARCH_FROM_ONE_MONTH_AGO), "</div>\n"; echo "<div class=\"search_date\">", gettext("Posted to"), ":", light_form_dropdown_array("date_to", $search_date_to_array, isset($search_arguments['date_to']) && in_array($search_arguments['date_to'], array_keys($search_date_from_array)) ? $search_arguments['date_to'] : SEARCH_TO_TODAY), "</div>\n"; echo "<div class=\"search_buttons\">", light_form_submit("search_submit", gettext("Find")), "</div>"; echo "</div>";