aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/functions.php39
-rw-r--r--phpBB/language/en/common.php27
2 files changed, 45 insertions, 21 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index e61df309b3..6363dd0264 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3215,7 +3215,7 @@ function obtain_users_online($forum_id = 0)
*/
function obtain_users_online_string($online_users, $forum_id = 0)
{
- global $db, $user, $auth;
+ global $config, $db, $user, $auth;
$user_online_link = $online_userlist = '';
@@ -3256,34 +3256,45 @@ function obtain_users_online_string($online_users, $forum_id = 0)
{
$online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist;
}
- else
+ else if ($config['load_online_guests'])
{
$l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_FORUM_GUEST'] : $user->lang['BROWSING_FORUM_GUESTS'];
$online_userlist = sprintf($l_online, $online_userlist, $online_users['guests_online']);
}
-
+ else
+ {
+ $online_userlist = sprintf($user->lang['BROWSING_FORUM'], $online_userlist);
+ }
// Build online listing
$vars_online = array(
- 'ONLINE' => array('total_online', 'l_t_user_s'),
- 'REG' => array('visible_online', 'l_r_user_s'),
- 'HIDDEN' => array('hidden_online', 'l_h_user_s'),
- 'GUEST' => array('guests_online', 'l_g_user_s')
+ 'ONLINE' => array('total_online', 'l_t_user_s', 0),
+ 'REG' => array('visible_online', 'l_r_user_s', !$config['load_online_guests']),
+ 'HIDDEN' => array('hidden_online', 'l_h_user_s', $config['load_online_guests']),
+ 'GUEST' => array('guests_online', 'l_g_user_s', 0)
);
foreach ($vars_online as $l_prefix => $var_ary)
{
+ if ($var_ary[2])
+ {
+ $l_suffix = '_AND';
+ }
+ else
+ {
+ $l_suffix = '';
+ }
switch ($online_users[$var_ary[0]])
{
case 0:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL'];
+ ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL' . $l_suffix];
break;
case 1:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL'];
+ ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL' . $l_suffix];
break;
default:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL'];
+ ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL' . $l_suffix];
break;
}
}
@@ -3292,7 +3303,13 @@ function obtain_users_online_string($online_users, $forum_id = 0)
$l_online_users = sprintf($l_t_user_s, $online_users['total_online']);
$l_online_users .= sprintf($l_r_user_s, $online_users['visible_online']);
$l_online_users .= sprintf($l_h_user_s, $online_users['hidden_online']);
- $l_online_users .= sprintf($l_g_user_s, $online_users['guests_online']);
+
+ if ($config['load_online_guests'])
+ {
+ $l_online_users .= sprintf($l_g_user_s, $online_users['guests_online']);
+ }
+
+
return array(
'online_userlist' => $online_userlist,
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 8e739206c5..db5f49339a 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -106,6 +106,7 @@ $lang = array_merge($lang, array(
'BOARD_DISABLE' => 'Sorry but this board is currently unavailable.',
'BOARD_DISABLED' => 'This board is currently disabled.',
'BOARD_UNAVAILABLE' => 'Sorry but the board is temporarily unavailable, please try again in a few minutes.',
+ 'BROWSING_FORUM' => 'Users browsing this forum: %1$s',
'BROWSING_FORUM_GUEST' => 'Users browsing this forum: %1$s and %2$d guest',
'BROWSING_FORUM_GUESTS' => 'Users browsing this forum: %1$s and %2$d guests',
'BYTES' => 'Bytes',
@@ -245,16 +246,19 @@ $lang = array_merge($lang, array(
'G_REGISTERED_COPPA' => 'Registered COPPA users',
'G_GLOBAL_MODERATORS' => 'Global moderators',
- 'HIDDEN_USERS_ONLINE' => '%d hidden users online',
- 'HIDDEN_USERS_TOTAL' => '%d hidden and ',
- 'HIDDEN_USERS_ZERO_ONLINE' => '0 hidden users online',
- 'HIDDEN_USERS_ZERO_TOTAL' => '0 hidden and ',
- 'HIDDEN_USER_ONLINE' => '%d hidden user online',
- 'HIDDEN_USER_TOTAL' => '%d hidden and ',
- 'HIDE_GUESTS' => 'Hide guests',
- 'HIDE_ME' => 'Hide my online status this session',
- 'HOURS' => 'Hours',
- 'HOME' => 'Home',
+ 'HIDDEN_USERS_ONLINE' => '%d hidden users online',
+ 'HIDDEN_USERS_TOTAL' => '%d hidden',
+ 'HIDDEN_USERS_TOTAL_AND' => '%d hidden and ',
+ 'HIDDEN_USERS_ZERO_ONLINE' => '0 hidden users online',
+ 'HIDDEN_USERS_ZERO_TOTAL' => '0 hidden',
+ 'HIDDEN_USERS_ZERO_TOTAL_AND' => '0 hidden and ',
+ 'HIDDEN_USER_ONLINE' => '%d hidden user online',
+ 'HIDDEN_USER_TOTAL' => '%d hidden',
+ 'HIDDEN_USER_TOTAL_AND' => '%d hidden and ',
+ 'HIDE_GUESTS' => 'Hide guests',
+ 'HIDE_ME' => 'Hide my online status this session',
+ 'HOURS' => 'Hours',
+ 'HOME' => 'Home',
'ICQ' => 'ICQ',
'ICQ_STATUS' => 'ICQ status',
@@ -446,10 +450,13 @@ $lang = array_merge($lang, array(
'REGISTERED_USERS' => 'Registered users:',
'REG_USERS_ONLINE' => 'There are %d registered users and ',
'REG_USERS_TOTAL' => '%d registered, ',
+ 'REG_USERS_TOTAL_AND' => '%d registered and ',
'REG_USERS_ZERO_ONLINE' => 'There are 0 registered users and ',
'REG_USERS_ZERO_TOTAL' => '0 registered, ',
+ 'REG_USERS_ZERO_TOTAL_AND' => '0 registered and ',
'REG_USER_ONLINE' => 'There is %d registered user and ',
'REG_USER_TOTAL' => '%d registered, ',
+ 'REG_USER_TOTAL_AND' => '%d registered and ',
'REMOVE' => 'Remove',
'REMOVE_INSTALL' => 'Please delete, move or rename the install directory before you use your board. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.',
'REPLIES' => 'Replies',