[ticket/10684] Adjust function and parameter name, minor changes.

PHPBB3-10684
This commit is contained in:
rxu 2012-03-22 21:19:01 +08:00
parent ff8d523768
commit 5a9dd1994f
3 changed files with 9 additions and 9 deletions

View file

@ -1181,11 +1181,11 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
$topic_title = censor_text($topic_title); $topic_title = censor_text($topic_title);
// Exclude guests, current user and banned users from notifications // Exclude guests, current user and banned users from notifications
if (!function_exists('phpbb_get_banned_users_ids')) if (!function_exists('phpbb_get_banned_user_ids'))
{ {
include($phpbb_root_path . 'includes/functions_user.' . $phpEx); include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
} }
$sql_ignore_users = phpbb_get_banned_users_ids(); $sql_ignore_users = phpbb_get_banned_user_ids();
$sql_ignore_users[ANONYMOUS] = ANONYMOUS; $sql_ignore_users[ANONYMOUS] = ANONYMOUS;
$sql_ignore_users[$user->data['user_id']] = $user->data['user_id']; $sql_ignore_users[$user->data['user_id']] = $user->data['user_id'];

View file

@ -1630,11 +1630,11 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i
return; return;
} }
if (!function_exists('phpbb_get_banned_users_ids')) if (!function_exists('phpbb_get_banned_user_ids'))
{ {
include($phpbb_root_path . 'includes/functions_user.' . $phpEx); include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
} }
$banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); $banned_users = phpbb_get_banned_user_ids(array_keys($recipients));
$recipients = array_diff(array_keys($recipients), $banned_users); $recipients = array_diff(array_keys($recipients), $banned_users);
if (!sizeof($recipients)) if (!sizeof($recipients))

View file

@ -3588,24 +3588,24 @@ function remove_newly_registered($user_id, $user_data = false)
} }
/** /**
* Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. * Gets user ids of currently banned registered users.
* *
* @param array $users_ids Array of users' ids to check for banning, * @param array $user_ids Array of users' ids to check for banning,
* leave empty to get complete list of banned ids * leave empty to get complete list of banned ids
* @return array Array of banned users' ids if any, empty array otherwise * @return array Array of banned users' ids if any, empty array otherwise
*/ */
function phpbb_get_banned_users_ids($users_ids = array()) function phpbb_get_banned_user_ids($user_ids = array())
{ {
global $db; global $db;
$sql_users_ids = (!empty($users_ids)) ? $db->sql_in_set('ban_userid', $users_ids) : 'ban_userid <> 0'; $sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : 'ban_userid <> 0';
// Get banned User ID's // Get banned User ID's
// Ignore stale bans which were not wiped yet // Ignore stale bans which were not wiped yet
$banned_ids_list = array(); $banned_ids_list = array();
$sql = 'SELECT ban_userid $sql = 'SELECT ban_userid
FROM ' . BANLIST_TABLE . " FROM ' . BANLIST_TABLE . "
WHERE $sql_users_ids WHERE $sql_user_ids
AND ban_exclude <> 1 AND ban_exclude <> 1
AND (ban_end > " . time() . ' AND (ban_end > " . time() . '
OR ban_end = 0)'; OR ban_end = 0)';