From 5879c1c5c1e7b0860a76a0fc62f62d171c2488f0 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Fri, 21 Jul 2006 20:44:27 +0000 Subject: [PATCH] * Error handling on bans * Missing language strings * Grammatical correction in viewtopic (singular vs plural) git-svn-id: file:///svn/phpbb/trunk@6199 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 6 ++++++ phpBB/language/en/acp/common.php | 1 - phpBB/language/en/common.php | 2 ++ phpBB/styles/subSilver/template/viewtopic_body.html | 2 +- phpBB/viewtopic.php | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index ead2834a5f..72383c1501 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -533,6 +533,12 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas } $sql_usernames = implode(', ', $sql_usernames); + // Make sure we have been given someone to ban + if (empty($sql_usernames)) + { + trigger_error($user->lang['NO_USER_SPECIFIED']); + } + $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE username IN (' . $sql_usernames . ')'; diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index dcefddae89..8c2a97dbf0 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -237,7 +237,6 @@ $lang = array_merge($lang, array( 'NOTIFY' => 'Notification', 'NO_ADMIN' => 'You are not authorised to administer this board.', 'NO_EMAILS_DEFINED' => 'No valid email addresses found', - 'NO_IPS_DEFINED' => 'No IPs or Hostnames defined', 'OFF' => 'OFF', 'ON' => 'ON', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 87691b38fc..2a03794ce3 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -317,6 +317,7 @@ $lang = array_merge($lang, array( 'NO_FORUMS' => 'This board has no forums', 'NO_GROUP' => 'The requested usergroup does not exist.', 'NO_GROUP_MEMBERS' => 'This group currently has no members', + 'NO_IPS_DEFINED' => 'No IPs or Hostnames defined', 'NO_MEMBERS' => 'No members found for this search criteria', 'NO_MESSAGES' => 'No messages', 'NO_MODERATORS' => 'No moderators assigned at this board.', @@ -331,6 +332,7 @@ $lang = array_merge($lang, array( 'NO_UNREAD_PM' => '0 unread messages', 'NO_USER' => 'The requested user does not exist.', 'NO_USERS' => 'The requested users do not exist', + 'NO_USER_SPECIFIED' => 'No username was specified', 'OCCUPATION' => 'Occupation', 'OFFLINE' => 'Offline', diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index ea674bddb9..61d63c3d9c 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -18,7 +18,7 @@

{TOPIC_TITLE}

-

{L_MODERATORS}: {MODERATORS}

+

{L_MODERATOR}{L_MODERATORS}: {MODERATORS}

[ {L_MCP} ]

diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index e7c493f112..088e5c3aaf 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -538,6 +538,7 @@ $template->assign_vars(array( 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, + 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true, 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"), 'S_TOPIC_MOD' => ($topic_mod != '') ? '' : '', 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "t=$topic_id&f=$forum_id&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id),