if (isset($_POST['t_to_uid']) && is_numeric($_POST['t_to_uid'])) { $t_to_uid = $_POST['t_to_uid']; } else { $t_to_uid = 0; } $page_prefs = (double) $page_prefs ^ POST_EMOTICONS_DISPLAY; $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";
$user_prefs = array('POST_PAGE' => $page_prefs); if (!user_update_prefs($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 { $post_edit_time = forum_get_setting('post_edit_time', null, 0); if (count($edit_message) > 0) { if ($edit_message['CONTENT'] = message_get_content($tid, $pid)) { if ((forum_get_setting('allow_post_editing', 'N') || $uid != $edit_message['FROM_UID'] && !(perm_get_user_permissions($edit_message['FROM_UID']) & USER_PERM_PILLORIED) || session::check_perm(USER_PERM_PILLORIED, 0) || $post_edit_time > 0 && time() - $edit_message['CREATED'] >= $post_edit_time * HOUR_IN_SECONDS) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) { html_draw_error(gettext("You are not permitted to edit this message."), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $msg)); } if (forum_get_setting('require_post_approval', 'Y') && isset($edit_message['APPROVED']) && $edit_message['APPROVED'] == 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) { html_draw_error(gettext("You are not permitted to edit this message."), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $msg)); } $parsed_message = new MessageTextParse($edit_message['CONTENT']); $t_content = $parsed_message->getMessage(); $t_sig = $parsed_message->getSig(); } else { html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $msg)); } } else { html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $msg)); } } } } $page_title = sprintf(gettext("Edit message %s"), $msg); html_draw_top("title={$page_title}", "resize_width=785", "basetarget=_blank", "attachments.js", "dictionary.js", "emoticons.js", "post.js", 'class=window_title'); echo "<h1>{$page_title}</h1>\n"; if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {