if (isset($_POST['dob_display'])) { $user_prefs['DOB_DISPLAY'] = trim($_POST['dob_display']); } else { $user_prefs['DOB_DISPLAY'] = 0; } // Update USER_PREFS if (user_update_prefs($_SESSION['UID'], $user_prefs, $user_prefs_global)) { header_redirect("edit_email.php?webtag={$webtag}&updated=true"); exit; } else { $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later."); $valid = false; } } // Check to see if we should show the set for all forums checkboxes $show_set_all = forums_get_available_count() > 1 ? true : false; html_draw_top(array('title' => gettext('My Controls - Email & Privacy'), 'class' => 'window_title', 'js' => array('js/prefs.js'))); echo "<h1>", htmlentities_array(gettext("Email & Privacy")), "</h1>\n"; if (isset($error_msg_array) && sizeof($error_msg_array) > 0) { html_display_error_array($error_msg_array, '700', 'left'); } else { if (isset($_GET['updated'])) { html_display_success_msg(gettext("Preferences were successfully updated."), '700', 'left'); } } echo "<br />\n"; echo "<form accept-charset=\"utf-8\" name=\"prefs\" action=\"edit_email.php\" method=\"post\" target=\"_self\">\n"; echo " ", form_csrf_token_field(), "\n"; echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"700\">\n"; echo " <tr>\n";
function light_navigation_bar(array $options = array()) { $nav_links = array(); $back = null; $webtag = get_webtag(); forum_check_webtag_available($webtag); $available_back_button_files = implode("|^", array_map('preg_quote_callback', get_light_back_button_files())); foreach ($options as $key => $value) { switch ($key) { case 'nav_links': if (!is_array($value) || count(array_filter($value, 'light_validate_nav_link')) != count($value)) { throw new InvalidArgumentException(sprintf('Expecting light_navigation_bar argument %s to be an array of arrays, each with class, url, text and image keys', $key)); } ${$key} = $value; break; case 'back': if (preg_match("/^{$available_back_button_files}/u", basename($back))) { throw new InvalidArgumentException('Expecting light_navigation_bar argument back to be in permitted light back button files'); } $back = !isset($back) && isset($value) ? $value : $back; break; default: throw new InvalidArgumentException(sprintf('Unknown light_navigation_bar argument "%s"', $key)); break; } } echo "<div id=\"header\">\n"; echo " <span class=\"left\">\n"; if (isset($back)) { echo " <span class=\"back\"><a href=\"{$back}\">", html_style_image('mobile_back', gettext("Back")), "</a></span>\n"; } else { echo " <span class=\"icon\">", html_style_image('mobile_icon', gettext("Beehive Forum")), "</span>\n"; } echo " ", html_style_image('mobile_logo', gettext("Beehive Forum Logo")), "\n"; echo " </span>\n"; echo " <ul>\n"; foreach ($nav_links as $nav_link) { echo " <li>\n"; echo " <a class=\"{$nav_link['class']}\" href=\"", htmlentities_array($nav_link['url']), "\">\n"; echo " ", html_style_image($nav_link['image']), "<span class=\"text\">", $nav_link['text'], "</span>\n"; echo " </a>\n"; echo " </li>\n"; } echo " <li>\n"; echo " <a class=\"main\" href=\"#\">", html_style_image('mobile_menu', gettext("Menu")); $pm_unread_count = pm_get_unread_count(); if ($pm_unread_count > 0) { echo " <span class=\"mobile_notification\">", max(min($pm_unread_count, 99), 0), "</span>"; } echo " </a>"; echo " </li>\n"; echo " </ul>\n"; echo "</div>\n"; echo "<div class=\"menu main\">\n"; echo " <ul>\n"; if (forums_get_available_count() > 1 || !forum_get_default()) { echo " <li><a href=\"lforums.php?webtag={$webtag}\">", gettext("My Forums"), "</a></li>\n"; } if (forum_check_webtag_available($webtag, false)) { echo " <li><a href=\"lthread_list.php?webtag={$webtag}\">", gettext("Messages"), "</a></li>\n"; } if ($pm_unread_count > 0) { echo " <li><a href=\"lpm.php?webtag={$webtag}\">", gettext("Inbox"), "<span class=\"mobile_notification\">", max(min($pm_unread_count, 99), 0), "</span></a></li>"; } else { echo " <li><a href=\"lpm.php?webtag={$webtag}\">", gettext("Inbox"), "</a></li>\n"; } if (forum_check_webtag_available($webtag, false)) { echo " <li><a href=\"lsearch.php?webtag={$webtag}\">", gettext("Search"), "</a></li>\n"; } if (!session::logged_in()) { echo " <li><a href=\"llogon.php?webtag={$webtag}\">", gettext("Login"), "</a></li>\n"; } else { echo " <li><a href=\"llogout.php?webtag={$webtag}\">", gettext("Logout"), "</a></li>\n"; } echo " </ul>\n"; echo "</div>\n"; foreach ($nav_links as $nav_link) { if (isset($nav_link['html'])) { echo " <div class=\"menu {$nav_link['class']}\">{$nav_link['html']}</div>\n"; } } echo "<div id=\"page_content\">\n"; light_pm_check_messages(); if (html_output_adsense_settings() && adsense_check_user() && adsense_check_page()) { adsense_output_html(); } }
html_display_error_array($error_msg_array, '700', 'left'); } else { if (isset($_GET['updated'])) { html_display_success_msg(gettext("Signature Updated"), '700', 'left'); } else { if (isset($_GET['updated_global'])) { html_display_success_msg(gettext("Signature Updated For All Forums"), '700', 'left'); } } } echo "<br />\n"; if ($admin_edit === true) { echo "<div align=\"center\">\n"; } if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0, 0) && $admin_edit || $sig_uid == $_SESSION['UID'] && $admin_edit === false) { $show_set_all = forums_get_available_count() > 1; } else { $show_set_all = false; } echo "<form accept-charset=\"utf-8\" name=\"prefs\" action=\"edit_signature.php\" method=\"post\" target=\"_self\">\n"; echo " ", form_csrf_token_field(), "\n"; echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n"; if ($admin_edit === true) { echo " ", form_input_hidden('sig_uid', htmlentities_array($sig_uid)), "\n"; } echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"700\">\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";
} else { if ($_REQUEST['mark_read_type'] == THREAD_MARK_READ_FOLDER && (isset($folder) && is_numeric($folder))) { if (threads_mark_folder_read($folder)) { header_redirect("lthread_list.php?webtag={$webtag}&mode={$mode}&folder={$folder}&mark_read_success=true"); exit; } else { $error_msg_array[] = gettext("Failed to mark selected threads as read"); $valid = false; } } } } } } else { unset($_REQUEST['mark_read_submit'], $_REQUEST['mark_read_confirm']); light_html_draw_top(); light_navigation_bar(); light_html_display_msg(gettext("Confirm"), gettext("Are you sure you want to mark the selected threads as read?"), 'lthread_list.php', 'post', array('mark_read_submit' => gettext("Confirm"), 'cancel' => gettext("Cancel")), array_merge($_REQUEST, array('mark_read_confirm' => 'Y'))); light_html_draw_bottom(); exit; } } } light_html_draw_top(array('js' => array('js/thread_list.js'))); if (forums_get_available_count() > 1 || !forum_get_default()) { light_navigation_bar(array('back' => "lforums.php?webtag={$webtag}", 'nav_links' => array(array('text' => gettext('New Discussion'), 'url' => "lpost.php?webtag={$webtag}", 'class' => 'post_new', 'image' => 'mobile_post')))); } else { light_navigation_bar(array('nav_links' => array(array('text' => gettext('New Discussion'), 'url' => "lpost.php?webtag={$webtag}", 'class' => 'post_new', 'image' => 'mobile_post')))); } light_draw_thread_list($mode, $folder, $page); light_html_draw_bottom();
function light_html_draw_top() { static $called = false; if ($called) { return; } $called = true; $arg_array = func_get_args(); $title = null; $robots = null; $webtag = get_webtag(); $link_array = array(); $func_matches = array(); $forum_name = forum_get_setting('forum_name', null, 'A Beehive Forum'); 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('/^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('/^link=([^:]+):(.+)$/Disu', $func_args, $func_matches) > 0) { $link_array[] = array('rel' => $func_matches[1], 'href' => $func_matches[2]); unset($arg_array[$key]); } } // Default Meta keywords and description. $meta_keywords = html_get_forum_keywords(); $meta_description = html_get_forum_description(); 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=\"", gettext("ltr"), "\">\n"; echo "<head>\n"; 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"; } } echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"; 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=\"MobileOptimized\" content=\"0\" />\n"; echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\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 ($stylesheet = html_get_style_sheet('mobile.css')) { echo "<link rel=\"stylesheet\" href=\"{$stylesheet}\" type=\"text/css\" media=\"screen\" />\n"; } if ($emoticon_stylesheet = html_get_emoticon_style_sheet(true)) { echo "<link rel=\"stylesheet\" href=\"{$emoticon_stylesheet}\" type=\"text/css\" media=\"screen\" />\n"; } $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(gettext("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(gettext("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))); } echo "<script type=\"text/javascript\" src=\"js/jquery-1.7.1.min.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"js/jquery.sprintf.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"js/general.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"js/light.js\"></script>\n"; $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)) { if (session::get_value('USE_MOVER_SPOILER') == "Y") { echo "<script type=\"text/javascript\" src=\"js/spoiler.js\"></script>\n"; } } echo "<script type=\"text/javascript\" src=\"ckeditor/ckeditor.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"ckeditor/adapters/jquery.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"json.php?webtag={$webtag}\"></script>\n"; echo "</head>\n"; echo "<body id=\"mobile\">\n"; echo "<a name=\"top\"></a>\n"; echo "<div id=\"header\">\n"; echo " <img src=\"", html_style_image('mobile_logo.png'), "\" alt=\"", gettext("Beehive Forum Logo"), "\" />\n"; echo " <div id=\"nav\">", gettext("Menu"), "</div>\n"; echo "</div>\n"; echo "<div id=\"menu\">\n"; echo " <ul>\n"; if (forums_get_available_count() > 1 || !forum_check_webtag_available($webtag)) { echo " <li class=\"menu_item\"><a href=\"lforums.php?webtag={$webtag}\">", gettext("My Forums"), "</a></li>\n"; } echo " <li class=\"menu_item\"><a href=\"lthread_list.php?webtag={$webtag}\">", gettext("Messages"), "</a></li>\n"; echo " <li class=\"menu_item\"><a href=\"lpm.php?webtag={$webtag}\">", gettext("Inbox"), "</a></li>\n"; if (!session::logged_in()) { echo " <li class=\"menu_item\"><a href=\"llogon.php?webtag={$webtag}\">", gettext("Login"), "</a></li>\n"; } else { echo " <li class=\"menu_item\"><a href=\"llogout.php?webtag={$webtag}\">", gettext("Logout"), "</a></li>\n"; } echo " </ul>\n"; echo "</div>\n"; echo "<div id=\"content\">\n"; light_pm_check_messages(); if (html_output_adsense_settings() && adsense_check_user() && adsense_check_page()) { adsense_output_html(); } }
echo "<a href=\"start.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Start"), "</a> | \n"; echo "<a href=\"discussion.php?webtag={$webtag}\" target=\"", html_get_frame_name('main'), "\">", gettext("Messages"), "</a> | \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";