diff --git a/index.php b/index.php index a9a99310a..73fec4f7e 100644 --- a/index.php +++ b/index.php @@ -17,6 +17,7 @@ $page_cfg['load_tpl_vars'] = array( $show_last_topic = true; $last_topic_max_len = 28; +$show_online_users = true; $show_subforums = true; $datastore->enqueue(array( @@ -402,6 +403,9 @@ if (IS_AM) { } } +// Display page +define('SHOW_ONLINE', $show_online_users); + if (isset($_GET['map'])) { $template->assign_vars(array('PAGE_TITLE' => $lang['FORUM_MAP'])); } diff --git a/library/config.php b/library/config.php index 037a90d98..74891d477 100644 --- a/library/config.php +++ b/library/config.php @@ -520,7 +520,6 @@ $bb_cfg['allow_change'] = [ ]; $bb_cfg['show_jumpbox'] = true; -$bb_cfg['show_online_userlist_index'] = true; $bb_cfg['trash_forum_id'] = 0; // (int) 7 diff --git a/library/includes/page_header.php b/library/includes/page_header.php index e153030f8..af65da172 100644 --- a/library/includes/page_header.php +++ b/library/includes/page_header.php @@ -28,7 +28,7 @@ if ($logged_in) { } // Online userlist -if ($bb_cfg['show_online_userlist_index']) { +if (defined('SHOW_ONLINE') && SHOW_ONLINE) { $online_full = !empty($_REQUEST['online_full']); $online_list = $online_full ? 'online_' . $userdata['user_lang'] : 'online_short_' . $userdata['user_lang']; @@ -38,13 +38,16 @@ if ($bb_cfg['show_online_userlist_index']) { 'cnt' => '', ); - if (!${$online_list} = CACHE('bb_cache')->get($online_list)) { - require INC_DIR . '/online_userlist.php'; + if (defined('IS_GUEST') && !(IS_GUEST || IS_USER)) { + $template->assign_var('SHOW_ONLINE_LIST'); - ${$online_list} = CACHE('bb_cache')->get($online_list); + if (!${$online_list} = CACHE('bb_cache')->get($online_list)) { + require INC_DIR . '/online_userlist.php'; + + ${$online_list} = CACHE('bb_cache')->get($online_list); + } } - $template->assign_var('SHOW_ONLINE_LIST'); $template->assign_vars(array( 'TOTAL_USERS_ONLINE' => ${$online_list}['stat'], 'LOGGED_IN_USER_LIST' => ${$online_list}['userlist'],