function emoticons_initialise() { static $emoticons_array = false; if (!is_array($emoticons_array) || sizeof($emoticons_array) < 1) { // Get the user's emoticon set from their sesion. // Fall back to using the forum default or Beehive default. if (($user_emots = session::get_value('EMOTICONS')) === false) { $user_emots = forum_get_setting('default_emoticons', null, 'default'); } // Initialize the array incase it's not been done in // the definitions.php file by the emoticon authors. $emoticon = array(); // If the user has emoticons set to none (hides them completely) // we need to load *all* the emoticon definition files so we can // strip them out. // // If the user has a set specified we load only that set. if ($user_emots == 'none') { if ($dir = @opendir('emoticons')) { while (($file = @readdir($dir)) !== false) { if ($file != '.' && $file != '..' && @is_dir("emoticons/{$file}")) { if (@file_exists("emoticons/{$file}/definitions.php")) { include "emoticons/{$file}/definitions.php"; } } } } } else { if (@file_exists("emoticons/{$user_emots}/definitions.php")) { include "emoticons/{$user_emots}/definitions.php"; } } // Check that we have successfully loaded the emoticons. // If we have we need to process them a bit, otherwise // we bail out. if (sizeof($emoticon) > 0) { // Reverse the order of the keys and reset the // internal pointer. krsort($emoticon); reset($emoticon); // Set up our emoticon text array for display // of the selection box on post.php etc. $emoticon_text = array(); // Group similar named emoticons together foreach ($emoticon as $key => $value) { $emoticon_text[$value][] = $key; } // Sort our array by key length so we don't have // the match text for emoticons inadvertantly matching // the wrong emoticon. uksort($emoticon, 'sort_by_length_callback'); // Set our vars for the convert function $emoticons_array = $emoticon; } } return $emoticons_array; }
function lang_detect() { if ($language = session::get_value('LANGUAGE')) { if (lang_set($language)) { return $language; } } $languages = array(); if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $accepted = preg_split('/,\\s*/', $_SERVER['HTTP_ACCEPT_LANGUAGE']); foreach ($accepted as $accept) { $matches_array = array(); if (!preg_match('/^([a-z]{1,8}(?:[-_][a-z]{1,8})*)(?:;\\s*q=(0(?:\\.[0-9]{1,3})?|1(?:\\.0{1,3})?))?$/i', $accept, $matches_array)) { continue; } $quality = isset($matches_array[2]) ? (double) $matches_array[2] : 1.0; $countries = explode('-', $matches_array[1]); $region = array_shift($countries); $countries2 = explode('_', $region); $region = array_shift($countries2); foreach ($countries as $country) { $languages[$region . '_' . mb_strtoupper($country)] = $quality; } foreach ($countries2 as $country) { $languages[$region . '_' . mb_strtoupper($country)] = $quality; } if (!isset($languages[$region]) || $languages[$region] < $quality) { $languages[$region] = $quality; } } } foreach (array_keys($languages) as $language) { if (lang_set($language)) { return $language; } } return lang_set('en_GB'); }
if (preg_match("/^links_detail.php/u", $ret) > 0) { header_redirect("links_detail.php?webtag={$webtag}&lid={$lid}&link_approve_success={$lid}"); exit; } else { html_draw_top(sprintf('title=%s', gettext("Approve Link")), 'class=window_title'); html_display_msg(gettext("Approve Link"), sprintf(gettext("Successfully approved link"), $lid), "admin_link_approve.php", 'get', array('back' => gettext("Back")), array('ret' => $ret), '_self', 'center'); html_draw_bottom(); exit; } } else { $error_msg_array[] = gettext("Link approval failed"); } } else { if (isset($_POST['delete'])) { if (links_delete($lid)) { if (session::check_perm(USER_PERM_FOLDER_MODERATE, 0) && $link['UID'] != session::get_value('UID')) { admin_add_log_entry(DELETE_LINK, array($lid)); } if (preg_match("/^links_detail.php/u", $ret) > 0) { header_redirect("links_detail.php?webtag={$webtag}&lid={$lid}&link_approve_success={$lid}"); exit; } else { html_draw_top(sprintf('title=%s', gettext("Approve Link")), 'class=window_title'); html_display_msg(gettext("Approve Link"), sprintf(gettext("Successfully deleted link"), $lid), "admin_link_approve.php", 'get', array('back' => gettext("Back")), array('ret' => $ret), '_self', 'center'); html_draw_bottom(); exit; } } else { $error_msg_array[] = gettext("Error deleting link"); } }
function format_date($time) { if (($timezone_id = session::get_value('TIMEZONE')) === false) { $timezone_id = forum_get_setting('forum_timezone', null, 27); } if (($gmt_offset = session::get_value('GMT_OFFSET')) === false) { $gmt_offset = forum_get_setting('forum_gmt_offset', null, 0); } if (($dst_offset = session::get_value('DST_OFFSET')) === false) { $dst_offset = forum_get_setting('forum_dst_offset', null, 0); } if (($dl_saving = session::get_value('DL_SAVING')) === false) { $dl_saving = forum_get_setting('forum_dl_saving', null, 'N'); } // Calculate $time in user's timezone. $time = $time + $gmt_offset * HOUR_IN_SECONDS; // Calculate the current time in user's timezone. $current_time = time() + $gmt_offset * HOUR_IN_SECONDS; // Check for DST changes if ($dl_saving == 'Y' && timestamp_is_dst($timezone_id, $gmt_offset)) { // Ammend the $time to include DST $time = $time + $dst_offset * HOUR_IN_SECONDS; // Ammend the current time to include DST $current_time = $current_time + $dst_offset * HOUR_IN_SECONDS; } // Get the year of $time $time_year = gmdate("Y", $time); // Get the year for the current time $current_year = gmdate('Y', $current_time); // Only show the year if it is different to the current year if ($time_year != $current_year) { if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { $format = strftime('%#d %b %Y', $time); } else { $format = strftime('%e %b %Y', $time); } } else { if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { $format = strftime('%#d %b', $time); } else { $format = strftime('%e %b', $time); } } return $format; }
if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) { echo " <tr>\n"; echo " <td align=\"left\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"><h2>", gettext("Admin"), "</h2></td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">", form_checkbox("closed", "Y", gettext("Close for posting"), isset($closed) ? $closed == 'Y' : false), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">", form_checkbox("sticky", "Y", gettext("Make sticky"), isset($sticky) ? $sticky == 'Y' : false), "</td>\n"; echo " </tr>\n"; } echo " </table>\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 " <br />\n"; echo " <table width=\"196\" class=\"messagefoot\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Emoticons"), "</td>\n"; if (($page_prefs & POST_EMOTICONS_DISPLAY) > 0) { echo " <td class=\"subhead\" align=\"right\">", form_submit_image('hide.png', 'emots_toggle', 'hide', '', 'button_image toggle_button', '', 'button_image toggle_button'), " </td>\n"; } else { echo " <td class=\"subhead\" align=\"right\">", form_submit_image('show.png', 'emots_toggle', 'show', '', 'button_image toggle_button', '', 'button_image toggle_button'), " </td>\n"; } echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" colspan=\"2\">\n";
USA ======================================================================*/ // Bootstrap require_once 'boot.php'; // Includes required by this page. require_once BH_INCLUDE_PATH . 'cache.inc.php'; require_once BH_INCLUDE_PATH . 'constants.inc.php'; require_once BH_INCLUDE_PATH . 'header.inc.php'; require_once BH_INCLUDE_PATH . 'html.inc.php'; require_once BH_INCLUDE_PATH . 'lang.inc.php'; require_once BH_INCLUDE_PATH . 'logon.inc.php'; require_once BH_INCLUDE_PATH . 'session.inc.php'; // Don't cache this page - fixes problems with Opera. cache_disable(); // Get the user's saved left frame width. if (($left_frame_width = session::get_value('LEFT_FRAME_WIDTH')) === false) { $left_frame_width = 280; } html_draw_top('frame_set_html', 'pm_popup_disabled'); $frameset = new html_frameset_cols('start', "{$left_frame_width},*"); if (isset($_GET['left']) && $_GET['left'] == "threadlist") { $frameset->html_frame("thread_list.php?webtag={$webtag}", html_get_frame_name('left')); } else { $frameset->html_frame("start_left.php?webtag={$webtag}", html_get_frame_name('left')); } if (isset($_GET['show']) && $_GET['show'] == "visitors") { $frameset->html_frame("visitor_log.php?webtag={$webtag}", html_get_frame_name('right')); } else { $frameset->html_frame("start_main.php?webtag={$webtag}", html_get_frame_name('right')); } $frameset->output_html();
function stats_get_post_tallys($start_timestamp, $end_timestamp) { if (!($db = db::get())) { return false; } if (!is_numeric($start_timestamp)) { return false; } if (!is_numeric($end_timestamp)) { return false; } if (!($table_prefix = get_table_prefix())) { return false; } $post_tallys = array('user_stats' => array(), 'post_count' => 0); $uid = session::get_value('UID'); $post_start_datetime = date(MYSQL_DATETIME, $start_timestamp); $post_end_datetime = date(MYSQL_DATETIME, $end_timestamp); $sql = "SELECT COUNT(POST.PID) AS TOTAL_POST_COUNT "; $sql .= "FROM `{$table_prefix}POST` POST "; $sql .= "WHERE POST.CREATED > CAST('{$post_start_datetime}' AS DATETIME) "; $sql .= "AND POST.CREATED < CAST('{$post_end_datetime}' AS DATETIME)"; if (!($result = $db->query($sql))) { return false; } list($post_tallys['post_count']) = $result->fetch_row(); $sql = "SELECT POST.FROM_UID AS UID, USER.LOGON, USER.NICKNAME, "; $sql .= "USER_PEER.PEER_NICKNAME, COUNT(POST.PID) AS POST_COUNT "; $sql .= "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 = USER.UID AND USER_PEER.UID = '{$uid}') "; $sql .= "WHERE POST.CREATED > CAST('{$post_start_datetime}' AS DATETIME) "; $sql .= "AND POST.CREATED < CAST('{$post_end_datetime}' AS DATETIME) "; $sql .= "GROUP BY POST.FROM_UID ORDER BY POST_COUNT DESC "; $sql .= "LIMIT 0, 20"; if (!($result = $db->query($sql))) { return false; } if ($result->num_rows > 0) { while ($user_stats = $result->fetch_assoc()) { if (isset($user_stats['LOGON']) && isset($user_stats['PEER_NICKNAME'])) { if (!is_null($user_stats['PEER_NICKNAME']) && strlen($user_stats['PEER_NICKNAME']) > 0) { $user_stats['NICKNAME'] = $user_stats['PEER_NICKNAME']; } } if (!isset($user_stats['LOGON'])) { $user_stats['LOGON'] = gettext("Unknown user"); } if (!isset($user_stats['NICKNAME'])) { $user_stats['NICKNAME'] = ""; } $post_tallys['user_stats'][] = $user_stats; } } return $post_tallys; }
function post_delete($tid, $pid) { if (!is_numeric($tid)) { return false; } if (!is_numeric($pid)) { return false; } if (!($table_prefix = get_table_prefix())) { return false; } if (!($db = db::get())) { return false; } if (($approve_uid = session::get_value('UID')) === false) { return false; } $current_datetime = date(MYSQL_DATETIME, time()); if (thread_is_poll($tid) && $pid == 1) { $sql = "UPDATE LOW_PRIORITY `{$table_prefix}THREAD` SET POLL_FLAG = 'N', "; $sql .= "MODIFIED = CAST('{$current_datetime}' AS DATETIME) WHERE TID = '{$tid}'"; if (!$db->query($sql)) { return false; } } $sql = "UPDATE LOW_PRIORITY `{$table_prefix}THREAD` SET DELETED = 'Y', "; $sql .= "MODIFIED = CAST('{$current_datetime}' AS DATETIME) WHERE TID = '{$tid}' AND LENGTH = 1"; if (!$db->query($sql)) { return false; } $sql = "UPDATE LOW_PRIORITY `{$table_prefix}POST_CONTENT` SET CONTENT = NULL "; $sql .= "WHERE TID = '{$tid}' AND PID = '{$pid}'"; if (!$db->query($sql)) { return false; } $sql = "UPDATE LOW_PRIORITY `{$table_prefix}POST` "; $sql .= "SET APPROVED = CAST('{$current_datetime}' AS DATETIME), "; $sql .= "APPROVED_BY = '{$approve_uid}' WHERE TID = '{$tid}' "; $sql .= "AND PID = '{$pid}'"; if (!$db->query($sql)) { return false; } return true; }
function word_filter_ob_callback($content) { if (($rand_hash = session::get_value('RAND_HASH')) === false) { return word_filter_remove_ob_tags($content); } $rand_hash = preg_replace("/[^a-z]/iu", "", $rand_hash); if (!($user_wordfilter = word_filter_get_from_session())) { return word_filter_remove_ob_tags($content); } $pattern_array = $user_wordfilter['pattern_array']; $replace_array = $user_wordfilter['replace_array']; $pattern_match = sprintf('/<\\/?strip_%1$s>/u', $rand_hash); $content_array = preg_split($pattern_match, $content); foreach ($content_array as $key => $content_match) { if ($key % 2 && ($new_content = @preg_replace($pattern_array, $replace_array, $content_match))) { $content_array[$key] = strip_tags($new_content); } } $content = implode('', $content_array); $pattern_match = sprintf('/<\\/?nostrip_%1$s>/u', $rand_hash); $content_array = preg_split($pattern_match, $content); foreach ($content_array as $key => $content_match) { if ($key % 2 && ($new_content = @preg_replace($pattern_array, $replace_array, $content_match))) { $content_array[$key] = $new_content; } } $content = implode('', $content_array); return word_filter_remove_ob_tags($content); }
require_once BH_INCLUDE_PATH . 'session.inc.php'; require_once BH_INCLUDE_PATH . 'thread.inc.php'; require_once BH_INCLUDE_PATH . 'user.inc.php'; require_once BH_INCLUDE_PATH . 'user_rel.inc.php'; require_once BH_INCLUDE_PATH . 'word_filter.inc.php'; // Check we're logged in correctly if (!session::logged_in()) { light_html_guest_error(); } if (!folder_get_by_type_allowed(FOLDER_ALLOW_NORMAL_THREAD)) { light_html_message_type_error(); } $show_sigs = session::get_value('VIEW_SIGS') == 'N' ? false : true; $uid = session::get_value('UID'); $page_prefs = session::get_post_page_prefs(); if (($high_interest = session::get_value('MARK_AS_OF_INT')) === false) { $high_interest = "N"; } $valid = true; $new_thread = false; $t_to_uid = 0; $t_sig = user_get_sig($uid); if (isset($_POST['t_newthread']) && (isset($_POST['post']) || isset($_POST['preview']))) { $new_thread = true; if (isset($_POST['t_threadtitle']) && strlen(trim($_POST['t_threadtitle'])) > 0) { $t_threadtitle = trim($_POST['t_threadtitle']); } else { $error_msg_array[] = gettext("You must enter a title for the thread!"); $valid = false; } if (isset($_POST['t_fid']) && is_numeric($_POST['t_fid'])) {
function html_draw_top() { $arg_array = func_get_args(); $title = null; $body_class = null; $base_target = null; $stylesheet_array = array(); $meta_refresh = array('delay' => null, 'url' => null); $robots = null; $frame_set_html = false; $pm_popup_disabled = false; $inline_css = null; $emoticons = null; $webtag = get_webtag(); $forum_name = forum_get_setting('forum_name', null, 'A Beehive Forum'); $func_matches = array(); foreach ($arg_array as $key => $func_args) { if (preg_match('/^title=(.+)?$/Disu', $func_args, $func_matches) > 0) { $title = !isset($title) && isset($func_matches[1]) ? $func_matches[1] : $title; unset($arg_array[$key]); } if (preg_match('/^class=(.+)?$/Disu', $func_args, $func_matches) > 0) { $body_class = !isset($body_class) && isset($func_matches[1]) ? $func_matches[1] : $body_class; unset($arg_array[$key]); } if (preg_match('/^basetarget=(.+)?$/Disu', $func_args, $func_matches) > 0) { $base_target = !isset($base_target) && isset($func_matches[1]) ? $func_matches[1] : $base_target; unset($arg_array[$key]); } if (preg_match('/^stylesheet=([^:]+)(:(.+))?$/Disu', $func_args, $func_matches) > 0) { $stylesheet_array[] = array('filename' => $func_matches[1], 'media' => isset($func_matches[3]) ? $func_matches[3] : 'screen'); unset($arg_array[$key]); } if (preg_match('/^refresh=([^:]+):(.+)$/Disu', $func_args, $func_matches) > 0) { $meta_refresh['delay'] = isset($func_matches[1]) ? $func_matches[1] : null; $meta_refresh['url'] = isset($func_matches[2]) ? $func_matches[2] : null; unset($arg_array[$key]); } if (preg_match('/^robots=(.+)?$/Disu', $func_args, $func_matches) > 0) { $robots = !isset($robots) && isset($func_matches[1]) ? $func_matches[1] : $robots; unset($arg_array[$key]); } if (preg_match('/^frame_set_html$/Disu', $func_args, $func_matches) > 0) { $frame_set_html = true; unset($arg_array[$key]); } if (preg_match('/^pm_popup_disabled$/Disu', $func_args, $func_matches) > 0) { $pm_popup_disabled = true; unset($arg_array[$key]); } if (preg_match('/^inline_css=(.+)/Disu', $func_args, $func_matches) > 0) { $inline_css = !isset($inline_css) && isset($func_matches[1]) ? $func_matches[1] : $inline_css; unset($arg_array[$key]); } if (preg_match('/^emoticons=(.+)?$/Disu', $func_args, $func_matches) > 0) { $emoticons = !isset($emoticons) && isset($func_matches[1]) ? $func_matches[1] : $emoticons; unset($arg_array[$key]); } } echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; if ($frame_set_html === false) { echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; } else { echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n"; } echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"", _('en-gb'), "\" lang=\"", _('en-gb'), "\" dir=\"", _('ltr'), "\">\n"; echo "<head>\n"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"; // Default Meta keywords and description. $meta_keywords = html_get_forum_keywords(); $meta_description = html_get_forum_description(); if (isset($_GET['msg']) && validate_msg($_GET['msg'])) { message_get_meta_content($_GET['msg'], $meta_keywords, $meta_description); list($tid, $pid) = explode('.', $_GET['msg']); if ($thread_data = thread_get($tid)) { $prev_page = $pid - 10 > 0 ? $pid - 10 : 1; $next_page = $pid + 10 < $thread_data['LENGTH'] ? $pid + 10 : $thread_data['LENGTH']; echo "<link rel=\"first\" href=\"", html_get_forum_file_path("index.php?webtag={$webtag}&msg={$tid}.1"), "\" />\n"; echo "<link rel=\"previous\" href=\"", html_get_forum_file_path("index.php?webtag={$webtag}&msg={$tid}.{$thread_data['LENGTH']}"), "\" />\n"; echo "<link rel=\"next\" href=\"", html_get_forum_file_path("index.php?webtag={$webtag}&msg={$tid}.{$next_page}"), "\" />\n"; echo "<link rel=\"last\" href=\"", html_get_forum_file_path("index.php?webtag={$webtag}&msg={$tid}.{$prev_page}"), "\" />\n"; echo "<title>", word_filter_add_ob_tags($thread_data['TITLE'], true), " - ", word_filter_add_ob_tags($forum_name, true), "</title>\n"; } else { if (isset($title)) { echo "<title>", word_filter_add_ob_tags($title, true), " - ", word_filter_add_ob_tags($forum_name, true), "</title>\n"; } else { echo "<title>", word_filter_add_ob_tags($forum_name, true), "</title>\n"; } } } else { if (isset($title)) { echo "<title>", word_filter_add_ob_tags($title, true), " - ", htmlentities_array($forum_name), "</title>\n"; } else { echo "<title>", htmlentities_array($forum_name), "</title>\n"; } } $forum_content_rating = html_get_forum_content_rating(); echo "<meta name=\"generator\" content=\"Beehive Forum ", BEEHIVE_VERSION, "\" />\n"; echo "<meta name=\"keywords\" content=\"", word_filter_add_ob_tags($meta_keywords, true), "\" />\n"; echo "<meta name=\"description\" content=\"", word_filter_add_ob_tags($meta_description, true), "\" />\n"; echo "<meta name=\"rating\" content=\"{$forum_content_rating}\" />\n"; if (forum_get_setting('allow_search_spidering', 'N')) { echo "<meta name=\"robots\" content=\"noindex,nofollow\" />\n"; } else { if (isset($robots)) { echo "<meta name=\"robots\" content=\"{$robots}\" />\n"; } } if (isset($meta_refresh['url'], $meta_refresh['delay'])) { echo "<meta http-equiv=\"refresh\" content=\"{$meta_refresh['delay']}; url={$meta_refresh['url']}\" />\n"; } printf("<meta name=\"application-name\" content=\"%s\" />\n", word_filter_add_ob_tags($forum_name, true)); printf("<meta name=\"msapplication-tooltip\" content=\"%s\" />\n", word_filter_add_ob_tags($meta_description, true)); if (forum_check_webtag_available($webtag)) { printf("<meta name=\"msapplication-task\" content=\"name=%s;action-uri=%s;icon-uri=%s\" />\n", _('Messages'), htmlentities_array(html_get_forum_file_path("index.php?webtag={$webtag}&final_uri=discussion.php%3Fwebtag%3D{$webtag}")), html_style_image('msie/unread_thread.ico', true, true)); if (forum_get_setting('show_links', 'Y')) { printf("<meta name=\"msapplication-task\" content=\"name=%s;action-uri=%s;icon-uri=%s\" />\n", _('Links'), htmlentities_array(html_get_forum_file_path("index.php?webtag={$webtag}&final_uri=links.php%3Fwebtag%3D{$webtag}")), html_style_image('msie/link.ico', true, true)); } } if (forum_get_setting('show_pms', 'Y')) { printf("<meta name=\"msapplication-task\" content=\"name=%s;action-uri=%s;icon-uri=%s\" />\n", _('Inbox'), htmlentities_array(html_get_forum_file_path("index.php?webtag={$webtag}&final_uri=pm.php%3Fwebtag%3D{$webtag}")), html_style_image('msie/pmunread.ico', true, true)); } if (forum_check_webtag_available($webtag)) { printf("<meta name=\"msapplication-task\" content=\"name=%s;action-uri=%s;icon-uri=%s\" />\n", _('My Controls'), htmlentities_array(html_get_forum_file_path("index.php?webtag={$webtag}&final_uri=user.php%3Fwebtag%3D{$webtag}")), html_style_image('msie/user_controls.ico', true, true)); } if (session::logged_in() && (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))) { printf("<meta name=\"msapplication-task\" content=\"name=%s;action-uri=%s;icon-uri=%s\" />\n", _('Admin'), htmlentities_array(html_get_forum_file_path("index.php?webtag={$webtag}&final_uri=admin.php%3Fwebtag%3D{$webtag}")), html_style_image('msie/admintool.ico', true, true)); } printf("<meta name=\"msapplication-starturl\" content=\"%s\" />\n", html_get_forum_file_path("index.php?webtag={$webtag}")); $rss_feed_path = html_get_forum_file_path("threads_rss.php?webtag={$webtag}"); printf("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"%s - %s\" href=\"%s\" />\n", htmlentities_array($forum_name), htmlentities_array(_('RSS Feed')), $rss_feed_path); if ($folders_array = folder_get_available_details()) { foreach ($folders_array as $folder) { $rss_feed_path = html_get_forum_file_path("threads_rss.php?webtag={$webtag}&fid={$folder['FID']}"); printf("<link rel=\"alternate\" type=\"application/rss+xml\" title=\"%s - %s - %s\" href=\"%s\" />\n", htmlentities_array($forum_name), htmlentities_array($folder['TITLE']), htmlentities_array(_('RSS Feed')), $rss_feed_path); } } if ($user_style_path = html_get_user_style_path()) { printf("<link rel=\"apple-touch-icon\" href=\"%s\" />\n", html_get_forum_file_path(sprintf('styles/%s/images/apple-touch-icon-57x57.png', $user_style_path))); printf("<link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"%s\" />\n", html_get_forum_file_path(sprintf('styles/%s/images/apple-touch-icon-72x72.png', $user_style_path))); printf("<link rel=\"apple-touch-icon\" sizes=\"114x114\" href=\"%s\" />\n", html_get_forum_file_path(sprintf('styles/%s/images/apple-touch-icon-114x114.png', $user_style_path))); printf("<link rel=\"shortcut icon\" type=\"image/ico\" href=\"%s\" />\n", html_get_forum_file_path(sprintf('styles/%s/images/favicon.ico', $user_style_path))); } $opensearch_path = html_get_forum_file_path(sprintf('search.php?webtag=%s&opensearch', $webtag)); printf("<link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"%s\" href=\"%s\" />\n", $forum_name, $opensearch_path); if ($style_sheet = html_get_style_sheet()) { html_include_css($style_sheet); } if ($script_style_sheet = html_get_script_style_sheet()) { html_include_css($script_style_sheet); } if ($emoticon_style_sheet = html_get_emoticon_style_sheet($emoticons)) { html_include_css($emoticon_style_sheet, 'print, screen'); } if (isset($stylesheet_array) && is_array($stylesheet_array)) { foreach ($stylesheet_array as $stylesheet) { if (isset($stylesheet['filename']) && isset($stylesheet['media'])) { html_include_css($stylesheet['filename'], $stylesheet['media']); } } } if ($style_path_ie6 = html_get_style_sheet('style_ie6.css')) { echo "<!--[if IE 6]>\n"; html_include_css($style_path_ie6); echo "<![endif]-->\n"; } if (isset($inline_css)) { echo "<style type=\"text/css\">\n"; echo "<!--\n\n", $inline_css, "\n\n//-->\n"; echo "</style>\n"; } // Font size (not for Guests) if (session::logged_in()) { html_include_css(html_get_forum_file_path(sprintf('font_size.php?webtag=%s', $webtag)), 'screen', 'user_font'); } if ($base_target) { echo "<base target=\"{$base_target}\" />\n"; } html_include_javascript(html_get_forum_file_path('js/jquery-1.7.1.min.js')); html_include_javascript(html_get_forum_file_path('js/jquery-ui-1.8.22.autocomplete.min.js')); html_include_javascript(html_get_forum_file_path('js/jquery.parsequery.js')); html_include_javascript(html_get_forum_file_path('js/jquery.sprintf.js')); html_include_javascript(html_get_forum_file_path('js/jquery.url.js')); html_include_javascript(html_get_forum_file_path('js/general.js')); if ($frame_set_html === false) { // Check for any new PMs. if (session::logged_in()) { // Check to see if the PM popup is disabled on the current page. if ($pm_popup_disabled === false) { // Pages we don't want the popup to appear on $pm_popup_disabled_pages = array('admin.php', 'attachments.php', 'change_pw.php', 'confirm_email.php', 'dictionary.php', 'discussion.php', 'display_emoticons.php', 'edit_attachments.php', 'email.php', 'font_size.php', 'forgot_pw.php', 'get_attachment.php', 'index.php', 'mods_list.php', 'nav.php', 'pm.php', 'pm_edit.php', 'pm_folders.php', 'pm_messages.php', 'pm_options.php', 'poll_results.php', 'start.php', 'search_popup.php', 'threads_rss.php', 'user.php', 'user_font.php', 'user_profile.php', 'user_stats.php'); // Check that we're not on one of the pages. if (!in_array(basename($_SERVER['PHP_SELF']), $pm_popup_disabled_pages)) { html_include_javascript(html_get_forum_file_path('js/pm.js')); } } // Overflow auto-resize functionality. $resize_images_page = array('admin_post_approve.php', 'create_poll.php', 'delete.php', 'display.php', 'edit.php', 'edit_poll.php', 'edit_signature.php', 'messages.php', 'post.php', 'pm_write.php', 'pm_edit.php', 'pm_messages.php'); if (in_array(basename($_SERVER['PHP_SELF']), $resize_images_page)) { if (session::get_value('USE_OVERFLOW_RESIZE') == 'Y') { html_include_javascript(html_get_forum_file_path('js/overflow.js')); } } // Mouseover spoiler pages $message_display_pages = array('admin_post_approve.php', 'create_poll.php', 'delete.php', 'display.php', 'edit.php', 'edit_poll.php', 'edit_signature.php', 'ldisplay.php', 'lmessages.php', 'lpost.php', 'messages.php', 'post.php'); if (in_array(basename($_SERVER['PHP_SELF']), $message_display_pages)) { html_include_javascript(html_get_forum_file_path('js/spoiler.js')); } } // Stats Display pages $stats_display_pages = array('messages.php'); if (in_array(basename($_SERVER['PHP_SELF']), $stats_display_pages)) { html_include_javascript(html_get_forum_file_path('js/stats.js')); } } reset($arg_array); foreach ($arg_array as $func_args) { html_include_javascript(html_get_forum_file_path("js/{$func_args}")); } html_include_javascript(html_get_forum_file_path("ckeditor/ckeditor.js")); html_include_javascript(html_get_forum_file_path("ckeditor/adapters/jquery.js")); html_include_javascript(html_get_forum_file_path("json.php?webtag={$webtag}")); if ($frame_set_html === true && ($google_analytics_code = html_get_google_analytics_code())) { echo "<script type=\"text/javascript\">\n\n"; echo " var _gaq = _gaq || [];\n"; echo " _gaq.push(['_setAccount', '{$google_analytics_code}']);\n"; echo " _gaq.push(['_trackPageview']);\n\n"; echo " (function() {\n"; echo " var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n"; echo " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n"; echo " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n"; echo " })();\n\n"; echo "</script>\n"; } if ($frame_set_html === false && forum_get_setting('show_share_links', 'Y') && session::get_value('SHOW_SHARE_LINKS') == 'Y') { echo "<script type=\"text/javascript\" src=\"https://apis.google.com/js/plusone.js\">\n"; echo "{lang: 'en-GB'}\n"; echo "</script>\n"; echo "<script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"http://connect.facebook.net/en_US/all.js#xfbml=1\"></script>\n"; } echo "</head>\n\n"; if ($frame_set_html === false) { echo "<body", $body_class ? " class=\"{$body_class}\">\n" : ">\n"; if (html_output_adsense_settings() && adsense_check_user() && adsense_check_page()) { adsense_output_html(); echo "<br />\n"; } if (forum_get_setting('show_share_links', 'Y') && session::get_value('SHOW_SHARE_LINKS') == 'Y') { echo '<div id="fb-root"></div>'; } } }
echo " <td align=\"left\" width=\"25\"> </td>\n"; echo " </tr>\n"; } echo " <tr>\n"; echo " <td align=\"left\" colspan=\"5\"> </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"; if ($uid == session::get_value('UID')) { if (!is_md5($aid)) { $aid = md5(uniqid(mt_rand())); } if ($popup == 1) { echo " <tr>\n"; echo " <td align=\"center\">"; echo " <a href=\"attachments.php?webtag={$webtag}&aid={$aid}\" class=\"button popup 660x500\" id=\"attachments\"><span>", gettext("Attachments"), "</span></a>\n"; echo " ", form_submit('delete', gettext("Delete")), " ", form_submit('close', gettext("Close")); echo " </td>\n"; echo " </tr>\n"; } else { echo " <tr>\n"; echo " <td align=\"center\">"; echo " <a href=\"attachments.php?webtag={$webtag}&aid={$aid}\" class=\"button popup 660x500\" id=\"attachments\"><span>", gettext("Attachments"), "</span></a>\n"; echo " ", form_submit('delete', gettext("Delete"));
function user_get_profile_entries($uid) { if (!($db = db::get())) { return false; } if (!is_numeric($uid)) { return false; } if (!($table_prefix = get_table_prefix())) { return false; } $user_profile_array = array(); $session_uid = session::get_value('UID'); $peer_relationship = user_get_relationship($uid, $session_uid); $user_friend = USER_FRIEND; $sql = "SELECT PROFILE_SECTION.PSID, PROFILE_ITEM.PIID, PROFILE_ITEM.NAME, "; $sql .= "PROFILE_ITEM.TYPE, PROFILE_ITEM.OPTIONS, USER_PROFILE.ENTRY, USER_PROFILE.PRIVACY "; $sql .= "FROM `{$table_prefix}PROFILE_SECTION` PROFILE_SECTION "; $sql .= "LEFT JOIN `{$table_prefix}PROFILE_ITEM` PROFILE_ITEM "; $sql .= "ON (PROFILE_ITEM.PSID = PROFILE_SECTION.PSID) "; $sql .= "LEFT JOIN `{$table_prefix}USER_PROFILE` USER_PROFILE "; $sql .= "ON (USER_PROFILE.PIID = PROFILE_ITEM.PIID AND USER_PROFILE.UID = '{$uid}' "; $sql .= "AND (USER_PROFILE.PRIVACY = 0 OR USER_PROFILE.UID = '{$session_uid}' "; $sql .= "OR (USER_PROFILE.PRIVACY = 1 AND ({$peer_relationship} & {$user_friend} > 0)))) "; $sql .= "WHERE USER_PROFILE.ENTRY IS NOT NULL ORDER BY PROFILE_SECTION.POSITION, "; $sql .= "PROFILE_ITEM.POSITION, PROFILE_ITEM.PIID"; if (!($result = $db->query($sql))) { return false; } if ($result->num_rows == 0) { return false; } while ($user_profile_data = $result->fetch_assoc()) { if (strlen(trim($user_profile_data['ENTRY'])) > 0) { if ($user_profile_data['TYPE'] == PROFILE_ITEM_RADIO || $user_profile_data['TYPE'] == PROFILE_ITEM_DROPDOWN) { $profile_item_options_array = explode("\n", $user_profile_data['OPTIONS']); if (isset($profile_item_options_array[$user_profile_data['ENTRY']])) { $user_profile_array[$user_profile_data['PSID']][$user_profile_data['PIID']] = $user_profile_data; } } else { $user_profile_array[$user_profile_data['PSID']][$user_profile_data['PIID']] = $user_profile_data; } } } return sizeof($user_profile_array) > 0 ? $user_profile_array : false; }
echo " <table class=\"posthead\" width=\"95%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"25%\">", gettext("From"), ":</td>\n"; echo " <td align=\"left\">", word_filter_add_ob_tags($from_user['NICKNAME'], true), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\">", gettext("Subject"), ":</td>\n"; echo " <td align=\"left\">", form_input_text("t_subject", isset($subject) ? htmlentities_array($subject) : '', 54, 128), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" valign=\"top\">", gettext("Message"), ":</td>\n"; echo " <td align=\"left\">", form_textarea("t_message", isset($message) ? htmlentities_array($message) : '', 12, 51), "</td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" valign=\"top\"> </td>\n"; echo " <td align=\"left\">", form_checkbox('t_use_email_addr', 'Y', gettext("Use my real email address to send this message"), isset($use_email_addr) ? $use_email_addr : session::get_value('USE_EMAIL_ADDR') == 'Y'), "</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 " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\"> </td>\n";
function threads_search_user_subscriptions($thread_search, $interest_type = THREAD_NOINTEREST, $page = 1) { if (!($db = db::get())) { return false; } if (!is_numeric($interest_type)) { $interest_type = THREAD_NOINTEREST; } if (!is_numeric($page)) { $page = 1; } if (!($table_prefix = get_table_prefix())) { return false; } $offset = calculate_page_offset($page, 20); $thread_search = $db->escape($thread_search); $thread_subscriptions_array = array(); $uid = session::get_value('UID'); if ($interest_type != THREAD_NOINTEREST) { $sql = "SELECT SQL_CALC_FOUND_ROWS THREAD.TID, "; $sql .= "TRIM(CONCAT_WS(' ', COALESCE(FOLDER.PREFIX, ''), THREAD.TITLE)) AS TITLE, "; $sql .= "USER_THREAD.INTEREST FROM `{$table_prefix}THREAD` THREAD "; $sql .= "LEFT JOIN `{$table_prefix}FOLDER` FOLDER ON (FOLDER.FID = THREAD.FID) "; $sql .= "LEFT JOIN `{$table_prefix}USER_THREAD` USER_THREAD ON (USER_THREAD.TID = THREAD.TID "; $sql .= "AND USER_THREAD.UID = '{$uid}') WHERE USER_THREAD.INTEREST = '{$interest_type}' "; $sql .= "AND THREAD.TITLE LIKE '{$thread_search}%' ORDER BY THREAD.MODIFIED DESC "; $sql .= "LIMIT {$offset}, 20"; } else { $sql = "SELECT SQL_CALC_FOUND_ROWS THREAD.TID, "; $sql .= "TRIM(CONCAT_WS(' ', COALESCE(FOLDER.PREFIX, ''), THREAD.TITLE)) AS TITLE, "; $sql .= "USER_THREAD.INTEREST FROM `{$table_prefix}THREAD` THREAD "; $sql .= "LEFT JOIN `{$table_prefix}FOLDER` FOLDER ON (FOLDER.FID = THREAD.FID) "; $sql .= "LEFT JOIN `{$table_prefix}USER_THREAD` USER_THREAD ON (USER_THREAD.TID = THREAD.TID "; $sql .= "AND USER_THREAD.UID = '{$uid}') WHERE USER_THREAD.INTEREST <> 0 "; $sql .= "AND THREAD.TITLE LIKE '{$thread_search}%' ORDER BY THREAD.MODIFIED DESC "; $sql .= "LIMIT {$offset}, 20"; } if (!($result = $db->query($sql))) { return false; } $sql = "SELECT FOUND_ROWS() AS ROW_COUNT"; if (!($result_count = $db->query($sql))) { return false; } list($thread_subscriptions_count) = $result_count->fetch_row(); if ($result->num_rows == 0 && $thread_subscriptions_count > 0 && $page > 1) { return threads_search_user_subscriptions($thread_search, $interest_type, $page - 1); } while ($thread_data_array = $result->fetch_assoc()) { $thread_subscriptions_array[] = $thread_data_array; } return array('thread_count' => $thread_subscriptions_count, 'thread_array' => $thread_subscriptions_array); }
html_draw_top(sprintf("title=%s", gettext("Error"))); post_edit_refuse($tid, $pid); html_draw_bottom(); exit; } if (forum_get_setting('require_post_approval', 'Y') && isset($preview_message['APPROVED']) && $preview_message['APPROVED'] == 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) { html_draw_top(sprintf("title=%s", gettext("Error"))); post_edit_refuse($tid, $pid); html_draw_bottom(); exit; } } if (isset($_POST['endpoll'])) { if (poll_close($tid)) { post_add_edit_text($tid, 1); if (session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid) && $preview_message['FROM_UID'] != session::get_value('UID')) { admin_add_log_entry(EDIT_POST, array($t_fid, $tid, $pid)); } } if ($thread_data['LENGTH'] > 1) { header_redirect("discussion.php?webtag={$webtag}&msg={$msg}&edit_success={$msg}"); exit; } else { header_redirect("discussion.php?webtag={$webtag}&edit_success={$msg}"); exit; } } html_draw_top(sprintf("title=%s", gettext("Close Poll")), "post.js", "resize_width=720", "basetarget=_blank", 'class=window_title'); echo "<h1>", gettext("Close Poll"), " {$tid}.{$pid}</h1>\n"; if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { html_display_error_array($error_msg_array, '720', 'left');
function messages_forum_stats($tid, $pid) { $webtag = get_webtag(); if (forum_get_setting('show_stats', 'Y')) { echo "<br />\n"; echo "<div align=\"center\">\n"; echo " <form action=\"user_stats.php\" method=\"get\" target=\"_self\">\n"; echo " ", form_input_hidden('webtag', $webtag), "\n"; echo " ", form_input_hidden('msg', "{$tid}.{$pid}"), "\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"96%\">\n"; echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"box\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td>\n"; echo " <table border=\"0\" cellspacing=\"0\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Forum Stats"), "</td>\n"; echo " <td align=\"right\" class=\"subhead\">\n"; if (!session::logged_in()) { echo " "; } else { if (session::get_value("SHOW_STATS") == "Y") { echo " ", form_submit_image('hide.png', 'forum_stats_toggle', 'hide', '', 'button_image toggle_button'), "\n"; } else { echo " ", form_submit_image('show.png', 'forum_stats_toggle', 'show', '', 'button_image toggle_button'), "\n"; } } echo " </td>\n"; echo " </tr>"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td>\n"; if (!session::logged_in() || session::get_value("SHOW_STATS") == "Y") { echo " <div id=\"forum_stats\" class=\"forum_stats_toggle\">\n"; } else { echo " <div id=\"forum_stats\" class=\"forum_stats_toggle\" style=\"display: none\">\n"; } echo " <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" class=\"posthead\">\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\" id=\"active_user_counts\"></td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\" class=\"activeusers\" id=\"active_user_list\"> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\" id=\"thread_stats\"> <br /> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\" id=\"post_stats\"> <br /> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\" id=\"user_stats\"> <br /> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " <td align=\"left\"> </td>\n"; echo " <td align=\"left\" width=\"35\"> </td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </div>\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 " </form>\n"; echo "</div>\n"; } }
echo " <td align=\"left\" colspan=\"2\">\n"; echo " <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; echo " <tr>\n"; echo " <td align=\"left\" valign=\"top\" class=\"foldername\">\n"; if (session::logged_in() && $folder_info[$folder_number]['INTEREST'] == FOLDER_SUBSCRIBED) { echo " <a href=\"folder_options.php?webtag={$webtag}&fid={$folder_number}\" target=\"_blank\" class=\"popup 550x400\"><img src=\"", html_style_image('folder_subscribed.png'), "\" alt=\"", gettext("Subscribed Folder"), "\" title=\"", gettext("Subscribed Folder"), "\" border=\"0\" /></a>\n"; } else { if (session::logged_in() && $folder_info[$folder_number]['INTEREST'] == FOLDER_IGNORED) { echo " <a href=\"folder_options.php?webtag={$webtag}&fid={$folder_number}\" target=\"_blank\" class=\"popup 550x400\"><img src=\"", html_style_image('folder_ignored.png'), "\" alt=\"", gettext("Ignored Folder"), "\" title=\"", gettext("Ignored Folder"), "\" border=\"0\" /></a>\n"; } else { echo " <a href=\"folder_options.php?webtag={$webtag}&fid={$folder_number}\" target=\"_blank\" class=\"popup 550x400\"><img src=\"", html_style_image('folder.png'), "\" alt=\"", gettext("Folder"), "\" title=\"", gettext("Folder"), "\" border=\"0\" /></a>\n"; } } echo " <a href=\"thread_list.php?webtag={$webtag}&mode={$mode}&folder={$folder_number}\" title=\"", word_filter_add_ob_tags($folder_info[$folder_number]['DESCRIPTION'], true), "\">", word_filter_add_ob_tags($folder_info[$folder_number]['TITLE'], true), "</a>\n"; echo " </td>\n"; if (session::get_value('UID') > 0) { echo " <td align=\"left\" class=\"folderpostnew\" style=\"white-space: nowrap\"><a href=\"mods_list.php?webtag={$webtag}&fid={$folder_number}\" target=\"_blank\" class=\"popup 580x450\" id=\"mods_list_{$folder_number}\"><img src=\"" . html_style_image('mods_list.png') . "\" border=\"0\" alt=\"", gettext("View moderators"), "\" title=\"", gettext("View moderators"), "\" /></a></td>"; } echo " </tr>\n"; echo " </table>\n"; echo " </td>\n"; echo " </tr>\n"; echo "</table>\n"; if (!session::logged_in() || $folder_info[$folder_number]['INTEREST'] > FOLDER_IGNORED || $mode == UNREAD_DISCUSSIONS_TO_ME || isset($folder) && $folder == $folder_number) { echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\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"; if (is_array($thread_info)) {
require_once BH_INCLUDE_PATH . 'html.inc.php'; require_once BH_INCLUDE_PATH . 'lang.inc.php'; require_once BH_INCLUDE_PATH . 'logon.inc.php'; require_once BH_INCLUDE_PATH . 'post.inc.php'; require_once BH_INCLUDE_PATH . 'session.inc.php'; require_once BH_INCLUDE_PATH . 'styles.inc.php'; require_once BH_INCLUDE_PATH . 'timezone.inc.php'; require_once BH_INCLUDE_PATH . 'user.inc.php'; // Check we're logged in correctly if (!session::logged_in()) { html_guest_error(); } // Array to hold error messages. $error_msg_array = array(); // User UID $uid = session::get_value('UID'); // Get User Prefs $user_prefs = user_get_prefs($uid); // Submit code starts here. if (isset($_POST['save'])) { if (isset($_POST['pm_notify']) && $_POST['pm_notify'] == "Y") { $user_prefs['PM_NOTIFY'] = "Y"; } else { $user_prefs['PM_NOTIFY'] = "N"; } if (isset($_POST['pm_save_sent_items']) && $_POST['pm_save_sent_items'] == "Y") { $user_prefs['PM_SAVE_SENT_ITEM'] = "Y"; } else { $user_prefs['PM_SAVE_SENT_ITEM'] = "N"; } if (isset($_POST['pm_include_reply']) && $_POST['pm_include_reply'] == "Y") {
// Includes required by this page. require_once BH_INCLUDE_PATH . 'cache.inc.php'; require_once BH_INCLUDE_PATH . 'constants.inc.php'; require_once BH_INCLUDE_PATH . 'header.inc.php'; require_once BH_INCLUDE_PATH . 'html.inc.php'; require_once BH_INCLUDE_PATH . 'lang.inc.php'; require_once BH_INCLUDE_PATH . 'logon.inc.php'; require_once BH_INCLUDE_PATH . 'session.inc.php'; // Guests can't do different font sizes. if (!session::logged_in()) { exit; } // User's UID $uid = session::get_value('UID'); // User's font size. if (($font_size = session::get_value('FONT_SIZE')) === false) { $font_size = 10; } // Make sure the font size is positive and an integer. $font_size = floor(abs($font_size)); // Output in text/css. header("Content-Type: text/css"); // Check the cache cache_check_etag(md5(sprintf("%s-%s-%s", session_id(), $font_size, $uid))); // Check the user's font size. if ($font_size < 5) { $font_size = 5; } if ($font_size > 15) { $font_size = 15; }
html_draw_top("title={$page_title}", 'class=window_title'); html_display_msg(gettext("User History"), gettext("Successfully cleared user history"), 'admin_user.php', 'get', array('back' => gettext("Back")), array('uid' => $uid), '_self', 'center'); html_draw_bottom(); exit; } else { html_draw_error(gettext("Failed to clear user history"), 'admin_user.php', 'get', array('back' => gettext("Back")), array('uid' => $uid), '_self', 'center'); } } } else { if (isset($_POST['reset_passwd_submit'])) { 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), '_self', 'center'); } if (isset($_POST['t_new_password']) && strlen(trim($_POST['t_new_password'])) > 0) { $t_new_password = trim($_POST['t_new_password']); if ($user_logon = user_get_logon($uid) && ($fuid = session::get_value('UID'))) { if (admin_reset_user_password($uid, $t_new_password)) { email_send_new_pw_notification($uid, $fuid, $t_new_password); html_draw_top("title={$page_title}", 'class=window_title'); html_display_msg(gettext("Change Password"), gettext("Successfully Changed Password"), 'admin_user.php', 'get', array('back' => gettext("Back")), false, '_self', 'center'); html_draw_bottom(); exit; } } html_draw_error(gettext("Failed To Change Password"), 'admin_user.php', 'get', array('back' => gettext("Back")), array('uid' => $uid), '_self', 'center'); } } else { if (isset($_POST['delete_user_confirm'])) { 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), '_self', 'center'); }
$mode = $_REQUEST['mode']; } // Check that required variables are set if (!session::logged_in()) { // non-logged in users can only display "All" threads // or those in the past x days, since the other options // would be impossible if (!isset($mode) || $mode != ALL_DISCUSSIONS && $mode != TODAYS_DISCUSSIONS && $mode != TWO_DAYS_BACK && $mode != SEVEN_DAYS_BACK) { $mode = ALL_DISCUSSIONS; } } else { $threads_any_unread = threads_any_unread(); if (isset($mode) && is_numeric($mode)) { session::set_value('THREAD_MODE', $mode); } else { if (!($mode = session::get_value('THREAD_MODE'))) { $mode = UNREAD_DISCUSSIONS; } if ($mode == UNREAD_DISCUSSIONS && !$threads_any_unread) { $mode = ALL_DISCUSSIONS; } } if (isset($_REQUEST['mark_read_submit'])) { if (isset($_REQUEST['mark_read_confirm']) && $_REQUEST['mark_read_confirm'] == 'Y') { if ($_REQUEST['mark_read_type'] == THREAD_MARK_READ_VISIBLE) { if (isset($_REQUEST['mark_read_threads']) && strlen(trim($_REQUEST['mark_read_threads'])) > 0) { $thread_data = array(); $mark_read_threads = trim($_REQUEST['mark_read_threads']); $mark_read_threads_array = array_filter(explode(',', $mark_read_threads), 'is_numeric'); threads_get_unread_data($thread_data, $mark_read_threads_array); if (threads_mark_read($thread_data)) {
echo " <td align=\"left\" class=\"posthead\">\n"; echo " <table class=\"posthead\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" class=\"subhead\">", gettext("Options"), "</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=\"left\">", form_checkbox("use_word_filter", "Y", gettext("Enable word filter."), session::get_value('USE_WORD_FILTER') == 'Y'), "</td>\n"; echo " </tr>\n"; if (!forum_get_setting('force_word_filter', 'Y')) { echo " <tr>\n"; echo " <td align=\"left\">", form_checkbox("use_admin_filter", "Y", gettext("Include admin word filter in my list."), session::get_value('USE_ADMIN_FILTER') == 'Y'), "</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";
function check_affected_sessions($ban_type, $ban_data, $ban_expires) { if (!($db = db::get())) { return false; } if (!is_numeric($ban_type)) { return false; } if (!is_numeric($ban_expires)) { return false; } $ban_data = $db->escape($ban_data); $affected_sessions = array(); $ban_type_ip = BAN_TYPE_IP; $ban_type_logon = BAN_TYPE_LOGON; $ban_type_nick = BAN_TYPE_NICK; $ban_type_email = BAN_TYPE_EMAIL; $ban_type_ref = BAN_TYPE_REF; if (!($table_prefix = get_table_prefix())) { return false; } if (($uid = session::get_value('UID')) === false) { return false; } $current_datetime = time(); $sql = "SELECT DISTINCT SESSIONS.UID, USER.LOGON, "; $sql .= "USER_PEER.PEER_NICKNAME, USER.NICKNAME FROM SESSIONS "; $sql .= "LEFT JOIN USER USER ON (USER.UID = SESSIONS.UID) "; $sql .= "LEFT JOIN `{$table_prefix}USER_PEER` USER_PEER "; $sql .= "ON (USER_PEER.PEER_UID = SESSIONS.UID AND USER_PEER.UID = '{$uid}') "; $sql .= "WHERE ({$ban_expires} > {$current_datetime} OR {$ban_expires} = 0) "; $sql .= "AND SESSIONS.UID > 0 AND (((SESSIONS.IPADDRESS LIKE '{$ban_data}' "; $sql .= "OR USER.IPADDRESS LIKE '{$ban_data}') AND '{$ban_type}' = '{$ban_type_ip}') "; $sql .= "OR ((SESSIONS.REFERER LIKE '{$ban_data}' OR USER.REFERER LIKE '{$ban_data}') "; $sql .= "AND '{$ban_type}' = '{$ban_type_ref}') OR (USER.LOGON LIKE '{$ban_data}' "; $sql .= "AND '{$ban_type}' = '{$ban_type_logon}') OR (USER.NICKNAME LIKE '{$ban_data}' "; $sql .= "AND '{$ban_type}' = '{$ban_type_nick}') OR (USER.EMAIL LIKE '{$ban_data}' "; $sql .= "AND '{$ban_type}' = '{$ban_type_email}'))"; if (!($result = $db->query($sql))) { return false; } if ($result->num_rows > 0) { while ($ban_result = $result->fetch_assoc()) { if (isset($ban_result['LOGON']) && isset($ban_result['PEER_NICKNAME'])) { if (!is_null($ban_result['PEER_NICKNAME']) && strlen($ban_result['PEER_NICKNAME']) > 0) { $ban_result['NICKNAME'] = $ban_result['PEER_NICKNAME']; } } if (!isset($ban_result['LOGON'])) { $ban_result['LOGON'] = gettext("Unknown user"); } if (!isset($ban_result['NICKNAME'])) { $ban_result['NICKNAME'] = ""; } $affected_sessions[$ban_result['UID']] = $ban_result; } } $sql = "SELECT COUNT(SESSIONS.UID) FROM SESSIONS WHERE SESSIONS.UID = 0 "; $sql .= "AND (('{$ban_data}' LIKE SESSIONS.IPADDRESS AND '{$ban_type}' = '{$ban_type_ip}') "; $sql .= "OR (SESSIONS.REFERER LIKE '{$ban_data}' AND '{$ban_type}' = '{$ban_type_ref}')) "; $sql .= "AND ({$ban_expires} > CAST('{$current_datetime}' AS DATETIME) OR {$ban_expires} = 0)"; if (!($result = $db->query($sql))) { return false; } list($affected_guest_count) = $result->fetch_row(); for ($i = 0; $i < $affected_guest_count; $i++) { $affected_sessions[] = array('UID' => 0, 'LOGON' => 'GUEST', 'NICKNAME' => 'GUEST'); } return sizeof($affected_sessions) > 0 ? $affected_sessions : false; }
$admin_edit = true; } else { html_draw_error(gettext("No user specified.")); } } else { $uid = session::get_value('UID'); } } if (isset($_POST['cancel'])) { header_redirect("admin_user.php?webtag={$webtag}&uid={$uid}"); exit; } } else { $uid = session::get_value('UID'); } if (!session::check_perm(USER_PERM_ADMIN_TOOLS, 0) && $uid != session::get_value('UID')) { html_draw_error(gettext("You do not have permission to use this section.")); } // Fetch array of profile items. $profile_items_array = profile_get_user_values($uid); // Array to hold error messages $error_msg_array = array(); // Do updates if (isset($_POST['save'])) { $valid = true; if (isset($_POST['t_entry']) && is_array($_POST['t_entry'])) { $t_entry_array = $_POST['t_entry']; $t_entry_cleaned_array = array_map('strip_tags', $t_entry_array); if (sizeof(array_diff_assoc($t_entry_array, $t_entry_cleaned_array)) > 0) { $error_msg_array[] = gettext("Profile Entries must not include HTML"); $valid = false;
function poll_delete_vote($tid) { if (!($db = db::get())) { return false; } if (!is_numeric($tid)) { return false; } if (($uid = session::get_value('UID')) === false) { return false; } if (!($table_prefix = get_table_prefix())) { return false; } $sql = "DELETE QUICK FROM `{$table_prefix}USER_POLL_VOTES` "; $sql .= "WHERE TID = '{$tid}' AND UID = '{$uid}'"; if (!$db->query($sql)) { return false; } return true; }
function thread_get_last_page_pid($length, $posts_per_page) { if (session::get_value('THREAD_LAST_PAGE') == 'N') { return $length; } $last_page_pid = $length - $length % $posts_per_page; return $last_page_pid > 1 ? $last_page_pid : 1; }
html_draw_error(gettext("The requested thread could not be found or access was denied.")); } if (!($folder_data = folder_get($thread_data['FID']))) { html_draw_error(gettext("The requested folder could not be found or access was denied.")); } if (!($message = messages_get($tid, $pid, 1))) { html_draw_error(gettext("That post does not exist in this thread!")); } html_draw_top("title={$thread_data['TITLE']}", "post.js", "basetarget=_blank", 'class=window_title'); if (isset($thread_data['STICKY']) && isset($thread_data['STICKY_UNTIL'])) { if ($thread_data['STICKY'] == "Y" && $thread_data['STICKY_UNTIL'] != 0 && time() > $thread_data['STICKY_UNTIL']) { thread_set_sticky($tid, false); $thread_data['STICKY'] = "N"; } } $show_sigs = session::get_value('VIEW_SIGS') == 'N' ? false : true; echo "<div align=\"center\">\n"; echo "<table width=\"96%\" border=\"0\">\n"; echo " <tr>\n"; echo " <td align=\"left\">", messages_top($tid, $pid, $thread_data['FID'], $folder_data['TITLE'], $thread_data['TITLE'], $thread_data['INTEREST'], $folder_data['INTEREST'], $thread_data['STICKY'], $thread_data['CLOSED'], $thread_data['ADMIN_LOCK'], $thread_data['DELETED'] == 'Y', true), "</td>\n"; echo " <td align=\"right\">", messages_social_links($tid), "</td>\n"; echo " </tr>\n"; echo "</table>\n"; echo "</div>\n"; if ($message) { $first_msg = $message['PID']; $message['CONTENT'] = message_get_content($tid, $message['PID']); echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"; echo " <tr>\n"; echo " <td align=\"left\" width=\"2%\" valign=\"top\"> </td>\n"; echo " <td align=\"center\">\n";
function forums_get_available_count() { if (!($db = db::get())) { return false; } if (($uid = session::get_value('UID')) === false) { return 0; } $sql = "SELECT COUNT(FORUMS.FID) FROM FORUMS FORUMS "; $sql .= "LEFT JOIN USER_FORUM USER_FORUM ON (USER_FORUM.FID = FORUMS.FID "; $sql .= "AND USER_FORUM.UID = '{$uid}') WHERE FORUMS.ACCESS_LEVEL = 0 "; $sql .= "OR FORUMS.ACCESS_LEVEL = 2 OR (FORUMS.ACCESS_LEVEL = 1 "; $sql .= "AND USER_FORUM.ALLOWED = 1) "; if (!($result = $db->query($sql))) { return false; } list($forum_available_count) = $result->fetch_row(); return $forum_available_count; }
echo " <td align=\"left\">", gettext("Recent Visitors"), "</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=\"100%\">\n"; // Get recent visitors if ($recent_visitors_array = visitor_log_get_recent()) { echo " <tr>\n"; echo " <td align=\"center\">\n"; echo " <table class=\"posthead\" border=\"0\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\">\n"; foreach ($recent_visitors_array as $recent_visitor) { if (isset($recent_visitor['LAST_LOGON']) && $recent_visitor['LAST_LOGON'] > 0) { echo " <tr>\n"; if (session::get_value('SHOW_AVATARS') == 'Y') { if (isset($recent_visitor['AVATAR_URL']) && strlen($recent_visitor['AVATAR_URL']) > 0) { echo " <td valign=\"top\" class=\"postbody\" align=\"left\" width=\"25\"><img src=\"{$recent_visitor['AVATAR_URL']}\" alt=\"\" title=\"", word_filter_add_ob_tags(htmlentities_array(format_user_name($recent_visitor['LOGON'], $recent_visitor['NICKNAME']))), "\" border=\"0\" width=\"16\" height=\"16\" /></td>\n"; } else { if (isset($recent_visitor['AVATAR_AID']) && is_md5($recent_visitor['AVATAR_AID'])) { $attachment = attachments_get_by_hash($recent_visitor['AVATAR_AID']); if ($profile_picture_href = attachments_make_link($attachment, false, false, false, false)) { echo " <td valign=\"top\" class=\"postbody\" align=\"left\" width=\"25\"><img src=\"{$profile_picture_href}&avatar_picture\" alt=\"\" title=\"", word_filter_add_ob_tags(htmlentities_array(format_user_name($recent_visitor['LOGON'], $recent_visitor['NICKNAME']))), "\" border=\"0\" width=\"16\" height=\"16\" /></td>\n"; } else { echo " <td valign=\"top\" align=\"left\" class=\"postbody\" width=\"25\"><img src=\"", html_style_image('bullet.png'), "\" alt=\"", gettext('User'), "\" title=\"", gettext('User'), "\" /></td>\n"; } } else { echo " <td valign=\"top\" align=\"left\" class=\"postbody\" width=\"25\"><img src=\"", html_style_image('bullet.png'), "\" alt=\"", gettext('User'), "\" title=\"", gettext('User'), "\" /></td>\n"; } } } else {