function html_guest_error() { $frame_top_target = html_get_top_frame_name(); $webtag = get_webtag(); forum_check_webtag_available($webtag); $final_uri = sprintf("logon.php?webtag=%s&final_uri=%s", $webtag, rawurlencode(get_request_uri(true, false))); $available_popup_files_preg = implode("|^", array_map('preg_quote_callback', get_available_popup_files())); $available_support_pages_preg = implode("|^", array_map('preg_quote_callback', get_available_support_files())); if (preg_match("/^{$available_popup_files_preg}/", $final_uri) > 0) { html_draw_error(gettext("Sorry, you need to be logged in to use this feature."), null, 'post', array('close_popup' => gettext("Close"))); } else { if (preg_match("/^{$available_support_pages_preg}/", $final_uri) > 0) { html_draw_error(gettext("Sorry, you need to be logged in to use this feature.")); } else { html_draw_error(gettext("Sorry, you need to be logged in to use this feature."), html_get_forum_file_path('logout.php'), 'post', array('submit' => gettext("Login now"), 'register' => gettext("Register")), array('final_uri' => $final_uri), $frame_top_target); } } }
function forum_restricted_message() { $final_uri = basename(get_request_uri()); $popup_files_preg = get_available_js_popup_files_preg(); if (preg_match("/^{$popup_files_preg}/", $final_uri) > 0) { $forum_owner_link_target = "_blank"; } else { $forum_owner_link_target = html_get_top_frame_name(); } if ($restricted_message = forum_get_setting('restricted_message')) { html_draw_error(fix_html($restricted_message), '600', 'center'); } else { $forum_name = forum_get_setting('forum_name', null, 'A Beehive Forum'); if (!($forum_owner_uid = forum_get_setting('owner_uid'))) { html_draw_error(sprintf(gettext("You do not have access to %s"), htmlentities_array($forum_name))); } $webtag = get_webtag(); $forum_owner_pm_link = sprintf('pm_write.php?webtag=%s&uid=%s', $webtag, $forum_owner_uid); $forum_owner_link = sprintf('<a href="index.php?webtag=%s&final_uri=%s">%s</a>', $webtag, rawurlencode($forum_owner_pm_link), gettext('Forum Owner')); $apply_for_access_text = sprintf(gettext("To apply for access please contact the %s."), $forum_owner_link); html_draw_error(sprintf(gettext("You do not have access to %s. To apply for access please contact the %s"), htmlentities_array($forum_name), $apply_for_access_text)); } }
function install_incomplete() { echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\n"; echo "<head>\n"; echo "<title>Beehive Forum ", BEEHIVE_VERSION, " - Installation</title>\n"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n"; echo html_include_css(html_get_forum_file_path('styles/default/style.css')), "\n"; echo "</head>\n"; echo "<body>\n"; echo "<h1>Beehive Forum Installation Error</h1>\n"; echo "<br />\n"; echo "<div align=\"center\">\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"400\">\n"; echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"box\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"500\">\n"; echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\" class=\"subhead\">Installation Incomplete</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\">Your Beehive Forum is not installed correctly. Click the install button below to start the installation.</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"; echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <form accept-charset=\"utf-8\" method=\"get\" action=\"./install/index.php\" target=\"", html_get_top_frame_name(), "\">\n"; echo " <input type=\"hidden\" name=\"force_install\" value=\"yes\" />\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"500\">\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"500\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Install\" class=\"button\" /></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </form>\n"; echo "</div>\n"; echo "</body>\n"; echo "</html>\n"; exit; }
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 " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <br />\n"; $forum_name = forum_get_setting('forum_name', null, 'A Beehive Forum'); $frame_top_target = html_get_top_frame_name(); $default_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\" target=\"%3\$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, $frame_top_target); if (!isset($forum_global_settings['forum_rules_message'])) { $forum_global_settings['forum_rules_message'] = $default_forum_rules; } 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\" colspan=\"3\">", gettext("Forum Rules"), "</td>\n"; echo " </tr>\n"; echo " <tr>\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" : ''; }
function logon_draw_form($logon_options) { $webtag = get_webtag(); forum_check_webtag_available($webtag); // Make sure logon form argument is valid. if (!is_numeric($logon_options)) { $logon_options = LOGON_FORM_DEFAULT; } // Check for previously failed logon. if (isset($_GET['logout_success']) && $_GET['logout_success'] == 'true') { html_display_success_msg(gettext("You have successfully logged out."), '500', 'center'); } else { if (isset($_GET['logon_failed']) && !($logon_options & LOGON_FORM_SESSION_EXPIRED)) { html_display_error_msg(gettext("The username or password you supplied is not valid."), '500', 'center'); } } // Get the original requested page url. $request_uri = get_request_uri(); // If the request is for logon.php then we are performing // a normal login, otherwise potentially a failed session. if (stristr($request_uri, 'logon.php')) { echo " <form accept-charset=\"utf-8\" name=\"logonform\" method=\"post\" action=\"{$request_uri}\" target=\"", html_get_top_frame_name(), "\">\n"; echo " ", form_csrf_token_field(), "\n"; } else { echo " <form accept-charset=\"utf-8\" name=\"logonform\" method=\"post\" action=\"{$request_uri}\" target=\"_self\">\n"; echo " ", form_csrf_token_field(), "\n"; } // Check for any post data that we need to include in the form. unset($_POST['user_logon'], $_POST['user_password'], $_POST['logon'], $_POST['webtag'], $_POST['register']); // Add any post data into the form. 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 " <br />\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"325\">\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("Logon"), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"right\" width=\"90\">", gettext("Username"), ":</td>\n"; echo " <td align=\"left\">", form_input_text('user_logon', null, 24, 32, null, 'bhinputlogon'), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"right\" width=\"90\">", gettext("Password"), ":</td>\n"; echo " <td align=\"left\">", form_input_password('user_password', null, 24, 32, null, 'bhinputlogon'), "</td>\n"; echo " </tr>\n"; if (!($logon_options & LOGON_FORM_HIDE_TICKBOX) && !($logon_options & LOGON_FORM_SESSION_EXPIRED)) { echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\"><hr class=\"bhseparatorlogon\" /></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"right\" width=\"90\">", form_checkbox('user_remember', 'Y', null, html_get_cookie('user_logon') && html_get_cookie('user_token')), "</td>\n"; echo " <td align=\"left\"><label for=\"user_remember\">", gettext("Remember me"), "</label></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\"><span class=\"bhinputlogon_warning\">", gettext("Not recommended for shared computers"), "</span></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"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"center\" colspan=\"2\">", form_submit('logon', gettext("Logon")), "</td>\n"; echo " </tr>\n"; echo " </table>\n"; echo "</form>\n"; echo "<br />\n"; if (!($logon_options & LOGON_FORM_HIDE_LINKS)) { echo "<hr class=\"bhlogonseparator\" />\n"; if (user_guest_enabled()) { echo "<form accept-charset=\"utf-8\" name=\"guest\" action=\"logon.php?webtag={$webtag}\" method=\"post\" target=\"", html_get_top_frame_name(), "\">\n"; echo " ", form_csrf_token_field(), "\n"; echo " <p>", sprintf(gettext("Enter as a %s"), form_submit('guest_logon', gettext("Guest"))), "</p>\n"; echo "</form>\n"; } if (isset($_GET['final_uri']) && strlen(trim($_GET['final_uri'])) > 0) { $available_files_preg = implode("|^", array_map('preg_quote_callback', get_available_files())); if (preg_match("/^{$available_files_preg}/u", trim($_GET['final_uri'])) > 0) { $final_uri = href_cleanup_query_keys($_GET['final_uri']); } } if (isset($final_uri)) { $final_uri = rawurlencode($final_uri); $register_link = rawurlencode("register.php?webtag={$webtag}&final_uri={$final_uri}"); $forgot_pw_link = rawurlencode("forgot_pw.php?webtag={$webtag}&final_uri={$final_uri}"); echo "<p>", sprintf(gettext("Don't have an account? %s"), "<a href=\"index.php?webtag={$webtag}&final_uri={$register_link}\" target=\"" . html_get_top_frame_name() . "\">" . gettext("Register now") . "</a>") . "</p>\n"; echo "<hr class=\"bhlogonseparator\" />\n"; echo "<h2>", gettext("Problems logging on?"), "</h2>\n"; echo "<p><a href=\"logon.php?webtag={$webtag}&delete_cookie=yes&final_uri={$final_uri}\" target=\"", html_get_top_frame_name(), "\">", gettext("Delete Cookies"), "</a></p>\n"; echo "<p><a href=\"index.php?webtag={$webtag}&final_uri={$forgot_pw_link}\" target=\"", html_get_top_frame_name(), "\">", gettext("Forgotten your password?"), "</a></p>\n"; } else { echo "<p>", sprintf(gettext("Don't have an account? %s"), "<a href=\"index.php?webtag={$webtag}&final_uri=register.php%3Fwebtag%3D{$webtag}\" target=\"" . html_get_top_frame_name() . "\">" . gettext("Register now") . "</a>"), "</p>\n"; echo "<hr class=\"bhlogonseparator\" />\n"; echo "<h2>", gettext("Problems logging on?"), "</h2>\n"; echo "<p><a href=\"logon.php?webtag={$webtag}&delete_cookie=yes\" target=\"", html_get_top_frame_name(), "\">", gettext("Delete Cookies"), "</a></p>\n"; echo "<p><a href=\"index.php?webtag={$webtag}&final_uri=forgot_pw.php%3Fwebtag%3D{$webtag}\" target=\"", html_get_top_frame_name(), "\">", gettext("Forgotten your password?"), "</a></p>\n"; } echo "<hr class=\"bhlogonseparator\" />\n"; echo "<h2>", gettext("Using a mobile device?"), "</h2>\n"; echo "<p><a href=\"index.php?webtag={$webtag}&view=mobile\" target=\"", html_get_top_frame_name(), "\">", gettext("Mobile version"), "</a></p>\n"; } }
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; }
foreach ($forums_array['forums_array'] as $forum_data) { echo " <tr>\n"; echo " <td valign=\"top\" align=\"center\" width=\"1%\">", form_checkbox("t_delete[{$forum_data['FID']}]", "Y"), "</td>\n"; echo " <td align=\"left\"><a href=\"admin_forums.php?webtag={$webtag}&fid={$forum_data['FID']}&page={$page}\" title=\"", gettext("Edit Forum"), "\">{$forum_data['WEBTAG']}</a></td>\n"; echo " <td align=\"left\"><a href=\"index.php?webtag={$forum_data['WEBTAG']}\" title=\"", sprintf(gettext("Visit Forum: %s"), $forum_data['FORUM_NAME']), "\" target=\"_blank\">{$forum_data['FORUM_NAME']}</a></td>\n"; if (isset($forum_data['MESSAGES'])) { echo " <td align=\"left\">", format_number($forum_data['MESSAGES']), " ", $forum_data['MESSAGES'] > 1 ? gettext("Messages") : gettext("Message"), "</td>\n"; } else { echo " <td align=\"left\">", gettext("Unknown"), "</td>\n"; } if (isset($forum_data['ACCESS_LEVEL']) && in_array($forum_data['ACCESS_LEVEL'], array_keys($forum_access_level_array))) { echo " <td align=\"left\">{$forum_access_level_array[$forum_data['ACCESS_LEVEL']]}</td>\n"; } else { echo " <td align=\"left\">", gettext("Unknown"), "</td>\n"; } echo " <td align=\"left\" style=\"white-space: nowrap\"><a href=\"index.php?webtag={$forum_data['WEBTAG']}&final_uri=admin_forum_settings.php%3Fwebtag%3D{$forum_data['WEBTAG']}\" target=\"", html_get_top_frame_name(), "\">", html_style_image('edit', gettext("Forum Settings")), "</a> "; if (isset($forum_data['DEFAULT_FORUM']) && $forum_data['DEFAULT_FORUM'] == 1) { echo "<a href=\"admin_forums.php?webtag={$webtag}&page={$page}&default=0\">", html_style_image('default_forum', gettext("Unset Default")), "</a>\n"; } else { echo "<a href=\"admin_forums.php?webtag={$webtag}&page={$page}&default={$forum_data['FID']}\">", html_style_image('set_default_forum', gettext("Make Default")), "</a>\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"; echo " </tr>\n";
function adsense_output_html() { static $adsense_displayed = false; $webtag = get_webtag(); forum_check_webtag_available($webtag); if ($adsense_displayed === false) { if (adsense_publisher_id()) { $adsense_display_users = adsense_display_users(); $ad_type = 'medium'; $ad_width = 468; $ad_height = 60; adsense_get_banner_type($ad_type, $ad_width, $ad_height); echo "<div class=\"google_adsense_container\" style=\"width: 100%; text-align: center\">\n"; echo " <div style=\"width: {$ad_width}px; margin: auto\">\n"; echo " <script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script>\n"; if (!session::logged_in() && $adsense_display_users == ADSENSE_DISPLAY_GUESTS) { echo " <div class=\"google_adsense_register_note\"><a href=\"index.php?webtag={$webtag}&final_uri=register.php%3Fwebtag%3D{$webtag}\" target=\"", html_get_top_frame_name(), "\">", gettext("Register to remove these adverts."), "</a></div>\n"; } echo " </div>\n"; echo "</div>\n"; $adsense_displayed = true; } } }
echo "<span class=\"nav_messages\"><a href=\"discussion.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Messages"), "</a></span> | \n"; if (forum_get_setting('ajax_chat_enabled', 'Y')) { if ($ajax_chat_online_user_count = ajax_chat_online_user_count()) { echo "<span class=\"nav_chat\"><a href=\"chat/index.php\" target=\"_blank\">", gettext("Chat"), " (", $ajax_chat_online_user_count, ")</a></span> | \n"; } else { echo "<span class=\"nav_chat\"><a href=\"chat/index.php\" target=\"_blank\">", gettext("Chat"), " (0)</a></span> | \n"; } } if (forum_get_setting('show_links', 'Y')) { echo "<span class=\"nav_links\"><a href=\"links.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Links"), "</a></span> | \n"; } if (forum_get_setting('show_pms', 'Y')) { echo " <span class=\"nav_inbox\"><a href=\"pm.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Inbox"), "</a></span> | \n"; } if (forum_check_webtag_available($webtag)) { echo "<span class=\"nav_mycontrols\"><a href=\"user.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("My Controls"), "</a></span> | \n"; } if (forums_get_available_count() > 1 || !forum_get_default()) { echo "<span class=\"nav_myforums\"><a href=\"forums.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("My Forums"), "</a></span> | \n"; } if (session::check_perm(USER_PERM_FORUM_TOOLS, 0) || session::check_perm(USER_PERM_ADMIN_TOOLS, 0) || session::get_folders_by_perm(USER_PERM_FOLDER_MODERATE)) { echo "<span class=\"nav_admin\"><a href=\"admin.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Admin"), "</a></span> | \n"; } echo "<span class=\"nav_logout\"><a href=\"logout.php?webtag={$webtag}\" target=\"", html_get_top_frame_name(), "\">", gettext("Logout"), " : ", $_SESSION['LOGON'], "</span></a>\n"; } echo "</div>\n"; echo "<div class=\"navright\">\n"; echo forum_links_draw_dropdown('openForumLink'); echo "</div>\n"; echo "<div style=\"clear: both\"></div>\n"; html_draw_bottom();
function message_display($tid, $message, $msg_count, $first_msg, $folder_fid, $in_list = true, $closed = false, $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(); forum_check_webtag_available($webtag); if (!isset($_SESSION['UID']) || !is_numeric($_SESSION['UID'])) { return; } if (isset($_SESSION['POSTS_PER_PAGE']) && is_numeric($_SESSION['POSTS_PER_PAGE'])) { $posts_per_page = max(min($_SESSION['POSTS_PER_PAGE'], 30), 10); } else { $posts_per_page = 20; } if (isset($_SESSION['REPLY_QUICK']) && $_SESSION['REPLY_QUICK'] == 'Y') { $quick_reply = 'Y'; } else { $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 ($_SESSION['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 (!$is_preview && !isset($message['APPROVED'])) { message_display_approval_req($tid, $message['PID'], $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page); return; } if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED_COMPLETELY) { message_display_deleted($tid, $message['PID'], $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page); 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) { message_display_deleted($tid, $message['PID'], $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page); return; } } if (!$is_preview && isset($message['MOVED_TID']) && isset($message['MOVED_PID'])) { message_display_moved($tid, $message['PID'], $message, $in_list, $is_preview, $first_msg, $msg_count, $posts_per_page); return; } // Add emoticons/WikiLinks and ignore signature ---------------------------- if (isset($_SESSION['IMAGES_TO_LINKS']) && $_SESSION['IMAGES_TO_LINKS'] == 'Y') { $message['CONTENT'] = message_images_to_links($message['CONTENT']); } if (!$is_poll || isset($message['PID']) && $message['PID'] > 1) { $message['CONTENT'] = message_apply_formatting($message['CONTENT'], isset($message['RELATIONSHIP']) && ($message['RELATIONSHIP'] & USER_IGNORED_SIG) > 0 || !$show_sigs); } // Check for words that should be filtered --------------------------------- if (!$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 = sprintf('/(%s)/i', implode('|', array_map('preg_quote_callback', $highlight_array))); $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_callback($highlight_pattern, 'search_highlight_callback', $message_parts[$i]); } } $message['CONTENT'] = implode("", $message_parts); } if ($in_list && isset($message['PID'])) { echo "<div align=\"center\" class=\"message\" id=\"message_{$tid}_{$message['PID']}\">\n"; } else { echo "<div align=\"center\" class=\"message\">\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=\"message_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 (isset($message['FROM_UID'])) { 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['FROM_LOGON'], $message['FROM_NICKNAME']), true), "</a> </span>"; } else { echo word_filter_add_ob_tags(format_user_name($message['FROM_LOGON'], $message['FROM_NICKNAME']), true), " </span>"; } if (isset($_SESSION['SHOW_AVATARS']) && $_SESSION['SHOW_AVATARS'] == 'Y') { if (isset($message['AVATAR_URL']) && filter_var($message['AVATAR_URL'], FILTER_VALIDATE_URL)) { echo html_style_image('profile_image profile_image_small', format_user_name($message['FROM_LOGON'], $message['FROM_NICKNAME']), null, array('background-image' => sprintf("url('%s')", $message['AVATAR_URL']))); } else { if (isset($message['AVATAR_AID']) && is_numeric($message['AVATAR_AID'])) { $attachment = attachments_get_by_aid($message['AVATAR_AID']); if (($profile_picture_href = attachments_make_link($attachment, false, false, false, false)) !== false) { echo html_style_image('profile_image profile_image_small', format_user_name($message['FROM_LOGON'], $message['FROM_NICKNAME']), null, array('background-image' => sprintf("url('%s&profile_picture')", $profile_picture_href))); } } } } // 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 && (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED)) { $message['RELATIONSHIP'] -= USER_IGNORED; } 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 (isset($message['ANON_LOGON']) && $message['ANON_LOGON'] > USER_ANON_DISABLED || !isset($message['USER_ACTIVE']) || is_null($message['USER_ACTIVE'])) { echo html_style_image('status_offline', gettext("Inactive / Offline")), " "; } else { echo html_style_image('status_online', gettext("Online")), " "; } if (isset($message['FROM_UID']) && isset($message['THREAD_BY_UID']) && $message['FROM_UID'] == $message['THREAD_BY_UID'] && $first_msg > 1) { echo html_style_image('thread_starter', gettext("Thread Starter")), " "; } echo "</td>\n"; echo " <td width=\"1%\" align=\"right\" style=\"white-space: nowrap\"><span class=\"postinfo\">"; if (!$is_preview && $_SESSION['UID'] > 0 && isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED) { echo "<b>", gettext("Ignored message"), "</b>"; } else { if ($in_list) { if ($from_user_permissions & USER_PERM_WORMED) { echo "<b>", gettext("Wormed user"), "</b> "; } if (isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED_SIG) { echo "<b>", gettext("Ignored signature"), "</b> "; } echo format_date_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\">"; if (isset($message['RECIPIENTS']) && sizeof($message['RECIPIENTS']) > 0) { foreach ($message['RECIPIENTS'] as $recipient) { if (isset($recipient['RELATIONSHIP']) && $recipient['RELATIONSHIP'] & USER_IGNORED_COMPLETELY) { continue; } echo "<span class=\"posttofrom\"><a href=\"user_profile.php?webtag={$webtag}&uid={$recipient['UID']}\" target=\"_blank\" class=\"popup 650x500\">"; echo word_filter_add_ob_tags(format_user_name($recipient['LOGON'], $recipient['NICKNAME']), true), "</a> </span>\n"; if (isset($_SESSION['SHOW_AVATARS']) && $_SESSION['SHOW_AVATARS'] == 'Y') { if (isset($recipient['AVATAR_URL']) && filter_var($recipient['AVATAR_URL'], FILTER_VALIDATE_URL)) { echo html_style_image('profile_image profile_image_small', format_user_name($recipient['LOGON'], $recipient['NICKNAME']), null, array('background-image' => sprintf("url('%s')", $recipient['AVATAR_URL']))); } else { if (isset($recipient['AVATAR_AID']) && is_numeric($recipient['AVATAR_AID'])) { $attachment = attachments_get_by_aid($recipient['AVATAR_AID']); if (($profile_picture_href = attachments_make_link($attachment, false, false, false, false)) !== false) { echo html_style_image('profile_image profile_image_small', format_user_name($recipient['LOGON'], $recipient['NICKNAME']), null, array('background-image' => sprintf("url('%s&profile_picture')", $profile_picture_href))); } } } } if (isset($recipient['ANON_LOGON']) && $recipient['ANON_LOGON'] > USER_ANON_DISABLED || !isset($recipient['USER_ACTIVE']) || is_null($recipient['USER_ACTIVE'])) { echo html_style_image('status_offline', gettext("Inactive / Offline")), " "; } else { echo html_style_image('status_online', gettext("Online")), " "; } if (isset($recipient['UID']) && isset($message['THREAD_BY_UID']) && $recipient['UID'] == $message['THREAD_BY_UID'] && $first_msg > 1) { echo html_style_image('thread_starter', gettext("Thread Starter")), " "; } if (isset($recipient['VIEWED']) && $recipient['VIEWED'] > 0) { echo html_style_image('post_read', sprintf(gettext("Read: %s"), format_date_time($recipient['VIEWED']))), " "; } else { if ($is_preview == false) { echo html_style_image('post_unread', gettext("Unread Message")), " "; } else { echo " "; } } } } else { echo gettext('ALL'); } echo "</span></td>\n"; echo " <td align=\"right\" style=\"white-space: nowrap\"><span class=\"postinfo\">"; if (!$is_preview && $_SESSION['UID'] > 0 && isset($message['RELATIONSHIP']) && $message['RELATIONSHIP'] & USER_IGNORED) { 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']}&return_msg={$tid}.{$first_msg}\" 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\">", html_style_image('poll', "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 ($is_preview || !isset($message['RELATIONSHIP']) || !($message['RELATIONSHIP'] & USER_IGNORED)) { echo " <tr>\n"; echo " <td align=\"left\">\n"; echo " <table class=\"message_postbody\" 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 overflow_content\" align=\"left\">{$message['CONTENT']}</td>\n"; echo " </tr>\n"; 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 " <tr>\n"; echo " <td class=\"postbody\" align=\"left\"><p class=\"edit_text\">", sprintf(gettext("EDITED: %s by %s"), format_date_time($message['EDITED']), $edit_user), "</p></td>\n"; echo " </tr>\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 " <tr>\n"; echo " <td class=\"postbody\" align=\"left\"><p class=\"approved_text\">", sprintf(gettext("APPROVED: %s by %s"), format_date_time($message['APPROVED']), $approved_user), "</p></td>\n"; echo " </tr>\n"; } } if (isset($message['ATTACHMENTS']) && sizeof($message['ATTACHMENTS']) > 0) { if (($attachments_array = attachments_get($message['FROM_UID'], $message['ATTACHMENTS'])) !== false) { echo " <tr>\n"; echo " <td class=\"postbody\" align=\"left\">\n"; echo " <p><b>", gettext("Attachments"), ":</b><br />\n"; foreach ($attachments_array as $attachment) { echo attachments_make_link($attachment), $attachment['thumbnail'] == 'N' ? "<br />\n" : "\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"; echo " <td align=\"left\" width=\"25%\">"; echo " <div class=\"message_vote_form\" data-msg=\"{$tid}.{$message['PID']}\">\n"; echo " ", message_get_vote_form_html($message), "\n"; echo " </div>\n"; 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 "", html_style_image('quick_reply', "Quick Reply"), "\n"; echo "<a href=\"Javascript:void(0)\" data-msg=\"{$tid}.{$message['PID']}\" target=\"_self\" class=\"quick_reply_link\">", gettext("Quick Reply"), "</a>\n"; } else { echo "", html_style_image('post', "Reply"), ""; echo " <a href=\"post.php?webtag={$webtag}&reply_to={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" target=\"_parent\" id=\"reply_{$message['PID']}\">", gettext("Reply"), "</a>"; } echo " ", html_style_image('quote_disabled', gettext("Quote"), "quote_img_{$message['PID']}"); echo " <a href=\"post.php?webtag={$webtag}&reply_to={$tid}.{$message['PID']}&quote_list={$message['PID']}&return_msg={$tid}.{$first_msg}\" target=\"_parent\" title=\"", gettext("Quote"), "\" id=\"quote_{$message['PID']}\" data-pid=\"{$message['PID']}\">", gettext("Quote"), "</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 && $message['PID'] == 1) { if (!poll_is_closed($tid) || $perm_is_moderator) { echo " ", html_style_image('edit', "Edit Poll"), ""; echo " <a href=\"edit_poll.php?webtag={$webtag}&msg={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" target=\"_parent\">", gettext("Edit Poll"), "</a>\n"; } } else { echo " ", html_style_image('edit', "Edit"), ""; echo " <a href=\"edit.php?webtag={$webtag}&msg={$tid}.{$message['PID']}&return_msg={$tid}.{$first_msg}\" target=\"_parent\">", gettext("Edit"), "</a>"; } } } } else { echo " "; } echo "</td>\n"; echo " <td align=\"right\" style=\"white-space: nowrap\">\n"; echo " <span class=\"post_options\" id=\"post_options_{$tid}_{$first_msg}_{$message['PID']}\">\n"; echo " ", gettext("More"), " ", html_style_image('post_options', gettext("More"), 'post_options'), "\n"; echo " </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 (forum_get_setting('ajax_chat_enabled', 'Y')) { echo "<a href=\"chat/index.php\" target=\"", html_get_frame_name('main'), "\">", gettext("Chat"), "</a> | \n"; } if (forum_get_setting('show_links', 'Y')) { echo "<a href=\"links.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Links"), "</a> | \n"; } } if (forum_get_setting('show_pms', 'Y')) { echo "<a href=\"pm.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Inbox"), "</a> | \n"; } if (forum_check_webtag_available($webtag)) { echo "<a href=\"user.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("My Controls"), "</a> | \n"; } if (forums_get_available_count() > 1 || !forum_check_webtag_available($webtag)) { echo "<a href=\"forums.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("My Forums"), "</a> | \n"; } if (session::check_perm(USER_PERM_FORUM_TOOLS, 0) || session::check_perm(USER_PERM_ADMIN_TOOLS, 0) || session::get_folders_by_perm(USER_PERM_FOLDER_MODERATE)) { echo "<a href=\"admin.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Admin"), "</a> | \n"; } if (!session::logged_in()) { echo "<a href=\"index.php?webtag={$webtag}&final_uri=logon.php%3Fwebtag%3D{$webtag}\" target=\"", html_get_top_frame_name(), "\">", gettext("Login"), "</a> | \n"; echo "<a href=\"register.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Register"), "</a>\n"; } else { echo "<a href=\"logout.php?webtag={$webtag}\" target=\"", html_get_top_frame_name(), "\">", gettext("Logout"), " : ", session::get_value('LOGON'), "</a>\n"; } echo "</div>\n"; echo "<div class=\"navright\">\n"; echo forum_links_draw_dropdown('openForumLink'); echo "</div>\n"; echo "<div style=\"clear: both\"></div>\n"; html_draw_bottom();