$user_emoticons = $_SESSION['EMOTICONS']; } else { $user_emoticons = forum_get_setting('default_emoticons', 'strlen', 'default'); } // Get the user's saved left frame width. if (isset($_SESSION['LEFT_FRAME_WIDTH']) && is_numeric($_SESSION['LEFT_FRAME_WIDTH'])) { $left_frame_width = max(100, $_SESSION['LEFT_FRAME_WIDTH']); } else { $left_frame_width = 280; } // Get the attachment max file size (default: 2MB) if (($attachment_size_limit = forum_get_setting('attachment_size_limit', 'is_numeric', false)) === false) { $attachment_size_limit = convert_shorthand_filesize(ini_get('upload_max_filesize')); } // Construct the Javascript / JSON array $json_data = array('webtag' => $webtag, 'uid' => $_SESSION['UID'], 'lang' => array('loadingdotdotdot' => gettext("Loading..."), 'imageresized' => gettext("This image has been resized (original size %dx%d). To view the full-size image click here."), 'deleteattachmentconfirmation' => gettext("Are you sure you want to delete the selected attachments?"), 'deletemessagesconfirmation' => gettext("Are you sure you want to delete all of the selected messages?"), 'unquote' => gettext("Unquote"), 'quote' => gettext("Quote"), 'searchsuccessfullycompleted' => gettext("Search successfully completed."), 'confirmmarkasread' => gettext("Are you sure you want to mark the selected threads as read?"), 'waitdotdotdot' => gettext("Wait..."), 'more' => gettext("More"), 'pollquestion' => gettext("Poll Question"), 'deletequestion' => gettext("Delete question"), 'allowmultipleoptions' => gettext("Allow multiple options to be selected"), 'addnewoption' => gettext("Add new option"), 'deleteoption' => gettext("Delete option"), 'code' => gettext('Code'), 'retry' => gettext('Retry'), 'cancel' => gettext('Cancel'), 'delete' => gettext('Delete'), 'upload' => gettext('Upload'), 'preferencesnotsaved' => gettext('Your preferences have not been saved')), 'font_size' => $font_size, 'user_style' => $user_style, 'emoticons' => $user_emoticons, 'top_frame' => html_get_top_page(), 'left_frame_width' => max(100, $left_frame_width), 'forum_path' => server_get_forum_path(), 'use_mover_spoiler' => isset($_SESSION['USE_MOVER_SPOILER']) && $_SESSION['USE_MOVER_SPOILER'] == 'Y' ? 'Y' : 'N', 'show_share_links' => isset($_SESSION['SHOW_SHARE_LINKS']) && $_SESSION['SHOW_SHARE_LINKS'] == 'Y' ? 'Y' : 'N', 'auto_scroll_messages' => isset($_SESSION['AUTO_SCROLL_MESSAGES']) && $_SESSION['AUTO_SCROLL_MESSAGES'] == 'Y' ? 'Y' : 'N', 'attachment_size_limit' => $attachment_size_limit, 'frames' => array('index' => html_get_frame_name('index'), 'admin' => html_get_frame_name('admin'), 'start' => html_get_frame_name('start'), 'discussion' => html_get_frame_name('discussion'), 'user' => html_get_frame_name('user'), 'pm' => html_get_frame_name('pm'), 'main' => html_get_frame_name('main'), 'ftop' => html_get_frame_name('ftop'), 'fnav' => html_get_frame_name('fnav'), 'left' => html_get_frame_name('left'), 'right' => html_get_frame_name('right'), 'pm_folders' => html_get_frame_name('pm_folders'), 'pm_messages' => html_get_frame_name('pm_messages'))); // Decide on the correct Content-Type and encoding // of the content. This allows Beehive to reload the // JSON data via the same script, either for use // in a <script> tag or via AJAX. if (isset($_GET['json'])) { $content_type = 'application/json'; $content = json_encode($json_data); } else { $content_type = 'text/javascript'; $content = sprintf('top.window.beehive = $.extend({}, top.window.beehive, %s); $(document).ready(function() { $(top.window.beehive).trigger("init"); });', json_encode($json_data)); } // Send correct Content-Type header
require_once BH_INCLUDE_PATH . 'thread.inc.php'; require_once BH_INCLUDE_PATH . 'threads.inc.php'; require_once BH_INCLUDE_PATH . 'user.inc.php'; // End Required includes // Don't cache this page cache_disable(); if (isset($_GET['view']) && $_GET['view'] == 'full') { html_set_cookie('view', 'full'); header_redirect('index.php'); } else { if (isset($_GET['view']) && $_GET['view'] == 'mobile') { html_set_cookie('view', 'mobile'); header_redirect('index.php'); } } $top_html = html_get_top_page(); $hide_navigation = false; if (!browser_mobile() && !session::is_search_engine()) { if (isset($_GET['final_uri']) && strlen(trim($_GET['final_uri'])) > 0) { $available_files_preg = implode("|^", array_map('preg_quote_callback', get_available_files())); $available_admin_files_preg = implode("|^", array_map('preg_quote_callback', get_available_admin_files())); $my_controls_preg = implode("|^", array_map('preg_quote_callback', get_available_user_files())); if (preg_match("/^{$available_files_preg}/u", trim($_GET['final_uri'])) > 0) { $final_uri = href_cleanup_query_keys($_GET['final_uri']); if (preg_match("/^logon.php/u", $final_uri) > 0) { $hide_navigation = true; } else { if (preg_match("/^{$available_admin_files_preg}/u", $final_uri) > 0) { $final_uri = rawurlencode($final_uri); $final_uri = "admin.php?webtag={$webtag}&page={$final_uri}"; } else {
$font_size = 10; } // User style if (($user_style = session::get_value('STYLE')) === false) { $user_style = html_get_cookie("forum_style", null, forum_get_setting('default_style', null, 'default')); } // User emoticons if (($user_emoticons = session::get_value('EMOTICONS')) === false) { $user_emoticons = forum_get_setting('default_emoticons'); } // Get the user's saved left frame width. if (($left_frame_width = session::get_value('LEFT_FRAME_WIDTH')) === false) { $left_frame_width = 280; } // Construct the Javascript / JSON array $json_data = array('webtag' => $webtag, 'uid' => session::get_value('UID'), 'lang' => array('imageresized' => gettext("This image has been resized (original size %dx%d). To view the full-size image click here."), 'deletemessagesconfirmation' => gettext("Are you sure you want to delete all of the selected messages?"), 'unquote' => gettext("Unquote"), 'quote' => gettext("Quote"), 'searchsuccessfullycompleted' => gettext("Search successfully completed."), 'confirmmarkasread' => gettext("Are you sure you want to mark the selected threads as read?"), 'waitdotdotdot' => gettext("Wait..."), 'more' => gettext("More"), 'pollquestion' => gettext("Poll Question"), 'deletequestion' => gettext("Delete question"), 'allowmultipleoptions' => gettext("Allow multiple options to be selected"), 'addnewoption' => gettext("Add new option"), 'deleteoption' => gettext("Delete option"), 'code' => gettext('code'), 'quote' => gettext('quote')), 'images' => array(), 'font_size' => $font_size, 'user_style' => $user_style, 'emoticons' => $user_emoticons, 'top_frame' => html_get_top_page(), 'left_frame_width' => $left_frame_width, 'forum_path' => server_get_forum_path(), 'use_mover_spoiler' => session::get_value('USE_MOVER_SPOILER'), 'frames' => array('index' => html_get_frame_name('index'), 'admin' => html_get_frame_name('admin'), 'start' => html_get_frame_name('start'), 'discussion' => html_get_frame_name('discussion'), 'user' => html_get_frame_name('user'), 'pm' => html_get_frame_name('pm'), 'main' => html_get_frame_name('main'), 'ftop' => html_get_frame_name('ftop'), 'fnav' => html_get_frame_name('fnav'), 'left' => html_get_frame_name('left'), 'right' => html_get_frame_name('right'), 'pm_folders' => html_get_frame_name('pm_folders'), 'pm_messages' => html_get_frame_name('pm_messages'))); if ($images_array = glob("styles/{$user_style}/images/*.png")) { foreach ($images_array as $image_filename) { $image_filename = basename($image_filename); $json_data['images'][$image_filename] = html_style_image($image_filename); } } // Decide on the correct Content-Type and encoding // of the content. This allows Beehive to reload the // JSON data via the same script, either for use // in a <script> tag or via AJAX. if (isset($_GET['json'])) { $content_type = 'application/json'; $content = json_encode($json_data); } else { $content_type = 'text/javascript';