function light_message_display($tid, $message, $msg_count, $first_msg, $folder_fid, $in_list = true, $closed = false, $limit_text = true, $is_poll = false, $is_preview = false) { $perm_is_moderator = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_fid); $post_edit_time = forum_get_setting('post_edit_time', null, 0); $post_edit_grace_period = forum_get_setting('post_edit_grace_period', null, 0); $webtag = get_webtag(); forum_check_webtag_available($webtag); if (!isset($_SESSION['UID']) || !is_numeric($_SESSION['UID'])) { return; } if ((!isset($message['CONTENT']) || $message['CONTENT'] == "") && !$is_preview) { light_message_display_deleted($tid, isset($message['PID']) ? $message['PID'] : 0); return; } $from_user_permissions = perm_get_user_permissions($message['FROM_UID']); if ($_SESSION['UID'] != $message['FROM_UID']) { if ($from_user_permissions & USER_PERM_WORMED && !$perm_is_moderator) { light_message_display_deleted($tid, $message['PID']); return; } } if (!$is_preview && !isset($message['APPROVED'])) { light_message_display_approval_req($tid, $message['PID']); return; } if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED_COMPLETELY) { light_message_display_deleted($tid, $message['PID']); return; } if (isset($message['RECIPIENTS']) && sizeof($message['RECIPIENTS']) == 1) { $recipient = array_slice(array_values($message['RECIPIENTS']), 0, 1); if (isset($recipient['RELATIONSHIP']) && $recipient['RELATIONSHIP'] & USER_IGNORED_COMPLETELY) { light_message_display_deleted($tid, $message['PID']); return; } } if (!$is_preview && isset($message['MOVED_TID']) && isset($message['MOVED_PID'])) { light_message_display_moved($message); return; } if (isset($_SESSION['IMAGES_TO_LINKS']) && $_SESSION['IMAGES_TO_LINKS'] == 'Y') { $message['CONTENT'] = message_images_to_links($message['CONTENT']); } if (mb_strlen(strip_tags($message['CONTENT'])) > intval(forum_get_setting('maximum_post_length', null, 6226)) && $limit_text) { $cut_msg = mb_substr($message['CONTENT'], 0, intval(forum_get_setting('maximum_post_length', null, 6226))); $cut_msg = preg_replace("/(<[^>]+)?\$/Du", "", $cut_msg); $message['CONTENT'] = fix_html($cut_msg); $message['CONTENT'] .= "…[" . gettext("Message Truncated") . "]\n"; $message['CONTENT'] .= "<a href=\"ldisplay.php?webtag={$webtag}&msg={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" class=\"message_full_view\">" . gettext("View full message") . ".</a>"; } if ($in_list && isset($message['PID'])) { echo "<a name=\"a{$tid}_{$message['PID']}\"></a>"; } if ($in_list && isset($message['PID'])) { echo "<div class=\"message\" id=\"message_{$tid}_{$message['PID']}\">\n"; } else { echo "<div class=\"message\">\n"; } echo "<div class=\"message_header\">\n"; echo "<div class=\"message_from\">\n"; echo gettext("From"), ": ", word_filter_add_ob_tags(format_user_name($message['FROM_LOGON'], $message['FROM_NICKNAME']), true); if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_FRIEND) { echo html_style_image('friend', gettext("Friend")); } else { if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED) { echo html_style_image('enemy', gettext("Ignored user")); } } // If the user posting a poll is ignored, remove ignored status for this message only so the poll can be seen if ($is_poll && $message['PID'] == 1 && isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED) { $message['RELATIONSHIP'] -= USER_IGNORED; } if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED && $limit_text && $_SESSION['UID'] > 0) { echo "<span class=\"message_ignored\">", gettext("Ignored message"), "</span>\n"; } else { if ($in_list) { if ($from_user_permissions & USER_PERM_WORMED) { echo gettext("Wormed user"); } echo "<span class=\"message_time\">", format_date_time($message['CREATED']), "</span>\n"; } } echo "<div class=\"clearer\"></div>\n"; echo "</div>"; echo "<div class=\"message_to\">", gettext("To"), ": "; if (isset($message['RECIPIENTS']) && sizeof($message['RECIPIENTS']) > 0) { foreach ($message['RECIPIENTS'] as $recipient) { if (isset($recipient['RELATIONSHIP']) && $recipient['RELATIONSHIP'] & USER_IGNORED_COMPLETELY) { continue; } echo word_filter_add_ob_tags(format_user_name($recipient['LOGON'], $recipient['NICKNAME']), true), "\n"; if (isset($recipient['VIEWED']) && $recipient['VIEWED'] > 0) { echo "<span>", html_style_image('post_read', sprintf(gettext("Read: %s"), format_date_time($recipient['VIEWED']))), "</span>\n"; } else { if ($is_preview == false) { echo "<span>", html_style_image('post_unread', gettext("Unread Message")), "</span>\n"; } } } } else { echo gettext('ALL'); } if ($in_list && $msg_count > 0) { echo "<span class=\"message_count\">", sprintf(gettext("%s of %s"), $message['PID'], $msg_count), "</span>"; } echo "<div class=\"clearer\"></div>\n"; echo "</div>\n"; echo "</div>\n"; if (!$is_poll || isset($message['PID']) && $message['PID'] > 1) { $message['CONTENT'] = message_apply_formatting($message['CONTENT'], true); } if ($limit_text && mb_strlen(strip_tags($message['CONTENT'])) > intval(forum_get_setting('maximum_post_length', null, 6226))) { $cut_msg = mb_substr($message['CONTENT'], 0, intval(forum_get_setting('maximum_post_length', null, 6226))); $cut_msg = preg_replace("/(<[^>]+)?\$/Du", "", $cut_msg); $message['CONTENT'] = fix_html($cut_msg); $message['CONTENT'] .= "…[" . gettext("Message Truncated") . "]\n<p align=\"center\"><a href=\"display.php?webtag={$webtag}&msg={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" target=\"_self\">" . gettext("View full message") . "</a>"; } $message['CONTENT'] = light_spoiler_enable($message['CONTENT']); if (!$is_poll || $is_poll && isset($message['PID']) && $message['PID'] > 1) { $message['CONTENT'] = word_filter_add_ob_tags($message['CONTENT'], false); } if ($is_preview || !isset($message['RELATIONSHIP']) || !($message['RELATIONSHIP'] & USER_IGNORED)) { if ($in_list && $msg_count > 0) { echo "<div class=\"message_links\">\n"; echo "<a href=\"lmessages.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\">{$tid}.{$message['PID']}</a>"; if ($message['REPLY_TO_PID'] > 0) { echo " ", gettext("In reply to"), " "; if (intval($message['REPLY_TO_PID']) >= intval($first_msg)) { echo "<a href=\"#a{$tid}_{$message['REPLY_TO_PID']}\" target=\"_self\">{$tid}.{$message['REPLY_TO_PID']}</a>"; } else { echo "<a href=\"lmessages.php?webtag={$webtag}&msg={$tid}.{$message['REPLY_TO_PID']}\">{$tid}.{$message['REPLY_TO_PID']}</a>"; } } echo "</div>\n"; } else { echo "<div class=\"message_links\"> </div>\n"; } echo "<div class=\"message_body\">\n"; echo $message['CONTENT']; if (!$is_preview && isset($message['EDITED'])) { if ($post_edit_grace_period == 0 || $message['EDITED'] - $message['CREATED'] > $post_edit_grace_period * MINUTE_IN_SECONDS) { if (($edit_user = user_get_logon($message['EDITED_BY'])) !== false) { echo "<div class=\"edit_text\">", sprintf(gettext("EDITED: %s by %s"), format_date_time($message['EDITED']), $edit_user), "</div>\n"; } } } if (!$is_preview && isset($message['APPROVED']) && isset($message['APPROVED_BY'])) { if ($message['APPROVED_BY'] != $message['FROM_UID'] && ($approved_user = user_get_logon($message['APPROVED_BY'])) !== false) { echo "<div class=\"edit_text\">", sprintf(gettext("APPROVED: %s by %s"), format_date_time($message['APPROVED']), $approved_user), "</div>\n"; } } echo "</div>\n"; if (isset($message['ATTACHMENTS']) && sizeof($message['ATTACHMENTS']) > 0) { if (($attachments_array = attachments_get($message['FROM_UID'], $message['ATTACHMENTS'])) !== false) { echo "<div class=\"message_attachments\">\n"; echo " <span>", gettext("Attachments"), ":</span>\n"; echo " <ul>\n"; foreach ($attachments_array as $attachment) { if (($attachment_link = light_attachments_make_link($attachment)) !== false) { echo "<li>", html_style_image('attach'), $attachment_link, "</li>\n"; } } echo " </ul>\n"; echo "</div>\n"; } } if (!$is_preview && $msg_count > 0) { $links_array = array(); if (!$closed && session::check_perm(USER_PERM_POST_CREATE, $folder_fid)) { $links_array[] = "<a href=\"lpost.php?webtag={$webtag}&reply_to={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" class=\"reply\">" . html_style_image('post') . gettext("Reply") . "</a>"; } if ($_SESSION['UID'] == $message['FROM_UID'] && session::check_perm(USER_PERM_POST_DELETE, $folder_fid) && !session::check_perm(USER_PERM_PILLORIED, 0) || $perm_is_moderator) { $links_array[] = "<a href=\"ldelete.php?webtag={$webtag}&msg={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" class=\"delete\">" . html_style_image('delete') . gettext("Delete") . "</a>"; } if (!session::check_perm(USER_PERM_PILLORIED, 0) && ($_SESSION['UID'] != $message['FROM_UID'] && $from_user_permissions & USER_PERM_PILLORIED || $_SESSION['UID'] == $message['FROM_UID']) && session::check_perm(USER_PERM_POST_EDIT, $folder_fid) && ($post_edit_time == 0 || time() - $message['CREATED'] < $post_edit_time * HOUR_IN_SECONDS) && forum_get_setting('allow_post_editing', 'Y') || $perm_is_moderator) { if (!$is_poll || $is_poll && isset($message['PID']) && $message['PID'] > 1) { $links_array[] = "<a href=\"ledit.php?webtag={$webtag}&msg={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" class=\"edit\">" . html_style_image('edit') . gettext("Edit") . "</a>"; } } if (sizeof($links_array) > 0) { echo "<div class=\"message_footer\">\n"; echo " <div class=\"message_footer_links\">", implode(' ', $links_array), "</div>\n"; echo " <div class=\"message_vote_form\" data-msg=\"{$tid}.{$message['PID']}\">\n"; echo " ", light_message_get_vote_form_html($message), "\n"; echo " </div>\n"; echo "</div>\n"; } } else { echo "<div class=\"message_footer_links\"></div>\n"; } } echo "</div>"; }
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { html_display_error_array($error_msg_array, '600', 'left'); } else { if ($peer_perms & USER_PERM_FOLDER_MODERATE && !session::check_perm(USER_PERM_CAN_IGNORE_ADMIN, 0)) { html_display_warning_msg(gettext("You cannot ignore this user, as they are a moderator."), '600', 'left'); } } if (isset($_POST['preview_signature'])) { if (($t_sig_content = user_get_sig($peer_uid)) !== false) { $preview_message['RECIPIENTS'] = array(); $preview_from_user = user_get($peer_uid); $preview_message['FROM_LOGON'] = $preview_from_user['LOGON']; $preview_message['FROM_NICKNAME'] = $preview_from_user['NICKNAME']; $preview_message['FROM_UID'] = $preview_from_user['UID']; $preview_message['CONTENT'] = gettext("Signature Preview"); $preview_message['CONTENT'] .= "<div class=\"sig\">" . fix_html($t_sig_content) . "</div>"; $preview_message['CREATED'] = time(); echo " <br />\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Preview"), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n";
custom_new_ticket_ext1_check($ext1); } if (!$isoper && defined("IRC_MODE")) { /* Don't let users open another ticket if they already have a pending one on the same team but let opers bypass it! */ $query = squery("SELECT id,unick,open_time,rep_g FROM karnaf_tickets WHERE status!=0 AND rep_g='%s' AND ((unick='%s' AND unick!='Guest') OR uemail='%s' OR (opened_by='%s' AND opened_by!='Guest'))", $rep_g, $unick, $uemail, $unick); if ($result = sql_fetch_array($query)) { $error = "You already have an open ticket (#" . $result['id'] . ") for " . $rep_g . ".<br>"; $error .= "Please do not open more than one ticket about the same issue.<br>"; $error .= "If you need to send a reply or give more information please view your current ticket stauts and post a reply there."; } sql_free_result($query); } if (isset($error)) { echo "Error!<br><br>" . $error; } else { squery("INSERT INTO karnaf_tickets(randcode,status,title,description,cat3_id,unick,ufullname,uemail,uphone,uip,upriority,priority,open_time,opened_by,rep_u,rep_g,is_real,is_private,email_upd,memo_upd) VALUES('%s',%d,'%s','%s','%d','%s','%s','%s','%s','%s',%d,%d,%d,'%s','%s','%s',%d,%d,%d,%d)", $randstr, 1, $title, $description, $cat3_id, $unick, fix_html($_POST['uname']), $uemail, $uphone, $uip, $upriority, $priority, time(), $nick, $rep_u, $rep_g, $is_real, $is_private, $email_upd, $memo_upd); $id = sql_insert_id(); if (isset($ext1)) { squery("UPDATE karnaf_tickets SET ext1='%s' WHERE id=%d", $ext1, $id); } if (isset($_POST['ext2']) && !empty($_POST['ext2'])) { squery("UPDATE karnaf_tickets SET ext2='%s' WHERE id=%d", $_POST['ext2'], $id); } if (isset($_POST['ext3']) && !empty($_POST['ext3'])) { squery("UPDATE karnaf_tickets SET ext3='%s' WHERE id=%d", $_POST['ext3'], $id); } ?> Your ticket has been opened. <br> Ticket ID: <?php echo $id;
if (!session::logged_in()) { html_guest_error(); } // Check we have Admin / Moderator access if (!session::check_perm(USER_PERM_ADMIN_TOOLS, 0)) { html_draw_error(gettext("You do not have permission to use this section.")); } // Perform additional admin login. admin_check_credentials(); // Get the user's post page preferences. $page_prefs = session::get_post_page_prefs(); // Array to hold error messages $error_msg_array = array(); // Check to see if we're submitting new page or retrieving the old one. if (isset($_POST['t_content']) && strlen(trim($_POST['t_content'])) > 0) { $t_content = fix_html(emoticons_strip($_POST['t_content']), true); } else { $t_content = forum_get_setting('start_page', 'strlen', ''); } // Submit code. if (isset($_POST['save'])) { // New array of forum settings. $new_forum_settings = array('start_page' => $t_content); // Save the settings. if (forum_save_settings($new_forum_settings)) { // Update the admin log. admin_add_log_entry(EDITED_START_PAGE); // Redirect back to self. header_redirect("admin_startpage.php?webtag={$webtag}&updated=true"); exit; }
} if (!session::check_perm(USER_PERM_POST_CREATE, $t_fid)) { html_draw_error(gettext("You cannot reply to posts in this folder")); } if (isset($_GET['quote_list']) && strlen(trim($_GET['quote_list'])) > 0) { $quote_list = array_filter(explode(',', $_GET['quote_list']), 'is_numeric'); sort($quote_list); $t_content_array = array(); foreach ($quote_list as $quote_pid) { if ($message_array = messages_get($reply_to_tid, $quote_pid)) { $message_author = htmlentities_array(format_user_name($message_array['FLOGON'], $message_array['FNICK'])); $message_content = message_get_content($reply_to_tid, $quote_pid); $message_content = message_apply_formatting($message_content, true); $message_link = "messages.php?webtag={$webtag}&msg={$reply_to_tid}.{$quote_pid}"; $t_content_array[] = sprintf('<div class="quotetext"><b>%s:</b> <a href="%s">%s</a></div> <div class="quote">%s</div>', gettext('quote'), $message_link, $message_author, fix_html($message_content)); } } if (sizeof($t_content_array) > 0) { $t_content = implode('', $t_content_array); } } $new_thread = false; } else { if (isset($_POST['t_tid']) && isset($_POST['t_rpid'])) { $reply_to_tid = is_numeric($_POST['t_tid']) ? $_POST['t_tid'] : 0; $reply_to_pid = is_numeric($_POST['t_rpid']) ? $_POST['t_rpid'] : 0; if (!($t_fid = thread_get_folder($reply_to_tid, $reply_to_pid))) { html_draw_error(gettext("The requested thread could not be found or access was denied.")); } if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) {
$new_forum_settings['require_unique_email'] = "Y"; } else { $new_forum_settings['require_unique_email'] = "N"; } if (isset($_POST['require_email_confirmation']) && $_POST['require_email_confirmation'] == "Y") { $new_forum_settings['require_email_confirmation'] = "Y"; } else { $new_forum_settings['require_email_confirmation'] = "N"; } if (isset($_POST['forum_rules_enabled']) && $_POST['forum_rules_enabled'] == "Y") { $new_forum_settings['forum_rules_enabled'] = "Y"; } else { $new_forum_settings['forum_rules_enabled'] = "N"; } if (isset($_POST['forum_rules_message']) && strlen(trim($_POST['forum_rules_message'])) > 0) { $new_forum_settings['forum_rules_message'] = fix_html(emoticons_strip($_POST['forum_rules_message'])); } else { $new_forum_settings['forum_rules_message'] = ""; } if (isset($_POST['enable_google_analytics']) && $_POST['enable_google_analytics'] == "Y") { $new_forum_settings['enable_google_analytics'] = "Y"; } else { $new_forum_settings['enable_google_analytics'] = "N"; } if (isset($_POST['allow_forum_google_analytics']) && $_POST['allow_forum_google_analytics'] == "Y") { $new_forum_settings['allow_forum_google_analytics'] = "Y"; } else { $new_forum_settings['allow_forum_google_analytics'] = "N"; } if (isset($_POST['google_analytics_code']) && strlen(trim($_POST['google_analytics_code'])) > 0) { $new_forum_settings['google_analytics_code'] = trim($_POST['google_analytics_code']);
function html_draw_bottom($frame_set_html = false) { if (!is_bool($frame_set_html)) { $frame_set_html = false; } if ($frame_set_html === false) { if ($page_footer = html_get_page_footer()) { echo fix_html($page_footer); } if (adsense_publisher_id() && adsense_check_user() && adsense_check_page_bottom()) { echo '<br>'; adsense_output_html(); } if ($google_analytics_code = html_get_google_analytics_code()) { echo "<script type=\"text/javascript\">\n\n"; echo " var _gaq = _gaq || [];\n"; echo " _gaq.push(['_setAccount', '{$google_analytics_code}']);\n"; echo " _gaq.push(['_trackPageview']);\n\n"; echo " (function() {\n"; echo " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n"; echo " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n"; echo " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n"; echo " })();\n\n"; echo "</script>\n"; } echo "</body>\n"; } echo "</html>\n"; }
public function __construct($message) { $this->original = $message; $message_parts = preg_split('/(<[^<>]+>)/u', $message, -1, PREG_SPLIT_DELIM_CAPTURE); $signature_parts = array(); if (($signature_offset = array_search("<div class=\"sig\">", $message_parts)) !== false) { while (sizeof($message_parts) > 0) { $signature_parts = array_merge($signature_parts, array_splice($message_parts, $signature_offset, 1)); if (count(explode('<div', implode('', $signature_parts))) == count(explode('</div>', implode('', $signature_parts)))) { break; } } } $signature = preg_replace('/^<div class="sig">(.*)<\\/div>$/Dsu', '$1', implode('', $signature_parts)); $message = implode('', $message_parts); $this->message = fix_html($message); $this->sig = fix_html($signature); }
if (($message = messages_get($search_result['TID'], $search_result['PID'], 1)) !== false) { if (($thread_data = thread_get($search_result['TID'])) !== false) { $message['TITLE'] = trim($thread_data['TITLE']); // Fetch the messaage content, strip the signature and remove HTML. $message['CONTENT'] = message_get_content($search_result['TID'], $search_result['PID']); $message['CONTENT'] = message_apply_formatting($message['CONTENT'], true); $message['CONTENT'] = trim(strip_tags($message['CONTENT'])); // Limit thread title to 20 characters. if (mb_strlen($message['TITLE']) > 20) { $message['TITLE'] = word_filter_add_ob_tags(mb_substr($message['TITLE'], 0, 20), true) . "…"; } else { $message['TITLE'] = word_filter_add_ob_tags($message['TITLE'], true); } // Limit displayed post content to 35 characters if (mb_strlen($message['CONTENT']) > 70) { $message['CONTENT'] = word_filter_add_ob_tags(fix_html(mb_substr($message['CONTENT'], 0, 70)), true) . "…"; } else { $message['CONTENT'] = word_filter_add_ob_tags($message['CONTENT'], true); } if (thread_is_poll($search_result['TID']) && $search_result['PID'] == 1 || strlen($message['CONTENT']) < 1) { echo " <li><p><a href=\"messages.php?webtag={$webtag}&msg={$search_result['TID']}.{$search_result['PID']}&hightlight=yes\" target=\"", html_get_frame_name('right'), "\"><b>{$message['TITLE']}</b></a><br />"; echo "<span><b>", gettext("From"), ":</b> ", word_filter_add_ob_tags(format_user_name($search_result['FROM_LOGON'], $search_result['FROM_NICKNAME']), true), ", ", format_date_time($search_result['CREATED']), "</span></p></li>\n"; } else { echo " <li><p><a href=\"messages.php?webtag={$webtag}&msg={$search_result['TID']}.{$search_result['PID']}&highlight=yes\" target=\"", html_get_frame_name('right'), "\"><b>{$message['TITLE']}</b></a><br />"; echo "{$message['CONTENT']}<br /><span><b>", gettext("From"), ":</b> ", word_filter_add_ob_tags(format_user_name($search_result['FROM_LOGON'], $search_result['FROM_NICKNAME']), true), ", ", format_date_time($search_result['CREATED']), "</span></p></li>\n"; } } } } echo "</ol>\n"; if (ceil($search_results_array['result_count'] / 20) > $page) {
function api_create_ticket($unick, $uname, $uemail, $title, $description, $uip, $rep_g, $cat3_id = 71, $ext1 = "") { $randstr = RandomNumber(10); $email_upd = 1; $memo_upd = 1; $uphone = ""; $rep_u = ""; $is_real = 0; $is_private = 0; $upriority = 0; $priority = 0; squery("INSERT INTO karnaf_tickets(randcode,status,title,description,cat3_id,unick,ufullname,uemail,uphone,uip,upriority,priority,open_time,opened_by,rep_u,rep_g,is_real,is_private,email_upd,memo_upd) VALUES('%s',%d,'%s','%s','%d','%s','%s','%s','%s','%s',%d,%d,%d,'%s','%s','%s',%d,%d,%d,%d)", $randstr, 1, $title, $description, $cat3_id, $unick, fix_html($uname), $uemail, $uphone, $uip, $upriority, $priority, time(), "(API)", $rep_u, $rep_g, $is_real, $is_private, $email_upd, $memo_upd); $id = sql_insert_id(); if (!empty($ext1)) { squery("UPDATE karnaf_tickets SET ext1='%s' WHERE id=%d", $ext1, $id); } return $id; }
/* Don't let users open another ticket if they already have a pending one on the same team but let opers bypass it! */ $query = squery("SELECT id,unick,open_time,rep_g FROM karnaf_tickets WHERE status!=0 AND rep_g='%s' AND ((unick='%s' AND unick!='Guest') OR uemail='%s' OR (opened_by='%s' AND opened_by!='Guest'))", $rep_g, $unick, $uemail, $unick); if($result = sql_fetch_array($query)) { $error = "You already have an open ticket (#".$result['id'].") for ".$rep_g.".<br>"; $error .= "Please do not open more than one ticket about the same issue.<br>"; $error .= "If you need to send a reply or give more information please view your current ticket stauts and post a reply there."; } sql_free_result($query); } if(isset($error)) { echo "Error!<br><br>".$error; } else { squery("INSERT INTO karnaf_tickets(randcode,status,title,description,cat3_id,unick,ufullname,uemail,uphone,uip,upriority,priority,open_time,opened_by,rep_u,rep_g,is_real,is_private,email_upd,memo_upd) VALUES('%s',%d,'%s','%s','%d','%s','%s','%s','%s','%s',%d,%d,%d,'%s','%s','%s',%d,%d,%d,%d)", $randstr,1,$title,$description,$cat3_id,$unick,fix_html($_POST['uname']),$uemail,$uphone,$uip,$upriority,$priority,time(),$nick,$rep_u, $rep_g,$is_real,$is_private,$email_upd,$memo_upd); $id = sql_insert_id(); if(isset($ext1)) squery("UPDATE karnaf_tickets SET ext1='%s' WHERE id=%d", $ext1, $id); if(isset($_POST['ext2']) && !empty($_POST['ext2'])) squery("UPDATE karnaf_tickets SET ext2='%s' WHERE id=%d", $_POST['ext2'], $id); if(isset($_POST['ext3']) && !empty($_POST['ext3'])) squery("UPDATE karnaf_tickets SET ext3='%s' WHERE id=%d", $_POST['ext3'], $id); ?> Your ticket has been opened. <br> Ticket ID: <?=$id?> <br> Verification Number: <?=$randstr?> <br> Assigned to: <?=$rep_g?> <br> Ticket status: <a href="<?=KARNAF_URL?>/view.php?id=<?=$id?>&code=<?=$randstr?>"><?=KARNAF_URL?>/view.php?id=<?=$id?>&code=<?=$randstr?></a><br>
function rss_feed_check_feeds() { if (($rss_feed = rss_feed_fetch()) !== false) { if (($rss_data = rss_feed_read_database($rss_feed['URL'])) !== false) { $max_item_count = min(10, $rss_feed['MAX_ITEM_COUNT']); foreach ($rss_data as $item_index => $rss_feed_item) { if ($item_index + 1 > $max_item_count) { return; } if (!rss_feed_thread_exist($rss_feed['RSSID'], $rss_feed_item->link)) { $rss_title = htmlentities_decode_array($rss_feed_item->title); $rss_title = htmlentities_array(strip_tags($rss_title)); $rss_feed_name = htmlentities_array($rss_feed['NAME']); $rss_quote_source = "{$rss_feed_name} {$rss_title}"; if (isset($rss_feed['PREFIX']) && strlen(trim($rss_feed['PREFIX'])) > 0) { $rss_feed_prefix = htmlentities_array($rss_feed['PREFIX']); $rss_title = "{$rss_feed_prefix} {$rss_title}"; } if (mb_strlen($rss_title) > 64) { $rss_title = mb_substr($rss_title, 0, 60); if (($pos = mb_strrpos($rss_title, ' ')) !== false) { $rss_title = trim(mb_substr($rss_title, 0, $pos)); } $rss_title .= "..."; } if (strlen($rss_feed_item->description) > 1) { $rss_feed_item_description = htmlentities_decode_array($rss_feed_item->description); $rss_content = fix_html(sprintf('<div class="quotetext"><b>%s:</b> <a href="%s">%s</a></div> <div class="quote">%s</div>', gettext('quote'), $rss_feed_item->link, $rss_quote_source, $rss_feed_item_description)); } else { $rss_content = fix_html(sprintf('<p>%s</p><a href=\\"%s\\" target=\\"_blank\\">%s</a>', $rss_quote_source, $rss_feed_item->link, gettext("Click here to read this article"))); } $tid = post_create_thread($rss_feed['FID'], $rss_feed['UID'], $rss_title); post_create($rss_feed['FID'], $tid, 0, $rss_feed['UID'], array(), $rss_content); rss_feed_create_history($rss_feed['RSSID'], $rss_feed_item->link); } } } } }
function light_message_display($tid, $message, $msg_count, $first_msg, $folder_fid, $in_list = true, $closed = false, $limit_text = true, $is_poll = false, $is_preview = false) { $perm_is_moderator = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_fid); $post_edit_time = forum_get_setting('post_edit_time', null, 0); $post_edit_grace_period = forum_get_setting('post_edit_grace_period', null, 0); $webtag = get_webtag(); $attachments_array = array(); $image_attachments_array = array(); if (($uid = session::get_value('UID')) === false) { return; } if ((!isset($message['CONTENT']) || $message['CONTENT'] == "") && !$is_preview) { light_message_display_deleted($tid, isset($message['PID']) ? $message['PID'] : 0); return; } $from_user_permissions = perm_get_user_permissions($message['FROM_UID']); if ($uid != $message['FROM_UID']) { if ($from_user_permissions & USER_PERM_WORMED && !$perm_is_moderator) { light_message_display_deleted($tid, $message['PID']); return; } } if (!isset($message['FROM_RELATIONSHIP'])) { $message['FROM_RELATIONSHIP'] = 0; } if (!isset($message['TO_RELATIONSHIP'])) { $message['TO_RELATIONSHIP'] = 0; } if ($message['TO_RELATIONSHIP'] & USER_IGNORED_COMPLETELY || $message['FROM_RELATIONSHIP'] & USER_IGNORED_COMPLETELY) { light_message_display_deleted($tid, $message['PID']); return; } if (forum_get_setting('require_post_approval', 'Y') && $message['FROM_UID'] != $uid) { if (isset($message['APPROVED']) && $message['APPROVED'] == 0 && !$perm_is_moderator) { light_message_display_approval_req($tid, $message['PID']); return; } } // OUTPUT MESSAGE ---------------------------------------------------------- if (!$is_preview && $message['MOVED_TID'] > 0 && $message['MOVED_PID'] > 0) { $post_link = "<a href=\"messages.php?webtag={$webtag}&msg=%s.%s\" target=\"_self\">%s</a>"; $post_link = sprintf($post_link, $message['MOVED_TID'], $message['MOVED_PID'], gettext("here")); light_html_display_warning_msg(gettext("<b>Thread Split:</b> This post has been moved %s"), $post_link); return; } if ($in_list) { echo "<a name=\"a{$tid}_{$message['PID']}\"></a>"; } echo "<div class=\"message\">\n"; if (session::get_value('IMAGES_TO_LINKS') == 'Y') { $message['CONTENT'] = preg_replace('/<a([^>]*)href="([^"]*)"([^\\>]*)><img[^>]*src="([^"]*)"[^>]*><\\/a>/iu', '[img: <a\\1href="\\2"\\3>\\4</a>]', $message['CONTENT']); $message['CONTENT'] = preg_replace('/<img[^>]*src="([^"]*)"[^>]*>/iu', '[img: <a href="\\1">\\1</a>]', $message['CONTENT']); $message['CONTENT'] = preg_replace('/<embed[^>]*src="([^"]*)"[^>]*>/iu', '[object: <a href="\\1">\\1</a>]', $message['CONTENT']); } if (mb_strlen(strip_tags($message['CONTENT'])) > intval(forum_get_setting('maximum_post_length', null, 6226)) && $limit_text) { $cut_msg = mb_substr($message['CONTENT'], 0, intval(forum_get_setting('maximum_post_length', null, 6226))); $cut_msg = preg_replace("/(<[^>]+)?\$/Du", "", $cut_msg); $message['CONTENT'] = fix_html($cut_msg); $message['CONTENT'] .= "…[" . gettext("Message Truncated") . "]\n"; $message['CONTENT'] .= "<a href=\"ldisplay.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" class=\"message_full_view\">" . gettext("View full message") . ".</a>"; } echo "<div class=\"message_header\">\n"; echo "<div class=\"message_from\">\n"; echo "", gettext("From"), ": ", word_filter_add_ob_tags(format_user_name($message['FLOGON'], $message['FNICK']), true); if ($message['FROM_RELATIONSHIP'] & USER_FRIEND) { echo "<span class=\"user_friend\" title=\"", gettext("Friend"), "\">[F]</span>"; } else { if ($message['FROM_RELATIONSHIP'] & USER_IGNORED) { echo "<span class=\"user_enemy\" title=\"", gettext("Ignored user"), "\">[E]</span>"; } } // If the user posting a poll is ignored, remove ignored status for this message only so the poll can be seen if ($is_poll && $message['PID'] == 1 && $message['FROM_RELATIONSHIP'] & USER_IGNORED) { $message['FROM_RELATIONSHIP'] -= USER_IGNORED; } if ($message['FROM_RELATIONSHIP'] & USER_IGNORED && $limit_text) { echo gettext("Ignored message"); } else { if ($in_list) { if ($from_user_permissions & USER_PERM_WORMED) { echo gettext("Wormed user"); } echo "<span class=\"message_time\">", format_time($message['CREATED']), "</span>\n"; } } echo "<div class=\"clearer\"></div>\n"; echo "</div>"; echo "<div class=\"message_to\">\n"; if ($message['TLOGON'] != gettext("ALL") && $message['TO_UID'] != 0) { echo "", gettext("To"), ": ", word_filter_add_ob_tags(format_user_name($message['TLOGON'], $message['TNICK']), true); if ($message['TO_RELATIONSHIP'] & USER_FRIEND) { echo "<span class=\"user_friend\" title=\"", gettext("Friend"), "\">[F]</span>"; } else { if ($message['TO_RELATIONSHIP'] & USER_IGNORED) { echo "<span class=\"user_enemy\" title=\"", gettext("Ignored user"), "\">[E]</span>"; } } if (!$is_preview) { if (isset($message['VIEWED']) && $message['VIEWED'] > 0) { echo "<span class=\"message_read\">", format_time($message['VIEWED']), "</span>"; } else { echo "<span class=\"message_unread\" title=\"", gettext("Unread"), "\"></span>"; } } } else { echo "", gettext("To"), ": ", gettext("ALL"), ""; } if ($in_list && $msg_count > 0) { echo "<span class=\"message_count\">", sprintf(gettext("%s of %s"), $message['PID'], $msg_count), "</span>"; } echo "<div class=\"clearer\"></div>\n"; echo "</div>\n"; echo "</div>\n"; echo "<div class=\"message_links\">\n"; if ($in_list && $msg_count > 0) { echo "<a href=\"lmessages.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\">{$tid}.{$message['PID']}</a>"; if ($message['REPLY_TO_PID'] > 0) { echo " ", gettext("In reply to"), " "; if (intval($message['REPLY_TO_PID']) >= intval($first_msg)) { echo "<a href=\"#a{$tid}_{$message['REPLY_TO_PID']}\" target=\"_self\">{$tid}.{$message['REPLY_TO_PID']}</a>"; } else { echo "<a href=\"lmessages.php?webtag={$webtag}&msg={$tid}.{$message['REPLY_TO_PID']}\">{$tid}.{$message['REPLY_TO_PID']}</a>"; } } } echo "</div>\n"; if (!$is_poll || $is_poll && isset($message['PID']) && $message['PID'] > 1) { $message['CONTENT'] = message_apply_formatting($message['CONTENT'], true); } $message['CONTENT'] = light_spoiler_enable($message['CONTENT']); if ($is_poll !== true) { $message['CONTENT'] = word_filter_add_ob_tags($message['CONTENT']); } echo "<div class=\"message_body\">\n"; echo $message['CONTENT']; if (isset($message['EDITED']) && $message['EDITED'] > 0) { if ($post_edit_grace_period == 0 || $message['EDITED'] - $message['CREATED'] > $post_edit_grace_period * MINUTE_IN_SECONDS) { if ($edit_user = user_get_logon($message['EDITED_BY'])) { echo "<div class=\"edit_text\">", sprintf(gettext("EDITED: %s by %s"), format_time($message['EDITED']), $edit_user), "</div>\n"; } } } echo "</div>\n"; if ($tid != 0 && isset($message['PID']) || isset($message['AID'])) { $aid = isset($message['AID']) ? $message['AID'] : attachments_get_id($tid, $message['PID']); if (attachments_get($message['FROM_UID'], $aid, $attachments_array, $image_attachments_array)) { if (sizeof($attachments_array) > 0) { echo "<div class=\"message_attachments\">\n"; echo " <span>", gettext("Attachments"), ":</span>\n"; echo " <ul>\n"; foreach ($attachments_array as $attachment) { if ($attachment_link = light_attachments_make_link($attachment)) { echo "<li>", $attachment_link, "</li>\n"; } } echo " </ul>\n"; echo "</div>\n"; } if (sizeof($image_attachments_array) > 0) { echo "<div class=\"message_attachments\">\n"; echo " <span>", gettext("Image Attachments"), ":</span>\n"; echo " <ul>\n"; foreach ($image_attachments_array as $attachment) { if ($attachment_link = light_attachments_make_link($attachment)) { echo "<li>", $attachment_link, "</li>\n"; } } echo " </ul>\n"; echo "</div>\n"; } } } if (!$is_preview && $msg_count > 0) { $links_array = array(); if (!$closed && session::check_perm(USER_PERM_POST_CREATE, $folder_fid)) { $links_array[] = "<a href=\"lpost.php?webtag={$webtag}&replyto={$tid}.{$message['PID']}\" class=\"reply\">" . gettext("Reply") . "</a>"; } if ($uid == $message['FROM_UID'] && session::check_perm(USER_PERM_POST_DELETE, $folder_fid) && !session::check_perm(USER_PERM_PILLORIED, 0) || $perm_is_moderator) { $links_array[] = "<a href=\"ldelete.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" class=\"delete\">" . gettext("Delete") . "</a>"; } if (!session::check_perm(USER_PERM_PILLORIED, 0) && ($uid != $message['FROM_UID'] && $from_user_permissions & USER_PERM_PILLORIED || $uid == $message['FROM_UID']) && session::check_perm(USER_PERM_POST_EDIT, $folder_fid) && ($post_edit_time == 0 || time() - $message['CREATED'] < $post_edit_time * HOUR_IN_SECONDS) && forum_get_setting('allow_post_editing', 'Y') || $perm_is_moderator) { if (!$is_poll || $is_poll && isset($message['PID']) && $message['PID'] > 1) { $links_array[] = "<a href=\"ledit.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" class=\"edit\">" . gettext("Edit") . "</a>"; } } if (sizeof($links_array) > 0) { echo "<div class=\"message_footer_links\">", implode(' ', $links_array), "</div>\n"; } } else { echo "<div class=\"message_footer_links\"></div>\n"; } echo "</div>"; }
function message_display($tid, $message, $msg_count, $first_msg, $folder_fid, $in_list = true, $closed = false, $limit_text = true, $is_poll = false, $show_sigs = true, $is_preview = false, $highlight_array = array()) { $perm_is_moderator = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_fid); $post_edit_time = forum_get_setting('post_edit_time', null, 0); $post_edit_grace_period = forum_get_setting('post_edit_grace_period', null, 0); $webtag = get_webtag(); if (($uid = session::get_value('UID')) === false) { return; } if ($posts_per_page = session::get_value('POSTS_PER_PAGE')) { if ($posts_per_page < 10) { $posts_per_page = 10; } if ($posts_per_page > 30) { $posts_per_page = 30; } } else { $posts_per_page = 20; } if (($quick_reply = session::get_value('REPLY_QUICK')) === false) { $quick_reply = 'N'; } if ((!isset($message['CONTENT']) || $message['CONTENT'] == "") && !$is_preview) { message_display_deleted($tid, isset($message['PID']) ? $message['PID'] : 0, $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page); return; } $from_user_permissions = perm_get_user_permissions($message['FROM_UID']); if ($uid != $message['FROM_UID']) { if ($from_user_permissions & USER_PERM_WORMED && !$perm_is_moderator) { message_display_deleted($tid, $message['PID'], $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page); return; } } if (!isset($message['FROM_RELATIONSHIP'])) { $message['FROM_RELATIONSHIP'] = 0; } if (!isset($message['TO_RELATIONSHIP'])) { $message['TO_RELATIONSHIP'] = 0; } if ($message['TO_RELATIONSHIP'] & USER_IGNORED_COMPLETELY || $message['FROM_RELATIONSHIP'] & USER_IGNORED_COMPLETELY) { message_display_deleted($tid, $message['PID'], $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page); return; } // Add emoticons/WikiLinks and ignore signature ---------------------------- if (session::get_value('IMAGES_TO_LINKS') == 'Y') { $message['CONTENT'] = preg_replace('/<a([^>]*)href="([^"]*)"([^\\>]*)><img[^>]*src="([^"]*)"[^>]*><\\/a>/iu', '[href: <a\\1href="\\2"\\3>\\2</a>][img: <a\\1href="\\4"\\3>\\4</a>]', $message['CONTENT']); $message['CONTENT'] = preg_replace('/<img[^>]*src="([^"]*)"[^>]*>/iu', '[img: <a href="\\1">\\1</a>]', $message['CONTENT']); $message['CONTENT'] = preg_replace('/<embed[^>]*src="([^"]*)"[^>]*>/iu', '[object: <a href="\\1">\\1</a>]', $message['CONTENT']); } if (!$is_poll || $is_poll && isset($message['PID']) && $message['PID'] > 1) { $message['CONTENT'] = message_apply_formatting($message['CONTENT'], $message['FROM_RELATIONSHIP'] & USER_IGNORED_SIG || !$show_sigs); } // Check length of post to see if we should truncate it for display -------- if (mb_strlen(strip_tags($message['CONTENT'])) > intval(forum_get_setting('maximum_post_length', null, 6226)) && $limit_text) { $cut_msg = mb_substr($message['CONTENT'], 0, intval(forum_get_setting('maximum_post_length', null, 6226))); $cut_msg = preg_replace("/(<[^>]+)?\$/Du", "", $cut_msg); $message['CONTENT'] = fix_html($cut_msg); $message['CONTENT'] .= "…[" . gettext("Message Truncated") . "]\n<p align=\"center\"><a href=\"display.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" target=\"_self\">" . gettext("View full message") . "</a>"; } // Check for words that should be filtered --------------------------------- if (!$is_poll || $is_poll && isset($message['PID']) && $message['PID'] > 1) { $message['CONTENT'] = word_filter_add_ob_tags($message['CONTENT'], false); } if ($in_list && isset($message['PID'])) { echo "<a name=\"a{$tid}_{$message['PID']}\"></a>\n"; } // Check for search words to highlight ------------------------------------- if (is_array($highlight_array) && sizeof($highlight_array) > 0) { $highlight_pattern = array(); $highlight_replace = array(); foreach ($highlight_array as $key => $word) { $highlight_word = preg_quote($word, "/"); $highlight_pattern[$key] = "/({$highlight_word})/iu"; $highlight_replace[$key] = "<span class=\"highlight\">\\1</span>"; } $message_parts = preg_split('/([<|>])/u', $message['CONTENT'], -1, PREG_SPLIT_DELIM_CAPTURE); for ($i = 0; $i < sizeof($message_parts); $i++) { if (!($i % 4)) { $message_parts[$i] = preg_replace($highlight_pattern, $highlight_replace, $message_parts[$i], 1); } } $message['CONTENT'] = implode("", $message_parts); } // Little up/down arrows to the left of each message ----------------------- if (forum_get_setting('require_post_approval', 'Y') && $message['FROM_UID'] != $uid) { if (isset($message['APPROVED']) && $message['APPROVED'] == 0 && !$perm_is_moderator) { message_display_approval_req($tid, $message['PID'], $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page); return; } } // OUTPUT MESSAGE ---------------------------------------------------------- if (!$is_preview && $message['MOVED_TID'] > 0 && $message['MOVED_PID'] > 0) { $post_link = "<a href=\"messages.php?webtag={$webtag}&msg=%s.%s\" target=\"_self\">%s</a>"; $post_link = sprintf($post_link, $message['MOVED_TID'], $message['MOVED_PID'], gettext("here")); echo "<div align=\"center\">\n"; echo "<table class=\"thread_track_notice\" width=\"96%\">\n"; echo " <tr>\n"; echo " <td align=\"left\">", sprintf(gettext("<b>Thread Split:</b> This post has been moved %s"), $post_link), "</td>\n"; echo " </tr>\n"; echo "</table>\n"; echo "</div>\n"; echo $in_list ? "<br />\n" : ''; return; } echo "<div align=\"center\">\n"; echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n"; echo " <tr>\n"; if ($in_list && !$is_preview) { message_display_navigation($tid, $message['PID'], $first_msg, $msg_count, $posts_per_page); } echo " <td align=\"center\">\n"; echo " <table width=\"100%\" class=\"box\" cellpadding=\"0\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("From"), ": </span></td>\n"; echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">"; if ($message['FROM_UID'] > -1) { echo "<a href=\"user_profile.php?webtag={$webtag}&uid={$message['FROM_UID']}\" target=\"_blank\" class=\"popup 650x500\">"; echo word_filter_add_ob_tags(format_user_name($message['FLOGON'], $message['FNICK']), true), "</a></span>"; } else { echo word_filter_add_ob_tags(format_user_name($message['FLOGON'], $message['FNICK']), true), "</span>"; } if (session::get_value('SHOW_AVATARS') == 'Y') { if (isset($message['AVATAR_URL']) && strlen($message['AVATAR_URL']) > 0) { echo " <img src=\"{$message['AVATAR_URL']}\" alt=\"\" title=\"", word_filter_add_ob_tags(format_user_name($message['FLOGON'], $message['FNICK']), true), "\" border=\"0\" width=\"16\" height=\"16\" />"; } else { if (isset($message['AVATAR_AID']) && is_md5($message['AVATAR_AID'])) { $attachment = attachments_get_by_hash($message['AVATAR_AID']); if ($profile_picture_href = attachments_make_link($attachment, false, false, false, false)) { echo " <img src=\"{$profile_picture_href}&avatar_picture\" alt=\"\" title=\"", word_filter_add_ob_tags(format_user_name($message['FLOGON'], $message['FNICK']), true), "\" border=\"0\" width=\"16\" height=\"16\" />\n"; } } } } $temp_ignore = false; // If the user posting a poll is ignored, remove ignored status for this message only so the poll can be seen if ($is_poll && isset($message['PID']) && $message['PID'] == 1 && $message['FROM_RELATIONSHIP'] & USER_IGNORED) { $message['FROM_RELATIONSHIP'] -= USER_IGNORED; $temp_ignore = true; } if ($message['FROM_RELATIONSHIP'] & USER_FRIEND) { echo " <img src=\"", html_style_image('friend.png'), "\" alt=\"", gettext("Friend"), "\" title=\"", gettext("Friend"), "\" />"; } else { if ($message['FROM_RELATIONSHIP'] & USER_IGNORED || $temp_ignore) { echo " <img src=\"", html_style_image('enemy.png'), "\" alt=\"", gettext("Ignored user"), "\" title=\"", gettext("Ignored user"), "\" />"; } } echo "</td>\n"; echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"postinfo\">"; if ($message['FROM_RELATIONSHIP'] & USER_IGNORED && $limit_text && $uid != 0) { echo "<b>", gettext("Ignored message"), "</b>"; } else { if ($in_list) { if ($from_user_permissions & USER_PERM_WORMED) { echo "<b>", gettext("Wormed user"), "</b> "; } if ($message['FROM_RELATIONSHIP'] & USER_IGNORED_SIG) { echo "<b>", gettext("Ignored signature"), "</b> "; } if (forum_get_setting('require_post_approval', 'Y') && isset($message['APPROVED']) && $message['APPROVED'] == 0) { echo "<b>", gettext("Approval Required"), "</b> "; } echo format_time($message['CREATED']); } } echo " </span></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"posttofromlabel\"> ", gettext("To"), ": </span></td>\n"; echo " <td style=\"white-space: nowrap\" width=\"98%\" align=\"left\"><span class=\"posttofrom\">"; if ($message['TLOGON'] != gettext("ALL") && $message['TO_UID'] != 0) { echo "<a href=\"user_profile.php?webtag={$webtag}&uid={$message['TO_UID']}\" target=\"_blank\" class=\"popup 650x500\">"; echo word_filter_add_ob_tags(format_user_name($message['TLOGON'], $message['TNICK']), true), "</a></span>"; if ($message['TO_RELATIONSHIP'] & USER_FRIEND) { echo " <img src=\"", html_style_image('friend.png'), "\" alt=\"", gettext("Friend"), "\" title=\"", gettext("Friend"), "\" />"; } else { if ($message['TO_RELATIONSHIP'] & USER_IGNORED) { echo " <img src=\"", html_style_image('enemy.png'), "\" alt=\"", gettext("Ignored user"), "\" title=\"", gettext("Ignored user"), "\" />"; } } if (isset($message['VIEWED']) && $message['VIEWED'] > 0) { echo " <span class=\"smalltext\"><img src=\"", html_style_image('post_read.png'), "\" alt=\"\" title=\"", sprintf(gettext("Read: %s"), format_time($message['VIEWED'])), "\" /></span>"; } else { if ($is_preview == false) { echo " <span class=\"smalltext\"><img src=\"", html_style_image('post_unread.png'), "\" alt=\"\" title=\"", gettext("Unread Message"), "\" /></span>"; } } } else { echo "", gettext("ALL"), "</span>"; } echo "</td>\n"; echo " <td align=\"right\" style=\"white-space: nowrap\"><span class=\"postinfo\">"; if ($message['FROM_RELATIONSHIP'] & USER_IGNORED && $limit_text && $in_list && $uid != 0) { echo "<a href=\"user_rel.php?webtag={$webtag}&uid={$message['FROM_UID']}&msg={$tid}.{$message['PID']}\" target=\"_self\">", gettext("Stop ignoring this user"), "</a> "; echo "<a href=\"display.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" target=\"_self\">", gettext("View Message"), "</a>"; } else { if ($in_list && $msg_count > 0) { if ($is_poll) { echo "<a href=\"poll_results.php?webtag={$webtag}&tid={$tid}\" target=\"_blank\" class=\"popup 800x600\"><img src=\"", html_style_image('poll.png'), "\" border=\"0\" alt=\"", gettext("This is a poll. Click to view results."), "\" title=\"", gettext("This is a poll. Click to view results."), "\" /></a> ", gettext("Poll"), " "; } echo sprintf(gettext("%s of %s"), $message['PID'], $msg_count); } } echo " </span></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; if (!($message['FROM_RELATIONSHIP'] & USER_IGNORED) || !$limit_text) { echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table width=\"100%\">\n"; echo " <tr>\n"; echo " <td colspan=\"3\" align=\"right\"><span class=\"postnumber\">"; if ($in_list && $msg_count > 0) { $title = $message['PID'] == 1 ? "" . gettext("Permanent link to this thread") . " ({$tid}.1)" : "" . gettext("Link to this post"); if ($is_preview) { echo "<a href=\"messages.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" target=\"_blank\" title=\"{$title}\">{$tid}.{$message['PID']}</a>"; } else { echo "<a href=\"index.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" target=\"", html_get_top_frame_name(), "\" title=\"{$title}\">{$tid}.{$message['PID']}</a>"; } if ($message['REPLY_TO_PID'] > 0) { $title = "" . gettext("Link to post") . " #{$message['REPLY_TO_PID']}"; echo " ", gettext("In reply to"), " "; if (intval($message['REPLY_TO_PID']) >= intval($first_msg)) { echo "<a href=\"#a{$tid}_{$message['REPLY_TO_PID']}\" target=\"_self\" title=\"{$title}\">"; echo "{$tid}.{$message['REPLY_TO_PID']}</a>"; } else { if ($is_preview) { echo "<a href=\"messages.php?webtag={$webtag}&msg={$tid}.{$message['REPLY_TO_PID']}\" target=\"_blank\" title=\"{$title}\">"; echo "{$tid}.{$message['REPLY_TO_PID']}</a>"; } else { echo "<a href=\"messages.php?webtag={$webtag}&msg={$tid}.{$message['REPLY_TO_PID']}\" target=\"_self\" title=\"{$title}\">"; echo "{$tid}.{$message['REPLY_TO_PID']}</a>"; } } } } echo " </span></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td class=\"postbody postcontent\" align=\"left\">{$message['CONTENT']}</td>\n"; echo " </tr>\n"; if (isset($message['EDITED']) && $message['EDITED'] > 0) { if ($post_edit_grace_period == 0 || $message['EDITED'] - $message['CREATED'] > $post_edit_grace_period * MINUTE_IN_SECONDS) { if ($edit_user = user_get_logon($message['EDITED_BY'])) { echo " <tr>\n"; echo " <td class=\"postbody\" align=\"left\"><p class=\"edit_text\">", sprintf(gettext("EDITED: %s by %s"), format_time($message['EDITED']), $edit_user), "</p></td>\n"; echo " </tr>\n"; } } } if (forum_get_setting('require_post_approval', 'Y') && isset($message['APPROVED']) && $message['APPROVED'] > 0 && $perm_is_moderator) { if (isset($message['APPROVED_BY']) && $message['APPROVED_BY'] > 0 && $message['APPROVED_BY'] != $message['FROM_UID']) { if ($approved_user = user_get_logon($message['APPROVED_BY'])) { echo " <tr>\n"; echo " <td class=\"postbody\" align=\"left\"><p class=\"approved_text\">", sprintf(gettext("APPROVED: %s by %s"), format_time($message['APPROVED']), $approved_user), "</p></td>\n"; echo " </tr>\n"; } } } if ($tid != 0 && isset($message['PID']) || isset($message['AID'])) { $aid = isset($message['AID']) ? $message['AID'] : attachments_get_id($tid, $message['PID']); $attachments_array = array(); $image_attachments_array = array(); if (attachments_get($message['FROM_UID'], $aid, $attachments_array, $image_attachments_array)) { echo " <tr>\n"; echo " <td class=\"postbody\" align=\"left\">\n"; if (is_array($attachments_array) && sizeof($attachments_array) > 0) { echo " <p><b>", gettext("Attachments"), ":</b><br />\n"; foreach ($attachments_array as $attachment) { echo " ", attachments_make_link($attachment), "<br />\n"; } echo " </p>\n"; } if (is_array($image_attachments_array) && sizeof($image_attachments_array) > 0) { echo " <p><b>", gettext("Image Attachments"), ":</b><br />\n"; foreach ($image_attachments_array as $key => $attachment) { echo " ", attachments_make_link($attachment), "\n"; } echo " </p>\n"; } echo " </td>\n"; echo " </tr>\n"; } } echo " </table>\n"; if (!$is_preview) { echo " <table width=\"100%\" class=\"postresponse\" cellspacing=\"1\" cellpadding=\"0\">\n"; echo " <tr>\n"; if (isset($message['ANON_LOGON']) && $message['ANON_LOGON'] > USER_ANON_DISABLED || !isset($message['USER_ACTIVE']) || is_null($message['USER_ACTIVE'])) { echo " <td width=\"25%\" align=\"left\">"; echo " <img src=\"", html_style_image('status_offline.png'), "\" alt=\"\" title=\"", gettext("Inactive / Offline"), "\" />"; echo " </td>\n"; } else { echo " <td width=\"25%\" align=\"left\">"; echo " <img src=\"", html_style_image('status_online.png'), "\" alt=\"\" title=\"", gettext("Online"), "\" />"; echo " </td>\n"; } echo " <td width=\"50%\" style=\"white-space: nowrap\">"; if ($msg_count > 0) { if (!$closed && session::check_perm(USER_PERM_POST_CREATE, $folder_fid) || $perm_is_moderator) { if ($quick_reply == 'Y') { echo "<img src=\"", html_style_image('quickreply.png'), "\" border=\"0\" alt=\"", gettext("Quick Reply"), "\" title=\"", gettext("Quick Reply"), "\" />\n"; echo "<a href=\"Javascript:void(0)\" rel=\"{$tid}.{$message['PID']}\" target=\"_self\" class=\"quick_reply_link\">", gettext("Quick Reply"), "</a>\n"; } else { echo "<img src=\"", html_style_image('post.png'), "\" border=\"0\" alt=\"", gettext("Reply"), "\" title=\"", gettext("Reply"), "\" />"; echo " <a href=\"post.php?webtag={$webtag}&replyto={$tid}.{$message['PID']}\" target=\"_parent\" id=\"reply_{$message['PID']}\">", gettext("Reply"), "</a>"; } echo " <img src=\"", html_style_image('quote_disabled.png'), "\" border=\"0\" alt=\"", gettext("Quote"), "\" title=\"", gettext("Quote"), "\" id=\"quote_img_{$message['PID']}\" />"; echo " <a href=\"post.php?webtag={$webtag}&replyto={$tid}.{$message['PID']}&quote_list={$message['PID']}\" target=\"_parent\" title=\"", gettext("Quote"), "\" id=\"quote_{$message['PID']}\" rel=\"{$message['PID']}\">", gettext("Quote"), "</a>"; if (!session::check_perm(USER_PERM_PILLORIED, 0) && ($uid != $message['FROM_UID'] && $from_user_permissions & USER_PERM_PILLORIED || $uid == $message['FROM_UID']) && session::check_perm(USER_PERM_POST_EDIT, $folder_fid) && ($post_edit_time == 0 || time() - $message['CREATED'] < $post_edit_time * HOUR_IN_SECONDS) && forum_get_setting('allow_post_editing', 'Y') || $perm_is_moderator) { if ($is_poll && $message['PID'] == 1) { if (!poll_is_closed($tid) || $perm_is_moderator) { echo " <img src=\"", html_style_image('edit.png'), "\" border=\"0\" alt=\"", gettext("Edit Poll"), "\" title=\"", gettext("Edit Poll"), "\" />"; echo " <a href=\"edit_poll.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" target=\"_parent\">", gettext("Edit Poll"), "</a>\n"; } } else { echo " <img src=\"", html_style_image('edit.png'), "\" border=\"0\" alt=\"", gettext("Edit"), "\" title=\"", gettext("Edit"), "\" />"; echo " <a href=\"edit.php?webtag={$webtag}&msg={$tid}.{$message['PID']}\" target=\"_parent\">", gettext("Edit"), "</a>"; } } } } else { echo " "; } echo "</td>\n"; echo " <td width=\"25%\" align=\"right\" style=\"white-space: nowrap\">\n"; echo " <span class=\"post_options\" id=\"post_options_{$tid}.{$message['PID']}\"></span>\n"; echo " </td>\n"; echo " </tr>"; echo " </table>\n"; } else { echo " <table width=\"100%\" class=\"postresponse\" cellspacing=\"1\" cellpadding=\"0\">\n"; echo " <tr>\n"; echo " <td> </td>\n"; echo " </tr>\n"; echo " </table>\n"; } } echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; if ($in_list && !$is_preview) { message_display_navigation($tid, $message['PID'], $first_msg, $msg_count, $posts_per_page); } echo " </tr>\n"; echo " </table>\n"; if ($in_list && isset($message['PID'])) { echo " <div id=\"quick_reply_{$message['PID']}\"></div>\n"; } echo "</div>\n"; echo $in_list ? "<br />\n" : ''; }
} if (isset($_POST['access_level']) && is_numeric($_POST['access_level'])) { forum_update_access($forum_settings['fid'], $_POST['access_level']); } if (isset($_POST['closed_message']) && strlen(trim($_POST['closed_message'])) > 0) { $new_forum_settings['closed_message'] = fix_html(emoticons_strip($_POST['closed_message']), true); } else { $new_forum_settings['closed_message'] = ""; } if (isset($_POST['restricted_message']) && strlen(trim($_POST['restricted_message'])) > 0) { $new_forum_settings['restricted_message'] = fix_html(emoticons_strip($_POST['restricted_message']), true); } else { $new_forum_settings['restricted_message'] = ""; } if (isset($_POST['password_protected_message']) && strlen(trim($_POST['password_protected_message'])) > 0) { $new_forum_settings['password_protected_message'] = fix_html(emoticons_strip($_POST['password_protected_message']), true); } else { $new_forum_settings['password_protected_message'] = ""; } if (isset($_POST['allow_post_editing']) && $_POST['allow_post_editing'] == "Y") { $new_forum_settings['allow_post_editing'] = "Y"; } else { $new_forum_settings['allow_post_editing'] = "N"; } if (isset($_POST['post_edit_time']) && is_numeric($_POST['post_edit_time'])) { $new_forum_settings['post_edit_time'] = $_POST['post_edit_time']; } else { $new_forum_settings['post_edit_time'] = 0; } if (isset($_POST['post_edit_grace_period']) && is_numeric($_POST['post_edit_grace_period'])) { $new_forum_settings['post_edit_grace_period'] = $_POST['post_edit_grace_period'];
echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Forum Rules"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td>", gettext("In order to proceed, you must agree with the following rules"), ":</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>\n"; echo " <div class=\"forum_rules_box\">", fix_html($forum_rules), "</div>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>", form_checkbox('user_agree_rules', 'Y', gettext("I have read, and agree to abide by the forum rules.")), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n";
<div class="quote">%s</div>', gettext('quote'), $message_author, fix_html($pm_data['CONTENT'])); } } else { html_draw_top(sprintf("title=%s", gettext("Error"))); pm_error_refuse(); html_draw_bottom(); exit; } } else { if (isset($t_forward_mid) && is_numeric($t_forward_mid) && $t_forward_mid > 0) { if ($pm_data = pm_message_get($t_forward_mid)) { $pm_data['CONTENT'] = pm_get_content($t_forward_mid); $t_subject = preg_replace('/^(FWD:)?/iu', 'FWD:', $pm_data['SUBJECT']); $message_author = htmlentities_array(format_user_name($pm_data['FLOGON'], $pm_data['FNICK'])); $t_content = sprintf('<div class="quotetext"><b>%s:</b> %s</div> <div class="quote">%s</div>', gettext('quote'), $message_author, fix_html($pm_data['CONTENT'])); } else { html_draw_top(sprintf("title=%s", gettext("Error"))); pm_error_refuse(); html_draw_bottom(); exit; } } else { if (isset($t_edit_mid) && is_numeric($t_edit_mid) && $t_edit_mid > 0) { if ($pm_data = pm_message_get($t_edit_mid)) { $pm_data['CONTENT'] = pm_get_content($t_edit_mid); $t_subject = $pm_data['SUBJECT']; $parsed_message = new MessageTextParse($pm_data['CONTENT']); $t_content = $parsed_message->getMessage(); $t_subject = $pm_data['SUBJECT']; $t_to_uid = $pm_data['TO_UID'];
echo " <div class=\"register_confirmation\">", sprintf(gettext("To prevent automated registrations this forum requires you enter a confirmation code. The code is displayed in the image below. If you are visually impaired or cannot otherwise read the code please contact the %s."), $forum_owner_link), "</div>\n"; echo " <div class=\"register_confirmation_image\">\n"; echo " ", html_style_image('text_captcha_image', gettext("This is a captcha-picture. It is used to prevent automatic registration"), 'text_captcha_image', array('background-image' => sprintf("url('data:image/jpeg;base64,%s')", base64_encode(file_get_contents($text_captcha_image))), 'width' => "{$text_captcha->get_width()}px", 'height' => "{$text_captcha->get_height()}px")), "\n"; echo " ", html_style_image('text_captcha_reload reload', null, 'text_captcha_reload'), "\n"; echo " </div>\n"; echo " <div class=\"register_confirmation_input\">\n"; echo " ", light_form_input_text("private_key", null, 20, htmlentities_array($text_captcha->get_num_chars())), "\n"; echo " </div>\n"; //echo " <div class=\"clearer\"></div>\n"; //echo "</div>\n"; } } } echo " <div class=\"register_buttons\">\n"; echo " ", light_form_submit('register', gettext("Register")); echo " <a href=\"llogon.php?webtag={$webtag}\" class=\"button\" target=\"_self\"><span>", gettext("Cancel"), "</span></a>\n"; echo " </div>\n"; } else { $forum_name = forum_get_setting('forum_name', 'strlen', 'A Beehive Forum'); if (($forum_rules = forum_get_setting('forum_rules_message', 'strlen', false)) !== false) { $forum_rules = sprintf(gettext("<p><b>Forum Rules</b></p><p>Registration to %1\$s is free! We do insist that you abide by the rules and policies detailed below. If you agree to the terms, please check the 'I agree' checkbox and press the 'Register' button below. If you would like to cancel the registration, click <a href=\"index.php?webtag=%2\$s\">here</a> to return to the forums index.</p><p>Although the administrators and moderators of %1\$s will attempt to keep all objectionable messages off this forum, it is impossible for us to review all messages. All messages express the views of the author, and neither the owners of %1\$s, nor Project Beehive Forum and its affiliates will be held responsible for the content of any message.</p><p>By agreeing to these rules, you warrant that you will not post any messages that are obscene, vulgar, sexually-orientated, hateful, threatening, or otherwise in violation of any laws.</p><p>The owners of %1\$s reserve the right to remove, edit, move or close any thread for any reason.</p>"), $forum_name, $webtag); } echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; echo " <div class=\"register_rules\">", fix_html($forum_rules), "</div>\n"; echo " <div class=\"register_accept\">", light_form_checkbox('user_agree_rules', 'Y', gettext("I have read, and agree to abide by the forum rules.")), "</div>\n"; echo " <div class=\"register_buttons\">", light_form_submit('forum_rules', gettext("Register")), "</div>\n"; } echo "</div>\n"; echo "</div>\n"; echo "</form>\n"; light_html_draw_bottom();
function forum_check_password($forum_fid) { $frame_top_target = html_get_top_frame_name(); if (!($db_forum_check_password = db_connect())) { return false; } $webtag = get_webtag($webtag_search); if (!is_numeric($forum_fid)) { return false; } if ($forum_passhash = forum_get_password($forum_fid)) { forum_get_saved_password($password, $passhash, $sesshash); if ($sesshash == $forum_passhash) { return true; } // If we got this far then the password verification failed or // the user hasn't seen the password dialog before. $lang = load_language_file(); html_draw_top(); echo "<h1>{$lang['passwdprotectedforum']}</h1>\n"; if (isset($_COOKIE["bh_{$webtag}_sesshash"]) && strlen(trim(_stripslashes($_COOKIE["bh_{$webtag}_sesshash"]))) > 0) { bh_setcookie("bh_{$webtag}_sesshash", "", time() - YEAR_IN_SECONDS); html_display_error_msg($lang['usernameorpasswdnotvalid'], '550', 'center'); } echo "<br />\n"; echo "<div align=\"center\">\n"; echo " <form method=\"post\" action=\"forum_password.php\" target=\"", html_get_top_frame_name(), "\">\n"; echo " ", form_input_hidden('webtag', _htmlentities($webtag)), "\n"; echo " ", form_input_hidden('final_uri', _htmlentities(get_request_uri())), "\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"550\">\n"; if ($password_protected_message = forum_get_setting('password_protected_message', false)) { echo " <tr>\n"; echo " <td align=\"left\">", fix_html($password_protected_message), "</td>\n"; echo " </tr>\n"; } else { echo " <tr>\n"; echo " <td align=\"center\">{$lang['passwdprotectedwarning']}</td>\n"; echo " </tr>\n"; } echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"box\" width=\"400\">\n"; echo " <tr>\n"; echo " <td class=\"posthead\" align=\"center\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\" colspan=\"2\">{$lang['enterpasswd']}</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <table class=\"posthead\" width=\"90%\">\n"; echo " <tr>\n"; echo " <td align=\"left\">{$lang['passwd']}:</td>\n"; echo " <td align=\"left\">", form_input_password('forum_password', _htmlentities($password), 40, false, "autocomplete=\"off\""), form_input_hidden("forum_passhash", _htmlentities($passhash)), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\">", form_checkbox('remember_password', 'Y', $lang['rememberpassword'], strlen($password) > 0 && strlen($passhash) > 0), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">", form_submit("submit", $lang['logon']), " ", form_submit("cancel", $lang['cancel']), "</td>\n"; echo " </tr>\n"; if (bh_session_check_perm(USER_PERM_ADMIN_TOOLS, 0) || bh_session_check_perm(USER_PERM_FORUM_TOOLS, 0)) { echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">{$lang['adminforumclosedtip']}</td>\n"; echo " </tr>\n"; } echo " </table>\n"; echo " </form>\n"; echo "</div>\n"; html_draw_bottom(); exit; } return true; }
unset($question['OPTIONS_ARRAY'][$option_id]); } } if ($allow_html == true) { $question['QUESTION'] = fix_html(emoticons_strip($question['QUESTION'])); } else { $question['QUESTION'] = htmlentities_array($question['QUESTION']); } $poll_option_count += sizeof($question['OPTIONS_ARRAY']); if (sizeof($question['OPTIONS_ARRAY']) < 2) { $error_msg_array[] = gettext("You must provide at least 2 options for each question"); $valid = false; } else { foreach ($question['OPTIONS_ARRAY'] as $option_id => $option) { if ($allow_html == true) { $poll_questions_array[$question_id]['OPTIONS_ARRAY'][$option_id]['OPTION_NAME'] = fix_html($option['OPTION_NAME']); } else { $poll_questions_array[$question_id]['OPTIONS_ARRAY'][$option_id]['OPTION_NAME'] = htmlentities_array($option['OPTION_NAME']); } if (attachments_embed_check($option['OPTION_NAME']) && $allow_html == true) { $error_msg_array[] = gettext("You are not allowed to embed attachments in your posts."); $valid = false; } } } } } } } if (sizeof($poll_questions_array) < 1) { $poll_questions_array = poll_get_default_questions_array();
$aid = md5(uniqid(mt_rand())); } post_save_attachment_id($tid, $pid, $aid); if (isset($_POST['apply']) || isset($_POST['preview'])) { if (isset($_POST['t_content']) && strlen(trim($_POST['t_content'])) > 0) { $t_content = fix_html(emoticons_strip($_POST['t_content'])); if (attachments_embed_check($t_content)) { $error_msg_array[] = gettext("You are not allowed to embed attachments in your posts."); $valid = false; } } else { $error_msg_array[] = gettext("You must enter some content for the post!"); $valid = false; } if (isset($_POST['t_sig'])) { $t_sig = fix_html(emoticons_strip($_POST['t_sig'])); if (attachments_embed_check($t_sig)) { $error_msg_array[] = gettext("You are not allowed to embed attachments in your signature."); $valid = false; } } } if (!isset($t_content)) { $t_content = ""; } if (!isset($t_sig)) { $t_sig = ""; } if ($allow_html == false) { $t_content = htmlentities_array($t_content); $t_sig = htmlentities_array($t_sig);
} } if (pm_edit_message($mid, $t_subject, $t_content)) { header_redirect("lpm.php?webtag={$webtag}&mid={$mid}"); exit; } else { $error_msg_array[] = gettext("Error creating PM! Please try again in a few minutes"); $valid = false; } } else { if (isset($_POST['emots_toggle'])) { if (isset($_POST['t_subject']) && strlen(trim($_POST['t_subject'])) > 0) { $t_subject = trim($_POST['t_subject']); } if (isset($_POST['t_content']) && strlen(trim($_POST['t_content'])) > 0) { $t_content = nl2br(fix_html(emoticons_strip($_POST['t_content']))); } 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();
$sig_text = ""; } if (isset($_POST['sig_global']) && $_POST['sig_global'] == 'Y') { $t_sig_global = 'Y'; } else { $t_sig_global = 'N'; } if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0) && $admin_edit === true) { $t_sig_global = 'N'; } if (attachments_embed_check($sig_text)) { $error_msg_array[] = gettext("You are not allowed to embed attachments in your signature."); $valid = false; } } $sig_text = fix_html(emoticons_strip($sig_text)); if (isset($_POST['save'])) { if ($valid) { // Update USER_SIG if (user_update_sig($sig_uid, $sig_text, $t_sig_global == 'Y')) { if ($admin_edit === true) { $redirect_uri = "admin_user.php?webtag={$webtag}&signature_updated=true&uid={$sig_uid}"; header_redirect($redirect_uri); } else { if ($t_sig_global == 'Y' && forums_get_available_count() > 1) { header_redirect("edit_signature.php?webtag={$webtag}&updated_global=true"); } else { header_redirect($redirect_uri = "edit_signature.php?webtag={$webtag}&updated=true"); } } }
function forum_check_password($forum_fid) { if (!is_numeric($forum_fid)) { return false; } $webtag = get_webtag(); if (!($forum_passhash = forum_get_password($forum_fid))) { return true; } $forum_passhash_check = session::get_value("{$webtag}_PASSWORD"); if (isset($_POST['forum_password']) && strlen($_POST['forum_password']) > 0) { $forum_passhash_check = md5($_POST['forum_password']); } if ($forum_passhash == $forum_passhash_check) { session::set_value("{$webtag}_PASSWORD", $forum_passhash_check); return true; } html_draw_top(sprintf("title=%s", gettext("Password Protected Forum"))); echo "<h1>", gettext("Password Protected Forum"), "</h1>\n"; if (session::get_value("{$webtag}_PASSWORD")) { html_display_error_msg(gettext("The username or password you supplied is not valid."), '550', 'center'); } if ($password_protected_message = forum_get_setting('password_protected_message')) { echo fix_html($password_protected_message); } else { html_display_warning_msg(gettext("This forum is password protected. To gain access enter the password below."), '400', 'center'); } echo "<br />\n"; echo "<div align=\"center\">\n"; echo " <form accept-charset=\"utf-8\" method=\"post\" action=\"", get_request_uri(), "\" target=\"_self\" autocomplete=\"off\">\n"; if (isset($_POST) && is_array($_POST) && sizeof($_POST) > 0) { echo form_input_hidden_array($_POST); } echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"400\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"box\" width=\"400\">\n"; echo " <tr>\n"; echo " <td class=\"posthead\" align=\"center\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Enter Password"), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <table class=\"posthead\" width=\"90%\">\n"; echo " <tr>\n"; echo " <td align=\"left\">", gettext("Password"), ":</td>\n"; echo " <td align=\"left\">", form_input_password('forum_password', '', 40, false, ''), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">", form_submit("logon", gettext("Logon")), " ", form_submit("cancel", gettext("Cancel")), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0) || session::check_perm(USER_PERM_FORUM_TOOLS, 0)) { html_display_warning_msg(gettext("If you want to change some settings on your forum click the Admin link in the navigation bar above."), '400', 'center'); } echo " </form>\n"; echo "</div>\n"; html_draw_bottom(); exit; }
$to_logon = implode(', ', array_map('user_get_logon_callback', $to_logon_array)); if (isset($_SESSION['PM_INCLUDE_REPLY']) && $_SESSION['PM_INCLUDE_REPLY'] == 'Y') { $message_author = htmlentities_array(format_user_name($pm_data['FROM_LOGON'], $pm_data['FROM_NICKNAME'])); $content = sprintf('<div class="quotetext"><b>%s:</b> %s</div> <div class="quote">%s</div><p> </p>', gettext('quote'), $message_author, fix_html($pm_data['CONTENT'])); } } else { light_pm_error_refuse(); } } else { if (isset($forward_mid) && is_numeric($forward_mid) && $forward_mid > 0) { if (($pm_data = pm_message_get($forward_mid)) !== false) { $pm_data['CONTENT'] = pm_get_content($forward_mid); $subject = preg_replace('/^(FWD:)?/iu', 'FWD:', $pm_data['SUBJECT']); $message_author = htmlentities_array(format_user_name($pm_data['FROM_LOGON'], $pm_data['FROM_NICKNAME'])); $content = fix_html($pm_data['CONTENT']); $attachments = $pm_data['ATTACHMENTS']; } else { light_pm_error_refuse(); } } else { if (isset($edit_mid) && is_numeric($edit_mid) && $edit_mid > 0) { if (($pm_data = pm_message_get($edit_mid)) !== false) { $pm_data['CONTENT'] = pm_get_content($edit_mid); $subject = $pm_data['SUBJECT']; $parsed_message = new MessageTextParse($pm_data['CONTENT']); $content = $parsed_message->getMessage(); $subject = $pm_data['SUBJECT']; $reply_mid = $pm_data['REPLY_TO_MID']; $to_logon = implode(', ', array_map('user_get_logon_callback', $pm_data['RECIPIENTS'])); $attachments = $pm_data['ATTACHMENTS'];