} else { echo " <td align=\"left\" class=\"postbody\" valign=\"top\"><i>", gettext("No Recipients"), "</i></td>\n"; echo " <td align=\"left\" class=\"postbody\" valign=\"top\"><i>", gettext("Not Sent"), "</i></td>\n"; echo " </tr>\n"; } } } else { echo " <td align=\"left\" class=\"postbody\" valign=\"top\">\n"; echo " <a href=\"user_profile.php?webtag={$webtag}&uid={$message['TO_UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($message['TLOGON'], $message['TNICK']), true), "</a>\n"; echo " </td>\n"; echo " <td align=\"left\" class=\"postbody\" valign=\"top\">", format_time($message['CREATED']), "</td>\n"; echo " </tr>\n"; } } else { echo " <td align=\"left\" class=\"postbody\" valign=\"top\">\n"; echo " <a href=\"user_profile.php?webtag={$webtag}&uid={$message['FROM_UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($message['FLOGON'], $message['FNICK']), true), "</a>\n"; echo " </td>\n"; echo " <td align=\"left\" class=\"postbody\" valign=\"top\">", format_time($message['CREATED']), "</td>\n"; echo " </tr>\n"; } } } } } } echo " <tr>\n"; echo " <td class=\"postbody\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n";
echo "<form accept-charset=\"utf-8\" name=\"f_post\" action=\"lpm_edit.php\" method=\"post\" target=\"_self\">\n"; echo " ", form_csrf_token_field(), "\n"; echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; echo " ", form_input_hidden('mid', htmlentities_array($mid)), "\n"; echo "<div class=\"post\">\n"; echo "<h3>", gettext("Edit Message"), "</h3>\n"; echo "<div class=\"post_inner\">\n"; if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { light_html_display_error_array($error_msg_array); } echo "<div class=\"post_thread_title\">", gettext("Subject"), ":", light_form_input_text("t_subject", isset($t_subject) ? htmlentities_array($t_subject) : "", 30, 64), "</div>\n"; echo "<div class=\"post_to\">", gettext("To"), ":\n"; echo "<div class=\"recipients\">\n"; if (isset($message_data['RECIPIENTS']) && sizeof($message_data['RECIPIENTS']) > 0) { foreach ($message_data['RECIPIENTS'] as $recipient) { echo word_filter_add_ob_tags(format_user_name($recipient['LOGON'], $recipient['NICKNAME']), true), "\n"; } } else { echo gettext('Unknown User'); } echo "</div>\n"; echo "</div>\n"; echo "<div class=\"post_content\">", light_form_textarea("t_content", htmlentities_array(strip_paragraphs($t_content)), 10, 50, null, 'textarea'), "</div>\n"; echo "<div class=\"post_buttons\">"; echo light_form_submit("apply", gettext("Apply")); echo light_form_submit("preview", gettext("Preview")); echo light_form_submit("cancel", gettext("Cancel")); echo "</div>"; if (attachments_check_dir()) { echo "<div class=\"attachments post_attachments\">", gettext('Attachments'), ":\n"; echo " ", attachments_form($_SESSION['UID'], $attachments), "\n";
echo " </tr>\n"; echo " </table>\n"; echo "</form>\n"; echo "<br />\n"; } if (($comments_array = links_get_comments($lid)) !== false) { 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"; foreach ($comments_array as $comment_id => $comment) { $profile_link = "<a href=\"user_profile.php?webtag={$webtag}&uid={$comment['UID']}\" target=\"_blank\" class=\"popup 650x500\">"; $profile_link .= word_filter_add_ob_tags(format_user_name($comment['LOGON'], $comment['NICKNAME']), true) . "</a>"; if ($user_perm_links_moderate || $comment['UID'] == $_SESSION['UID']) { echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", sprintf(gettext("Comment by %s"), $profile_link), " <a href=\"links_detail.php?webtag={$webtag}&delete_comment={$comment['CID']}&lid={$lid}\" class=\"threadtime\">[", gettext("Delete"), "]</a></td>\n"; echo " </tr>\n"; } else { echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", sprintf(gettext("Comment by %s"), $profile_link), "</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 align=\"left\">", word_filter_add_ob_tags($comment['COMMENT'], true), "</td>\n"; echo " </tr>\n";
break; case DELETE_USER_DATA: $index_link = "<a href=\"index.php?webtag={$webtag}&final_uri=%s\" target=\"_blank\">%s</a>"; $admin_user_link = sprintf("admin_user.php?webtag={$webtag}&uid=%s", $entry_array[0]); $admin_user_link = sprintf($index_link, rawurlencode($admin_user_link), $entry_array[1]); $action_text = sprintf(gettext("Deleted all user data for account '%s'"), $admin_user_link); break; default: $action_text = gettext("Unknown") . " :: {$admin_log_entry['ACTION']} :: "; $action_text .= implode(", ", $entry_array); break; } if ($auto_update === true) { echo " <td align=\"left\" valign=\"top\">", gettext("none"), "</td>\n"; } else { echo " <td align=\"left\" valign=\"top\"><a href=\"admin_user.php?webtag={$webtag}&uid=", $admin_log_entry['UID'], "\">", word_filter_add_ob_tags(format_user_name($admin_log_entry['LOGON'], $admin_log_entry['NICKNAME']), true), "</a></td>\n"; } echo " <td align=\"left\">", $action_text, "</td>\n"; if (isset($group_by) && $group_by != ADMIN_LOG_GROUP_NONE) { echo " <td align=\"center\">{$admin_log_entry['COUNT']}</td>\n"; } echo " </tr>\n"; } } echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n";
html_draw_error(gettext("The requested thread could not be found or access was denied.")); } if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) { html_email_confirmation_error(); 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;
echo " <td align=\"left\" class=\"posthead\">\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\" colspan=\"2\">", gettext("Search Results"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; if (sizeof($user_search_array['user_array']) > 0) { foreach ($user_search_array['user_array'] as $user) { echo " <tr>\n"; echo " <td align=\"left\" width=\"1%\">", form_checkbox("add_user[]", $user['UID']), "</td>\n"; echo " <td align=\"left\"><a href=\"user_profile.php?webtag={$webtag}&uid={$user['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($user['LOGON'], $user['NICKNAME']), true), "</a></td>\n"; echo " </tr>\n"; } } echo " <tr>\n"; echo " <td align=\"left\"> </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";
} } if (isset($_GET['action']) && strlen(trim($_GET['action'])) > 0) { $action = trim($_GET['action']); } else { if (isset($_POST['action']) && strlen(trim($_POST['action'])) > 0) { $action = trim($_POST['action']); } } if (isset($action) && strlen(trim($action)) > 0) { if ($action == 'reset_passwd') { if (!session::check_perm(USER_PERM_ADMIN_TOOLS, 0, 0)) { html_draw_error(gettext("You do not have permission to use this section."), 'admin_user.php', 'get', array('back' => gettext("Back")), array('uid' => $uid)); } html_draw_top("title={$page_title}", 'class=window_title'); echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Manage User"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", word_filter_add_ob_tags(format_user_name($user['LOGON'], $user['NICKNAME']), true), "</h1>\n"; html_display_warning_msg(gettext("If this user has forgotten their password you can reset it for them here."), '600', 'center'); echo "<br />\n"; echo "<div align=\"center\">\n"; echo "<form accept-charset=\"utf-8\" name=\"admin_user_form\" action=\"admin_user.php\" method=\"post\">\n"; echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; echo " ", form_input_hidden("uid", htmlentities_array($uid)), "\n"; echo " ", form_input_hidden("action", htmlentities_array($action)), "\n"; echo " ", form_input_hidden("ret", htmlentities_array("admin_user.php?webtag={$webtag}&uid={$uid}")), "\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";
function email_send_message_to_user($to_uid, $from_uid, $subject, $message_body, $use_email_addr) { if (!is_numeric($to_uid)) { return false; } if (!is_numeric($from_uid)) { return false; } if (!($to_user = user_get($to_uid))) { return false; } if (!($from_user = user_get($from_uid))) { return false; } if (!($transport = Swift_TransportFactory::get())) { return false; } $mailer = Swift_Mailer::newInstance($transport); $message = Swift_MessageBeehive::newInstance(); if (!email_address_valid($to_user['EMAIL'])) { return false; } $forum_name = word_filter_apply(forum_get_setting('forum_name', null, 'A Beehive Forum'), $to_uid, true); $recipient = word_filter_apply(format_user_name($to_user['LOGON'], $to_user['NICKNAME']), $to_uid, true); $sent_from = word_filter_apply(format_user_name($from_user['LOGON'], $from_user['NICKNAME']), $to_uid, true); $message->setTo($to_user['EMAIL'], $recipient); if ($use_email_addr) { $message->setFrom($from_user['EMAIL'], $sent_from); } $message->setSubject($subject); $message->setBody(sprintf("%1\$s\n\n%2\$s", word_filter_apply(strip_tags($message_body), $to_uid, true), wordwrap(sprintf(gettext("This message was sent from %1\$s by %2\$s"), $forum_name, $sent_from)))); $message->addPart(sprintf("<p>%1\$s</p><p>%2\$s</p>", word_filter_apply(strip_tags($message_body), $to_uid, true), wordwrap_html(sprintf(gettext("This message was sent from %1\$s by %2\$s"), $forum_name, $sent_from))), 'text/part'); return $mailer->send($message); }
echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"><h2>", gettext("Thread title"), "</h2></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">", word_filter_add_ob_tags($thread_data['TITLE'], true), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"><h2>", gettext("To"), "</h2></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">"; if ($edit_message['TO_UID'] > 0) { echo "<a href=\"user_profile.php?webtag={$webtag}&uid={$edit_message['TO_UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($edit_message['TLOGON'], $edit_message['TNICK']), true), "</a>\n"; } else { echo word_filter_add_ob_tags(format_user_name($edit_message['TLOGON'], $edit_message['TNICK']), true); } echo " </td>\n"; echo " </tr>\n"; if (($user_emoticon_pack = session::get_value('EMOTICONS')) === false) { $user_emoticon_pack = forum_get_setting('default_emoticons', null, 'default'); } if ($emoticon_preview_html = emoticons_preview($user_emoticon_pack)) { echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table width=\"196\" class=\"messagefoot\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Emoticons"), "</td>\n";
if (isset($search_results_array['results_array']) && sizeof($search_results_array['results_array']) > 0) { echo " <tr>\n"; echo " <td align=\"left\"><hr /></td>\n"; echo " </tr>\n"; } } if (isset($search_results_array['results_array']) && sizeof($search_results_array['results_array']) > 0) { foreach ($search_results_array['results_array'] as $search_result) { if ($type == SEARCH_LOGON && !in_array($search_result['LOGON'], $selected_array)) { if ($multi === 'Y') { echo " <tr>\n"; echo " <td align=\"left\">", form_checkbox("selected[]", htmlentities_array($search_result['LOGON'])), " <a href=\"user_profile.php?webtag={$webtag}&uid={$search_result['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($search_result['LOGON'], $search_result['NICKNAME']), true), "</a></td>\n"; echo " </tr>\n"; } else { echo " <tr>\n"; echo " <td align=\"left\">", form_radio("selected", htmlentities_array($search_result['LOGON'])), " <a href=\"user_profile.php?webtag={$webtag}&uid={$search_result['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($search_result['LOGON'], $search_result['NICKNAME']), true), "</a></td>\n"; echo " </tr>\n"; } } else { if ($type == SEARCH_THREAD && !in_array($search_result['TID'], $selected_array)) { echo " <tr>\n"; echo " <td align=\"left\">", form_radio("selected", $search_result['TID']), " <a href=\"messages.php?webtag={$webtag}&msg={$search_result['TID']}.1\" target=\"_blank\">", word_filter_add_ob_tags($search_result['TITLE'], true), "</a></td>\n"; echo " </tr>\n"; } } } } if (sizeof($selected_array) > 0 || isset($search_results_array['results_array']) && sizeof($search_results_array['results_array']) > 0) { echo " <tr>\n"; echo " <td class=\"postbody\"> </td>\n"; echo " </tr>\n";
function email_send_message_to_user($tuid, $fuid, $subject, $message_body, $use_email_addr) { // Validate function arguments if (!is_numeric($tuid)) { return false; } if (!is_numeric($fuid)) { return false; } // Get the to user details if (!($to_user = user_get($tuid))) { return false; } // Get the to user details if (!($from_user = user_get($fuid))) { return false; } // Get the Swift Mailer Transport if (!($transport = Swift_TransportFactory::get())) { return false; } //Create the Mailer using the returned Transport $mailer = Swift_Mailer::newInstance($transport); // Create a new message $message = Swift_MessageBeehive::newInstance(); // Validate the email address before we continue. if (!email_address_valid($to_user['EMAIL'])) { return false; } // Get the forum name, subject, recipient, author, thread title and generate // the messages link. Pass all of them through the recipient's word filter. $forum_name = word_filter_apply(forum_get_setting('forum_name', null, 'A Beehive Forum'), $tuid, true); $recipient = word_filter_apply(format_user_name($to_user['LOGON'], $to_user['NICKNAME']), $tuid, true); $sent_from = word_filter_apply(format_user_name($from_user['LOGON'], $from_user['NICKNAME']), $tuid, true); // Word filter the message to be sent. $message_body = word_filter_apply($message_body, $tuid, true); // Add the Sent By footer to the message. $message_body .= "\r\n\r\n" . wordwrap(sprintf(gettext("This message was sent from %s by %s"), $forum_name, $sent_from)); // Add the recipient $message->setTo($to_user['EMAIL'], $recipient); // Set the from recipient if ($use_email_addr) { $message->setFrom($from_user['EMAIL'], $sent_from); } // Set the subject $message->setSubject($subject); // Set the message body $message->setBody($message_body); // Send the email return $mailer->send($message) > 0; }
} $latest_post = 1; if (!is_numeric($first_thread) && isset($selected_tid) && $selected_tid == $thread['TID']) { $first_thread = $thread['TID']; echo "<img src=\"", html_style_image('current_thread.png'), "\" class=\"thread_bullet\" id=\"t{$thread['TID']}\" alt=\"", gettext("Thread Options"), "\" title=\"", gettext("Thread Options"), "\" border=\"0\" />"; } else { echo "<img src=\"", html_style_image('bullet.png'), "\" class=\"thread_bullet\" id=\"t{$thread['TID']}\" alt=\"", gettext("Thread Options"), "\" title=\"", gettext("Thread Options"), "\" border=\"0\" />"; } } } echo "</a>"; $thread_time = format_time($thread['MODIFIED']); echo "</td>\n"; echo " <td align=\"left\" valign=\"top\">"; echo "<a href=\"messages.php?webtag={$webtag}&msg={$thread['TID']}.{$latest_post}\" target=\"", html_get_frame_name('right'), "\" class=\"threadname\" rel=\"t{$thread['TID']}\""; echo "title=\"", sprintf(gettext("Thread #%s Started by %s. Viewed %s"), $thread['TID'], word_filter_add_ob_tags(format_user_name($thread['LOGON'], $thread['NICKNAME']), true), $thread['VIEWCOUNT'] == 1 ? gettext("1 time") : sprintf(gettext("%d times"), $thread['VIEWCOUNT'])), "\">"; echo word_filter_add_ob_tags($thread['TITLE'], true), "</a> "; if (session::logged_in()) { if (isset($thread['INTEREST']) && $thread['INTEREST'] == THREAD_INTERESTED) { echo "<img src=\"", html_style_image('high_interest.png'), "\" alt=\"", gettext("High Interest"), "\" title=\"", gettext("High Interest"), "\" /> "; } if (isset($thread['INTEREST']) && $thread['INTEREST'] == THREAD_SUBSCRIBED) { echo "<img src=\"", html_style_image('subscribe.png'), "\" alt=\"", gettext("Subscribed"), "\" title=\"", gettext("Subscribed"), "\" /> "; } if (isset($thread['RELATIONSHIP']) && $thread['RELATIONSHIP'] & USER_FRIEND) { echo "<img src=\"", html_style_image('friend.png'), "\" alt=\"", gettext("Friend"), "\" title=\"", gettext("Friend"), "\" /> "; } } if (isset($thread['POLL_FLAG']) && $thread['POLL_FLAG'] == 'Y') { echo "<a href=\"poll_results.php?webtag={$webtag}&tid={$thread['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> "; }
pm_edit_refuse(); } } } } light_html_draw_top(sprintf("title=%s", gettext("Edit Message"))); if ($valid && isset($_POST['preview'])) { echo "<h3>", gettext("Message Preview"), "</h3>\n"; light_pm_display($pm_message_array, PM_FOLDER_OUTBOX, true); } echo "<form accept-charset=\"utf-8\" name=\"f_post\" action=\"lpm_edit.php\" method=\"post\" target=\"_self\">\n"; echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; echo " ", form_input_hidden('mid', htmlentities_array($mid)), "\n"; echo "<div class=\"post\">\n"; echo "<h3>", gettext("Edit Message"), "</h3>\n"; echo "<div class=\"post_inner\">\n"; if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { light_html_display_error_array($error_msg_array, '720', 'left'); } echo "<div class=\"post_thread_title\">", gettext("Subject"), ":", light_form_input_text("t_subject", isset($t_subject) ? htmlentities_array($t_subject) : "", 30, 64), "</div>\n"; echo "<div class=\"post_to\">", gettext("To"), ":", word_filter_add_ob_tags(format_user_name($pm_message_array['TLOGON'], $pm_message_array['TNICK']), true), "</div>\n"; echo "<div class=\"post_content\">", light_form_textarea("t_content", htmlentities_array($t_content), 10, 50, false, 'textarea editor mobile'), "</div>\n"; echo "<div class=\"post_buttons\">"; echo light_form_submit("apply", gettext("Apply")); echo light_form_submit("preview", gettext("Preview")); echo light_form_submit("cancel", gettext("Cancel")); echo "</div>"; echo "</div>"; echo "</div>"; echo "</form>\n"; light_html_draw_bottom();
// Popup title. $page_title = format_user_name($user_profile['LOGON'], $user_profile['NICKNAME']); html_draw_top(array('title' => $page_title, 'js' => array('js/user_profile.js'), 'base_target' => '_blank', 'pm_popup_disabled' => true, 'class' => 'window_title')); echo "<div align=\"center\">\n"; echo " <table width=\"600\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"center\" class=\"posthead\">\n"; echo " <table class=\"profile_header\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td align=\"center\" width=\"95%\">\n"; echo " <table width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\"><h2 class=\"profile_logon\" id=\"profile_options\">", word_filter_add_ob_tags(format_user_name($user_profile['LOGON'], $user_profile['NICKNAME']), true), " ", html_style_image('post_options', gettext("Options")), "</h2>\n"; echo " <div class=\"profile_options_container\" id=\"profile_options_container\">\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" colspan=\"3\">\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 class=\"subhead\" colspan=\"2\">", gettext("Options"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table width=\"95%\" class=\"profile_options_menu\">\n"; if (isset($user_profile['HOMEPAGE_URL']) && filter_var($user_profile['HOMEPAGE_URL'], FILTER_VALIDATE_URL)) {
echo " <td align=\"left\" valign=\"top\" class=\"postbody\">", html_style_image('bullet', gettext("User")), "</td>\n"; } } else { echo " <td align=\"left\" valign=\"top\" class=\"postbody\">", html_style_image('bullet', gettext("User")), "</td>\n"; } } } else { echo " <td align=\"left\" valign=\"top\" class=\"postbody\">", html_style_image('bullet', gettext("User")), "</td>\n"; } if (isset($user_array['SID']) && !is_null($user_array['SID'])) { echo " <td class=\"postbody\" align=\"left\" valign=\"top\"><a href=\"{$user_array['URL']}\" target=\"_blank\">", word_filter_add_ob_tags($user_array['NAME'], true), "</a></td>\n"; } else { if ($user_array['UID'] > 0) { echo " <td class=\"postbody\" align=\"left\" valign=\"top\"><a href=\"user_profile.php?webtag={$webtag}&uid={$user_array['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($user_array['LOGON'], $user_array['NICKNAME']), true), "</a></td>\n"; } else { echo " <td class=\"postbody\" align=\"left\" valign=\"top\">", word_filter_add_ob_tags(format_user_name($user_array['LOGON'], $user_array['NICKNAME']), true), "</td>\n"; } } foreach ($profile_items_selected_array as $key => $profile_item_selected) { if (is_numeric($key) && isset($user_array["ENTRY_{$key}"])) { if ($user_array["PROFILE_ITEM_TYPE_{$key}"] == PROFILE_ITEM_RADIO || $user_array["PROFILE_ITEM_TYPE_{$key}"] == PROFILE_ITEM_DROPDOWN) { $profile_item_options_array = explode("\n", $user_array["PROFILE_ITEM_OPTIONS_{$key}"]); if (isset($profile_item_options_array[$user_array["ENTRY_{$key}"]])) { echo " <td class=\"postbody\" align=\"right\" valign=\"top\" width=\"20%\"><div class=\"profile_item_overflow\" title=\"", htmlentities_array($profile_item_options_array[$user_array["ENTRY_{$key}"]]), "\">", word_filter_add_ob_tags($profile_item_options_array[$user_array["ENTRY_{$key}"]], true), " </div></td>\n"; } else { echo " <td class=\"postbody\" align=\"right\" valign=\"top\" width=\"20%\"><div class=\"profile_item_overflow\" title=\"\"> </div></td>\n"; } } else { if ($user_array["PROFILE_ITEM_TYPE_{$key}"] == PROFILE_ITEM_HYPERLINK) { $profile_item_hyper_link = str_replace("[ProfileEntry]", word_filter_add_ob_tags(urlencode($user_array["ENTRY_{$key}"])), $user_array["PROFILE_ITEM_OPTIONS_{$key}"]); $profile_item_hyper_link = sprintf("<a href=\"%s\" target=\"_blank\">%s</a>", $profile_item_hyper_link, word_filter_add_ob_tags($user_array["ENTRY_{$key}"], true));
$t_content = message_apply_formatting($t_content, true); // Strip HTML and trim the content back. $t_content = strip_tags(trim(xml_strip_invalid_chars($t_content))); // Convert HTML special chars (& -> &, etc); $t_content = htmlspecialchars($t_content); $t_title = htmlspecialchars($t_title); // Check for double-encoded HTML chars (&amp;, etc.) $t_content = preg_replace("/&(#[0-9]+|[a-z]+);/iu", "&\\1;", $t_content); $t_title = preg_replace("/&(#[0-9]+|[a-z]+);/iu", "&\\1;", $t_title); // Convert HTML entities to XML literals. $t_content = html_entity_to_decimal($t_content); $t_title = html_entity_to_decimal($t_title); // Output the item. echo "<item>\n"; echo " <guid isPermaLink=\"true\">{$forum_location}/index.php?webtag={$webtag}&msg={$thread['TID']}.1</guid>\n"; echo " <pubDate>{$modified_date} UT</pubDate>\n"; echo " <title>{$t_title}</title>\n"; echo " <link>{$forum_location}/index.php?webtag={$webtag}&msg={$thread['TID']}.1</link>\n"; // Get the author of the message. if (isset($t_user_array['LOGON'])) { $t_user = htmlentities_array(format_user_name($t_user_array['LOGON'], $t_user_array['NICKNAME'])); echo " <dc:creator>{$t_user}</dc:creator>\n"; } echo " <description><![CDATA[{$t_content}]]></description>\n"; echo " <comments>{$forum_location}/index.php?webtag={$webtag}&msg={$thread['TID']}.1</comments>\n"; echo "</item>\n"; } } echo "<atom:link href=\"{$forum_location}/threads_rss.php?webtag={$webtag}\" rel=\"self\" type=\"application/rss+xml\" />\n"; echo "</channel>\n"; echo "</rss>\n";
function post_draw_to_dropdown_in_thread($tid, $default_uid, $show_all = true, $inc_blank = false, $class = 'user_in_thread_dropdown', $custom_html = "") { $html = "<select name=\"t_to_uid_in_thread\" class=\"{$class}\" {$custom_html}>"; if (!($db = db::get())) { return false; } if (!is_numeric($tid)) { return false; } if (!is_numeric($default_uid)) { $default_uid = 0; } if (!($table_prefix = get_table_prefix())) { return ""; } $uid = session::get_value('UID'); if (isset($default_uid) && $default_uid != 0) { $sql = "SELECT USER.LOGON, USER.NICKNAME, USER_PEER.PEER_NICKNAME "; $sql .= "FROM USER LEFT JOIN `{$table_prefix}USER_PEER` USER_PEER "; $sql .= "ON (USER_PEER.PEER_UID = USER.UID AND USER_PEER.UID = '{$uid}') "; $sql .= "WHERE USER.UID = '{$default_uid}' "; if (!($result = $db->query($sql))) { return false; } if ($result->num_rows > 0) { if ($top_user = $result->fetch_assoc()) { if (isset($top_user['PEER_NICKNAME'])) { if (!is_null($top_user['PEER_NICKNAME']) && strlen($top_user['PEER_NICKNAME']) > 0) { $top_user['NICKNAME'] = $top_user['PEER_NICKNAME']; } } $fmt_username = word_filter_add_ob_tags(format_user_name($top_user['LOGON'], $top_user['NICKNAME']), true); $html .= "<option value=\"{$default_uid}\" selected=\"selected\">{$fmt_username}</option>"; } } } if ($show_all) { $html .= "<option value=\"0\">" . gettext("ALL") . "</option>"; } else { if ($inc_blank) { if (isset($default_uid) && $default_uid != 0) { $html .= "<option value=\"0\"> </option>"; } else { $html .= "<option value=\"0\" selected=\"selected\"> </option>"; } } } $sql = "SELECT POST.FROM_UID AS UID, USER.LOGON, USER.NICKNAME, "; $sql .= "USER_PEER.PEER_NICKNAME FROM `{$table_prefix}POST` POST "; $sql .= "LEFT JOIN USER USER ON (USER.UID = POST.FROM_UID) "; $sql .= "LEFT JOIN `{$table_prefix}USER_PEER` USER_PEER "; $sql .= "ON (USER_PEER.PEER_UID = POST.FROM_UID AND USER_PEER.UID = '{$uid}') "; $sql .= "WHERE POST.TID = '{$tid}' AND POST.FROM_UID <> '{$default_uid}' "; $sql .= "GROUP BY POST.FROM_UID LIMIT 0, 20"; if (!($result = $db->query($sql))) { return false; } while ($user_data = $result->fetch_assoc()) { if (isset($user_data['LOGON'])) { if (isset($user_data['LOGON']) && isset($user_data['PEER_NICKNAME'])) { if (!is_null($user_data['PEER_NICKNAME']) && strlen($user_data['PEER_NICKNAME']) > 0) { $user_data['NICKNAME'] = $user_data['PEER_NICKNAME']; } } $fmt_username = word_filter_add_ob_tags(format_user_name($user_data['LOGON'], $user_data['NICKNAME']), true); $html .= "<option value=\"{$user_data['UID']}\">{$fmt_username}</option>"; } } $html .= "</select>"; return $html; }
function poll_public_ballot_user_callback($user_data) { $webtag = get_webtag(); if (isset($user_data['UID']) && $user_data['UID'] > 0) { $user_profile_link_html = "<a href=\"user_profile.php?webtag={$webtag}&uid=%1\$s\" target=\"_blank\" class=\"popup 650x500\" style=\"white-space: nowrap\">%2\$s</a>"; return sprintf($user_profile_link_html, $user_data['UID'], word_filter_add_ob_tags(format_user_name($user_data['LOGON'], $user_data['NICKNAME']), true), $webtag); } else { if (isset($user_data['LOGON'])) { return $user_data['LOGON']; } else { if (is_string($user_data)) { return $user_data; } } } return gettext("Unknown user"); }
echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\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\" colspan=\"2\">", gettext("Search Results"), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; if (sizeof($user_search_array['user_array']) > 0) { foreach ($user_search_array['user_array'] as $user_search_result) { echo " <tr>\n"; echo " <td align=\"left\">", form_checkbox("add_user[]", $user_search_result['UID'], ''), " ", word_filter_add_ob_tags(format_user_name($user_search_result['LOGON'], $user_search_result['NICKNAME']), true), "</td>\n"; echo " </tr>\n"; } } echo " <tr>\n"; echo " <td align=\"left\"> </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";
function light_pm_display($message_data, $preview = false) { $webtag = get_webtag(); forum_check_webtag_available($webtag); if (!$preview) { if (strlen(trim($message_data['SUBJECT'])) > 0) { echo "<h3 class=\"message_subject\">", word_filter_add_ob_tags($message_data['SUBJECT'], true), "</h3>\n"; } else { echo "<h3 class=\"message_subject\">", gettext("No Subject"), "</h3>\n"; } } 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_data['FROM_LOGON'], $message_data['FROM_NICKNAME']), true), "\n"; echo "<span class=\"message_time\">", format_date_time($message_data['CREATED']), "</span>\n"; echo "<div class=\"clearer\"></div>\n"; echo "</div>\n"; echo "<div class=\"message_to\">", gettext("To"), ": "; if (isset($message_data['RECIPIENTS']) && sizeof($message_data['RECIPIENTS']) > 0) { foreach ($message_data['RECIPIENTS'] as $recipient) { echo "<span>", word_filter_add_ob_tags(format_user_name($recipient['LOGON'], $recipient['NICKNAME']), true), "</span>\n"; } } else { echo gettext('Unknown User'); } echo "<div class=\"clearer\"></div>\n"; echo "</div>\n"; echo "</div>\n"; $message_data['CONTENT'] = message_apply_formatting($message_data['CONTENT']); $message_data['CONTENT'] = word_filter_add_ob_tags($message_data['CONTENT']); echo "<div class=\"message_links\"> </div>\n"; echo "<div class=\"message_body\">", $message_data['CONTENT'], "</div>\n"; if (isset($message_data['ATTACHMENTS']) && sizeof($message_data['ATTACHMENTS']) > 0) { if (($attachments_array = attachments_get($message_data['FROM_UID'], $message_data['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 ($preview === false) { $links_array = array(); if (($message_data['TYPE'] & PM_INBOX_ITEMS) > 0) { $links_array[] = "<a href=\"lpm_write.php?webtag={$webtag}&reply_to={$message_data['MID']}\" class=\"reply\">" . html_style_image('post') . gettext("Reply") . "</a>"; if (isset($message_data['RECIPIENTS']) && sizeof($message_data['RECIPIENTS']) > 1) { $links_array[] = "<a href=\"lpm_write.php?webtag={$webtag}&replyall={$message_data['MID']}\" class=\"replyall\">" . html_style_image('reply_all') . gettext("Reply All") . "</a>"; } $links_array[] = "<a href=\"lpm_write.php?webtag={$webtag}&fwdmsg={$message_data['MID']}\" class=\"forward\">" . html_style_image('forward') . gettext("Forward") . "</a>"; $links_array[] = "<a href=\"lpm.php?webtag={$webtag}&delete_msg={$message_data['MID']}\" class=\"delete\">" . html_style_image('delete') . gettext("Delete") . "</a>"; } else { if (($message_data['TYPE'] & PM_OUTBOX_ITEMS) > 0) { $links_array[] = "<a href=\"lpm_edit.php?webtag={$webtag}&mid={$message_data['MID']}\" class=\"edit\">" . html_style_image('edit') . gettext("Edit") . "</a>"; $links_array[] = "<a href=\"lpm_write.php?webtag={$webtag}&fwdmsg={$message_data['MID']}\" class=\"forward\">" . html_style_image('forward') . gettext("Forward") . "</a>"; $links_array[] = "<a href=\"lpm.php?webtag={$webtag}&delete_msg={$message_data['MID']}\" class=\"delete\">" . html_style_image('delete') . gettext("Delete") . "</a>"; } else { if (($message_data['TYPE'] & PM_DRAFT_ITEMS) > 0) { $links_array[] = "<a href=\"lpm_write.php?webtag={$webtag}&editmsg={$message_data['MID']}\" class=\"edit\">" . html_style_image('edit') . gettext("Edit") . "</a>"; $links_array[] = "<a href=\"lpm.php?webtag={$webtag}&delete_msg={$message_data['MID']}\" class=\"delete\">" . html_style_image('delete') . gettext("Delete") . "</a>"; } else { $links_array[] = "<a href=\"lpm_write.php?webtag={$webtag}&fwdmsg={$message_data['MID']}\" class=\"forward\">" . html_style_image('forward') . gettext("Forward") . "</a>"; $links_array[] = "<a href=\"lpm.php?webtag={$webtag}&delete_msg={$message_data['MID']}\" class=\"delete\">" . html_style_image('delete') . gettext("Delete") . "</a>"; } } } if (sizeof($links_array) > 0) { echo "<div class=\"message_footer_links\">", implode(' ', $links_array), "</div>\n"; } } echo "</div>"; }
function stats_get_active_user_list() { $stats = array('ANON_USERS' => 0, 'BOTS' => 0, 'GUESTS' => 0, 'USER_COUNT' => 0, 'USERS' => array()); $search_engine_bots = array(); $user_sort = array(); if (!($db = db::get())) { return $stats; } if (!($table_prefix = get_table_prefix())) { return $stats; } if (!($forum_fid = get_forum_fid())) { return $stats; } $session_gc_maxlifetime = ini_get('session.gc_maxlifetime'); $session_cutoff_datetime = date(MYSQL_DATETIME, time() - $session_gc_maxlifetime); if (($uid = session::get_value('UID')) === false) { return $stats; } $sql = "SELECT COUNT(UID) FROM SESSIONS WHERE UID = 0 AND SID IS NULL "; $sql .= "AND SESSIONS.TIME >= CAST('{$session_cutoff_datetime}' AS DATETIME) "; $sql .= "AND SESSIONS.FID = '{$forum_fid}'"; if (!($result = $db->query($sql))) { return $stats; } list($stats['GUESTS']) = $result->fetch_row(); $sql = "SELECT DISTINCT SESSIONS.UID, USER.LOGON, USER.NICKNAME, USER_PEER2.PEER_NICKNAME, "; $sql .= "USER_PREFS_GLOBAL.ANON_LOGON, USER_PEER.RELATIONSHIP AS PEER_RELATIONSHIP, "; $sql .= "USER_PEER2.RELATIONSHIP AS USER_RELATIONSHIP, SEARCH_ENGINE_BOTS.SID, "; $sql .= "SEARCH_ENGINE_BOTS.URL AS BOT_URL, SEARCH_ENGINE_BOTS.NAME AS BOT_NAME, "; $sql .= "USER_PREFS_FORUM.AVATAR_URL AS AVATAR_URL_FORUM, USER_PREFS_FORUM.AVATAR_AID AS AVATAR_AID_FORUM, "; $sql .= "USER_PREFS_GLOBAL.AVATAR_URL AS AVATAR_URL_GLOBAL, USER_PREFS_GLOBAL.AVATAR_AID AS AVATAR_AID_GLOBAL "; $sql .= "FROM SESSIONS SESSIONS LEFT JOIN USER USER ON (USER.UID = SESSIONS.UID) "; $sql .= "LEFT JOIN `{$table_prefix}USER_PEER` USER_PEER "; $sql .= "ON (USER_PEER.UID = SESSIONS.UID AND USER_PEER.PEER_UID = '{$uid}') "; $sql .= "LEFT JOIN `{$table_prefix}USER_PEER` USER_PEER2 "; $sql .= "ON (USER_PEER2.PEER_UID = SESSIONS.UID AND USER_PEER2.UID = '{$uid}') "; $sql .= "LEFT JOIN `{$table_prefix}USER_PREFS` USER_PREFS_FORUM ON (USER_PREFS_FORUM.UID = SESSIONS.UID) "; $sql .= "LEFT JOIN USER_PREFS USER_PREFS_GLOBAL ON (USER_PREFS_GLOBAL.UID = SESSIONS.UID) "; $sql .= "LEFT JOIN SEARCH_ENGINE_BOTS ON (SEARCH_ENGINE_BOTS.SID = SESSIONS.SID) "; $sql .= "WHERE SESSIONS.TIME >= CAST('{$session_cutoff_datetime}' AS DATETIME) "; $sql .= "AND SESSIONS.FID = '{$forum_fid}' AND (SESSIONS.UID > 0 OR SESSIONS.SID IS NOT NULL)"; if (!($result = $db->query($sql))) { return $stats; } while ($user_data = $result->fetch_assoc()) { if (isset($user_data['ANON_LOGON']) && $user_data['ANON_LOGON'] > USER_ANON_DISABLED) { $anon_logon = $user_data['ANON_LOGON']; } else { $anon_logon = USER_ANON_DISABLED; } if (!isset($user_data['USER_RELATIONSHIP'])) { $user_data['USER_RELATIONSHIP'] = USER_NORMAL; } if (!isset($user_data['PEER_RELATIONSHIP'])) { $user_data['PEER_RELATIONSHIP'] = USER_NORMAL; } if (isset($user_data['LOGON']) && isset($user_data['PEER_NICKNAME'])) { if (!is_null($user_data['PEER_NICKNAME']) && strlen($user_data['PEER_NICKNAME']) > 0) { $user_data['NICKNAME'] = $user_data['PEER_NICKNAME']; } } if (isset($user_data['AVATAR_URL_FORUM']) && strlen($user_data['AVATAR_URL_FORUM']) > 0) { $user_data['AVATAR_URL'] = $user_data['AVATAR_URL_FORUM']; } else { if (isset($user_data['AVATAR_URL_GLOBAL']) && strlen($user_data['AVATAR_URL_GLOBAL']) > 0) { $user_data['AVATAR_URL'] = $user_data['AVATAR_URL_GLOBAL']; } else { $user_data['AVATAR_URL'] = null; } } if (isset($user_data['AVATAR_AID_FORUM']) && is_md5($user_data['AVATAR_AID_FORUM'])) { $user_data['AVATAR_AID'] = $user_data['AVATAR_AID_FORUM']; } else { if (isset($user_data['AVATAR_AID_GLOBAL']) && is_md5($user_data['AVATAR_AID_GLOBAL'])) { $user_data['AVATAR_AID'] = $user_data['AVATAR_AID_GLOBAL']; } else { $user_data['AVATAR_AID'] = null; } } if (!isset($user_data['LOGON'])) { $user_data['LOGON'] = gettext("Unknown user"); } if (!isset($user_data['NICKNAME'])) { $user_data['NICKNAME'] = ""; } if (($user_data['USER_RELATIONSHIP'] & USER_IGNORED_COMPLETELY) > 0) { unset($user_data); } else { if (isset($user_data['SID']) && !is_null($user_data['SID'])) { if (forum_get_setting('searchbots_show_active', 'Y')) { $stats['BOTS']++; $user_sort[] = $user_data['BOT_NAME']; $stats['USERS'][] = array('BOT_NAME' => $user_data['BOT_NAME'], 'BOT_URL' => $user_data['BOT_URL']); } else { $stats['GUESTS']++; } } else { if ($anon_logon == USER_ANON_DISABLED || $user_data['UID'] == $uid || ($user_data['PEER_RELATIONSHIP'] & USER_FRIEND) > 0 && $anon_logon == USER_ANON_FRIENDS_ONLY) { $stats['USER_COUNT']++; $user_sort[] = format_user_name($user_data['LOGON'], $user_data['NICKNAME']); $stats['USERS'][] = array('UID' => $user_data['UID'], 'LOGON' => $user_data['LOGON'], 'NICKNAME' => $user_data['NICKNAME'], 'RELATIONSHIP' => $user_data['USER_RELATIONSHIP'], 'ANON_LOGON' => $anon_logon, 'AVATAR_URL' => $user_data['AVATAR_URL'], 'AVATAR_AID' => $user_data['AVATAR_AID']); } else { $stats['ANON_USERS']++; } } } } $user_sort = array_map('strtolower', $user_sort); array_multisort($user_sort, SORT_ASC, SORT_STRING, $stats['USERS']); return $stats; }
html_draw_error(gettext("The requested thread could not be found or access was denied.")); } if (session::check_perm(USER_PERM_EMAIL_CONFIRM, 0)) { html_email_confirmation_error(); exit; } if (!session::check_perm(USER_PERM_POST_CREATE, $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); $content_array = array(); foreach ($quote_list as $quote_pid) { if (($message_array = messages_get($tid, $quote_pid)) !== false) { $message_author = htmlentities_array(format_user_name($message_array['FROM_LOGON'], $message_array['FROM_NICKNAME'])); $message_content = message_get_content($tid, $quote_pid); $message_content = message_apply_formatting($message_content, true); $message_link = "messages.php?webtag={$webtag}&msg={$tid}.{$quote_pid}"; $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)); } } $content_array[] = '<p> </p>'; if (sizeof($content_array) > 0) { $content = implode('', $content_array); } } $new_thread = false; } else { if (isset($_POST['reply_to']) && validate_msg($_POST['reply_to'])) {
if ($sort_by == 'ACTIVE' && $sort_dir == 'DESC') { echo " <td class=\"subhead_sort_desc\" align=\"left\"><a href=\"admin_users.php?webtag={$webtag}&sort_by=ACTIVE&sort_dir=ASC&user_search=", htmlentities_array($user_search), "&page={$page}&filter={$filter}\">", gettext("Active"), "</a></td>\n"; } else { if ($sort_dir == 'ASC') { echo " <td class=\"subhead\" align=\"left\"><a href=\"admin_users.php?webtag={$webtag}&sort_by=ACTIVE&sort_dir=ASC&user_search=", htmlentities_array($user_search), "&page={$page}&filter={$filter}\">", gettext("Active"), "</a></td>\n"; } else { echo " <td class=\"subhead\" align=\"left\"><a href=\"admin_users.php?webtag={$webtag}&sort_by=ACTIVE&sort_dir=DESC&user_search=", htmlentities_array($user_search), "&page={$page}&filter={$filter}\">", gettext("Active"), "</a></td>\n"; } } } echo " </tr>\n"; if (sizeof($admin_user_array['user_array']) > 0) { foreach ($admin_user_array['user_array'] as $user) { echo " <tr>\n"; echo " <td align=\"center\">", form_checkbox("user_update[{$user['UID']}]", "Y"), "</td>\n"; echo " <td class=\"posthead\" align=\"left\" width=\"35%\" style=\"white-space: nowrap\"> <a href=\"admin_user.php?webtag={$webtag}&uid=", $user['UID'], "\">", word_filter_add_ob_tags(format_user_name($user['LOGON'], $user['NICKNAME']), true), "</a></td>\n"; if (isset($user['LAST_VISIT']) && $user['LAST_VISIT'] > 0) { echo " <td class=\"posthead\" align=\"left\"> ", format_time($user['LAST_VISIT']), "</td>\n"; } else { echo " <td class=\"posthead\" align=\"left\"> ", gettext("Unknown"), "</td>\n"; } if (isset($user['REGISTERED']) && $user['REGISTERED'] > 0) { echo " <td class=\"posthead\" align=\"left\"> ", format_time($user['REGISTERED']), "</td>\n"; } else { echo " <td class=\"posthead\" align=\"left\"> ", gettext("Unknown"), "</td>\n"; } if (isset($user['ID'])) { echo " <td class=\"posthead\" align=\"left\"> <b>", gettext("Yes"), "</b></td>\n"; } else { echo " <td class=\"posthead\" align=\"left\"> ", gettext("No"), "</td>\n"; }
$peer_relationship = $peer_relationship & USER_IGNORED ? USER_NORMAL : $peer_relationship; } if (user_rel_update($_SESSION['UID'], $peer_uid, $peer_relationship, $peer_nickname)) { header_redirect("{$ret}&relupdated=true"); exit; } else { $error_msg_array[] = gettext("Relationship updated failed!"); $valid = false; } } if (isset($_POST['reset_nickname_x']) || isset($_POST['reset_nickname_y'])) { $peer_nickname = user_get_nickname($peer_uid); $peer_relationship = user_get_peer_relationship($_SESSION['UID'], $peer_uid); user_rel_update($_SESSION['UID'], $peer_uid, $peer_relationship, $peer_nickname); } $peer_user_display = format_user_name($user_peer['LOGON'], $user_peer['NICKNAME']); html_draw_top(array('title' => sprintf(gettext('User Relationship - %s'), $peer_user_display), 'class' => 'window_title')); $peer_relationship = user_get_relationship($_SESSION['UID'], $peer_uid); $peer_nickname = user_get_peer_nickname($_SESSION['UID'], $peer_uid); echo "<h1>", gettext("User Relationship"), html_style_image('separator'), "<a href=\"user_profile.php?webtag={$webtag}&uid={$peer_uid}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags($peer_user_display, true), "</a></h1>\n"; 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);
if ($admin_edit === true) { header_redirect("admin_user.php?webtag={$webtag}&uid={$uid}&profile_updated=true", gettext("Profile updated.")); exit; } else { header_redirect("edit_profile.php?webtag={$webtag}&uid={$uid}&profile_updated=true", gettext("Profile updated.")); exit; } } } } } if (is_array($profile_items_array) && sizeof($profile_items_array) > 0) { if ($admin_edit === true) { $user = user_get($uid); html_draw_top(sprintf('title=%s', sprintf(gettext("Admin - Edit Profile - %s"), format_user_name($user['LOGON'], $user['NICKNAME']))), 'class=window_title'); echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Edit Profile"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", format_user_name($user['LOGON'], $user['NICKNAME']), "</h1>\n"; } else { html_draw_top(sprintf('title=%s', gettext("My Controls - Edit Profile")), 'class=window_title'); echo "<h1>", gettext("Edit Profile"), "</h1>\n"; } if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { html_display_error_array($error_msg_array, '600', $admin_edit ? 'center' : 'left'); } else { if (isset($_GET['profile_updated'])) { html_display_success_msg(gettext("Profile updated."), '600', $admin_edit ? 'center' : 'left'); } } if ($admin_edit === true) { echo "<div align=\"center\">\n"; } echo "<br />\n";
if ($admin_edit === true) { header_redirect("admin_user.php?webtag={$webtag}&uid={$profile_uid}&profile_updated=true"); exit; } else { header_redirect("edit_profile.php?webtag={$webtag}&uid={$profile_uid}&profile_updated=true"); exit; } } } } } if (is_array($profile_items_array) && sizeof($profile_items_array) > 0) { if ($admin_edit === true) { $user = user_get($profile_uid); html_draw_top(array('title' => sprintf(gettext('Admin - Edit Profile - %s'), format_user_name($user['LOGON'], $user['NICKNAME'])), 'class' => 'window_title', 'js' => array('js/prefs.js'))); echo "<h1>", gettext("Admin"), html_style_image('separator'), gettext("Manage User"), html_style_image('separator'), format_user_name($user['LOGON'], $user['NICKNAME']), "</h1>\n"; } else { html_draw_top(array('title' => gettext("My Controls - Edit Profile"), 'class' => 'window_title')); echo "<h1>", gettext("Edit Profile"), "</h1>\n"; } if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { html_display_error_array($error_msg_array, '700', $admin_edit ? 'center' : 'left'); } else { if (isset($_GET['profile_updated'])) { html_display_success_msg(gettext("Profile updated."), '700', $admin_edit ? 'center' : 'left'); } } if ($admin_edit === true) { echo "<div align=\"center\">\n"; } echo "<br />\n";
echo " <ul>\n"; if ($forum_mods_array = mods_list_get_mods(0)) { foreach ($forum_mods_array as $forum_mod) { echo " <li><a href=\"user_profile.php?webtag={$webtag}&uid={$forum_mod['UID']}\" target=\"_blank\" class=\"popup 650x500\">"; echo word_filter_add_ob_tags(format_user_name($forum_mod['LOGON'], $forum_mod['NICKNAME']), true), "</a></li>\n"; } } else { echo " <li>", gettext("No moderators found"), "</li>\n"; } echo " </ul>\n"; echo " <h2>", gettext("Folder moderators:"), "</h2>"; echo " <ul>\n"; if ($folder_mods_array = mods_list_get_mods($fid)) { foreach ($folder_mods_array as $folder_mod) { echo " <li><a href=\"user_profile.php?webtag={$webtag}&uid={$folder_mod['UID']}\" target=\"_blank\" class=\"popup 650x500\">"; echo word_filter_add_ob_tags(format_user_name($folder_mod['LOGON'], $folder_mod['NICKNAME']), true), "</a></li>\n"; } } else { echo " <li>", gettext("No moderators found"), "</li>\n"; } echo " </ul>\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 " </table>\n"; echo " </td>\n";
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" : ''; }
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\" width=\"20\"> </td>\n"; echo " <td align=\"left\" class=\"subhead\" width=\"200\">", gettext("User"), "</td>\n"; echo " <td align=\"center\" class=\"subhead\" width=\"120\">", gettext("Total posts"), "</td>\n"; echo " <td align=\"center\" class=\"subhead\" width=\"120\">", gettext("Posts"), "</td>\n"; echo " <td align=\"center\" class=\"subhead\" width=\"120\">", gettext("Percent"), "</td>\n"; echo " <td align=\"center\" class=\"subhead\" width=\"120\">", gettext("Average"), "</td>\n"; echo " </tr>\n"; if (sizeof($user_stats_array['user_stats']) > 0) { foreach ($user_stats_array['user_stats'] as $user_stats) { echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\">", word_filter_add_ob_tags(format_user_name($user_stats['LOGON'], $user_stats['NICKNAME']), true), "</td>\n"; echo " <td align=\"center\">", user_get_post_count($user_stats['UID']), "</td>\n"; echo " <td align=\"center\">{$user_stats['POST_COUNT']}</td>\n"; echo " <td align=\"center\">", number_format(round(100 / $user_stats_array['post_count'] * $user_stats['POST_COUNT'], 2), 2, '.', ','), "%</td>\n"; echo " <td align=\"center\">", number_format(round($user_stats['POST_COUNT'] / $num_days, 2), 2, '.', ','), "</td>\n"; echo " </tr>\n"; } echo " <tr>\n"; echo " <td align=\"left\" colspan=\"6\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td colspan=\"6\" align=\"center\">", gettext("Total posts for this period"), ": {$user_stats_array['post_count']}</td>\n"; echo " </tr>\n"; } else { echo " <tr>\n"; echo " <td align=\"left\" colspan=\"6\"> </td>\n";
echo " <td align=\"center\">", form_submit("post_count_submit", gettext("Confirm")), " ", form_submit("cancel", gettext("Cancel")), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo "</form>\n"; echo "</div>\n"; html_draw_bottom(); exit; } } } } } } } html_draw_top(array('title' => $page_title, 'class' => 'window_title', 'main_css' => 'admin.css')); echo "<h1>", gettext("Admin"), html_style_image('separator'), gettext("Manage User"), html_style_image('separator'), word_filter_add_ob_tags(format_user_name($user['LOGON'], $user['NICKNAME']), true), "</h1>\n"; if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { html_display_error_array($error_msg_array, '800', 'center'); } else { if (isset($success_html) && strlen(trim($success_html)) > 0) { html_display_success_msg($success_html, '800', 'center'); } else { if (isset($_GET['profile_updated'])) { html_display_success_msg(gettext("Profile updated."), '800', 'center'); } else { if (isset($_GET['signature_updated'])) { html_display_success_msg(gettext("Signature Updated"), '800', 'center'); } else { if (isset($_GET['approved'])) { html_display_success_msg(gettext("Successfully approved user"), '800', 'center'); } else {