1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 07:21:30 +02:00

[ticket/14972] replace all occurrences of sizeof() with the count()

PHPBB3-14972
This commit is contained in:
rxu
2017-06-28 00:58:03 +07:00
parent 67a65e3788
commit 797234e416
165 changed files with 986 additions and 986 deletions

View File

@@ -97,7 +97,7 @@ class acp_prune
'S_PRUNED' => true)
);
$sql_forum = (sizeof($forum_id)) ? ' AND ' . $db->sql_in_set('forum_id', $forum_id) : '';
$sql_forum = (count($forum_id)) ? ' AND ' . $db->sql_in_set('forum_id', $forum_id) : '';
// Get a list of forum's or the data for the forum that we are pruning.
$sql = 'SELECT forum_id, forum_name
@@ -183,7 +183,7 @@ class acp_prune
// If they haven't selected a forum for pruning yet then
// display a select box to use for pruning.
if (!sizeof($forum_id))
if (!count($forum_id))
{
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
@@ -215,7 +215,7 @@ class acp_prune
$db->sql_freeresult($result);
$l_selected_forums = (sizeof($forum_id) == 1) ? 'SELECTED_FORUM' : 'SELECTED_FORUMS';
$l_selected_forums = (count($forum_id) == 1) ? 'SELECTED_FORUM' : 'SELECTED_FORUMS';
$template->assign_vars(array(
'L_SELECTED_FORUMS' => $user->lang[$l_selected_forums],
@@ -252,7 +252,7 @@ class acp_prune
$user_ids = $usernames = array();
$this->get_prune_users($user_ids, $usernames);
if (sizeof($user_ids))
if (count($user_ids))
{
if ($action == 'deactivate')
{
@@ -291,7 +291,7 @@ class acp_prune
$user_ids = $usernames = array();
$this->get_prune_users($user_ids, $usernames);
if (!sizeof($user_ids))
if (!count($user_ids))
{
trigger_error($user->lang['USER_PRUNE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -434,7 +434,7 @@ class acp_prune
}
// implicit else when both arrays are empty do nothing
if ((sizeof($active) && sizeof($active) != 3) || (sizeof($joined_before) && sizeof($joined_before) != 3) || (sizeof($joined_after) && sizeof($joined_after) != 3))
if ((count($active) && count($active) != 3) || (count($joined_before) && count($joined_before) != 3) || (count($joined_after) && count($joined_after) != 3))
{
trigger_error($user->lang['WRONG_ACTIVE_JOINED_DATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@@ -448,15 +448,15 @@ class acp_prune
$where_sql .= ($count !== false) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
// First handle pruning of users who never logged in, last active date is 0000-00-00
if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0)
if (count($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0)
{
$where_sql .= ' AND user_lastvisit = 0';
}
else if (sizeof($active) && $active_select != 'lt')
else if (count($active) && $active_select != 'lt')
{
$where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]);
}
else if (sizeof($active))
else if (count($active))
{
$where_sql .= ' AND (user_lastvisit > 0 AND user_lastvisit < ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]) . ')';
}