mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/14972] replace all occurrences of sizeof() with the count()
PHPBB3-14972
This commit is contained in:
@@ -190,7 +190,7 @@ class acp_attachments
|
||||
validate_config_vars($display_vars['vars'], $cfg_array, $error);
|
||||
|
||||
// Do not write values if there is an error
|
||||
if (sizeof($error))
|
||||
if (count($error))
|
||||
{
|
||||
$submit = false;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ class acp_attachments
|
||||
// Check Settings
|
||||
$this->test_upload($error, $this->new_config['upload_path'], false);
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
@@ -256,14 +256,14 @@ class acp_attachments
|
||||
$supported_types = get_supported_image_types();
|
||||
|
||||
// Check Thumbnail Support
|
||||
if (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format'])))
|
||||
if (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !count($supported_types['format'])))
|
||||
{
|
||||
$this->new_config['img_create_thumbnail'] = 0;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_SEARCH_IMAGICK' => $this->u_action . '&action=imgmagick',
|
||||
'S_THUMBNAIL_SUPPORT' => (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format']))) ? false : true)
|
||||
'S_THUMBNAIL_SUPPORT' => (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !count($supported_types['format']))) ? false : true)
|
||||
);
|
||||
|
||||
// Secure Download Options - Same procedure as with banning
|
||||
@@ -290,7 +290,7 @@ class acp_attachments
|
||||
$template->assign_vars(array(
|
||||
'S_SECURE_DOWNLOADS' => $this->new_config['secure_downloads'],
|
||||
'S_DEFINED_IPS' => ($defined_ips != '') ? true : false,
|
||||
'S_WARNING' => (sizeof($error)) ? true : false,
|
||||
'S_WARNING' => (count($error)) ? true : false,
|
||||
|
||||
'WARNING_MSG' => implode('<br />', $error),
|
||||
'DEFINED_IPS' => $defined_ips,
|
||||
@@ -363,7 +363,7 @@ class acp_attachments
|
||||
// Generate correct Change List
|
||||
$extensions = array();
|
||||
|
||||
for ($i = 0, $size = sizeof($extension_change_list); $i < $size; $i++)
|
||||
for ($i = 0, $size = count($extension_change_list); $i < $size; $i++)
|
||||
{
|
||||
$extensions[$extension_change_list[$i]]['group_id'] = $group_select_list[$i];
|
||||
}
|
||||
@@ -390,7 +390,7 @@ class acp_attachments
|
||||
// Delete Extension?
|
||||
$extension_id_list = $request->variable('extension_id_list', array(0));
|
||||
|
||||
if (sizeof($extension_id_list))
|
||||
if (count($extension_id_list))
|
||||
{
|
||||
$sql = 'SELECT extension
|
||||
FROM ' . EXTENSIONS_TABLE . '
|
||||
@@ -420,7 +420,7 @@ class acp_attachments
|
||||
|
||||
if ($add_extension && $add)
|
||||
{
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$sql = 'SELECT extension_id
|
||||
FROM ' . EXTENSIONS_TABLE . "
|
||||
@@ -433,7 +433,7 @@ class acp_attachments
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$sql_ary = array(
|
||||
'group_id' => $add_extension_group,
|
||||
@@ -447,7 +447,7 @@ class acp_attachments
|
||||
}
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$notify[] = $user->lang['EXTENSIONS_UPDATED'];
|
||||
}
|
||||
@@ -558,7 +558,7 @@ class acp_attachments
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
// Ok, build the update/insert array
|
||||
$upload_icon = $request->variable('upload_icon', 'no_image');
|
||||
@@ -575,7 +575,7 @@ class acp_attachments
|
||||
$max_filesize = 0;
|
||||
}
|
||||
|
||||
if (!sizeof($allowed_forums))
|
||||
if (!count($allowed_forums))
|
||||
{
|
||||
$forum_select = false;
|
||||
}
|
||||
@@ -612,7 +612,7 @@ class acp_attachments
|
||||
|
||||
$extension_list = $request->variable('extensions', array(0));
|
||||
|
||||
if ($action == 'edit' && sizeof($extension_list))
|
||||
if ($action == 'edit' && count($extension_list))
|
||||
{
|
||||
$sql = 'UPDATE ' . EXTENSIONS_TABLE . "
|
||||
SET group_id = 0
|
||||
@@ -620,7 +620,7 @@ class acp_attachments
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if (sizeof($extension_list))
|
||||
if (count($extension_list))
|
||||
{
|
||||
$sql = 'UPDATE ' . EXTENSIONS_TABLE . "
|
||||
SET group_id = $group_id
|
||||
@@ -630,7 +630,7 @@ class acp_attachments
|
||||
|
||||
$cache->destroy('_extensions');
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$notify[] = $user->lang['SUCCESS_EXTENSION_GROUP_' . strtoupper($action)];
|
||||
}
|
||||
@@ -806,7 +806,7 @@ class acp_attachments
|
||||
'S_FILENAME_LIST' => $filename_list,
|
||||
'S_EDIT_GROUP' => true,
|
||||
'S_NO_IMAGE' => $no_image_select,
|
||||
'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false,
|
||||
'S_FORUM_IDS' => (count($forum_ids)) ? true : false,
|
||||
|
||||
'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=extensions"),
|
||||
'U_BACK' => $this->u_action,
|
||||
@@ -928,7 +928,7 @@ class acp_attachments
|
||||
$add_files = (isset($_POST['add'])) ? array_keys($request->variable('add', array('' => 0))) : array();
|
||||
$post_ids = $request->variable('post_id', array('' => 0));
|
||||
|
||||
if (sizeof($delete_files))
|
||||
if (count($delete_files))
|
||||
{
|
||||
$sql = 'SELECT *
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
@@ -951,7 +951,7 @@ class acp_attachments
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (sizeof($delete_files))
|
||||
if (count($delete_files))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('attach_id', array_keys($delete_files));
|
||||
@@ -971,7 +971,7 @@ class acp_attachments
|
||||
}
|
||||
unset($add_files);
|
||||
|
||||
if (sizeof($upload_list))
|
||||
if (count($upload_list))
|
||||
{
|
||||
$template->assign_var('S_UPLOADING_FILES', true);
|
||||
|
||||
@@ -1094,7 +1094,7 @@ class acp_attachments
|
||||
{
|
||||
$delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array();
|
||||
|
||||
if (sizeof($delete_files))
|
||||
if (count($delete_files))
|
||||
{
|
||||
// Select those attachments we want to delete...
|
||||
$sql = 'SELECT real_filename
|
||||
@@ -1110,7 +1110,7 @@ class acp_attachments
|
||||
|
||||
if ($num_deleted = $this->attachment_manager->delete('attach', $delete_files))
|
||||
{
|
||||
if (sizeof($delete_files) != $num_deleted)
|
||||
if (count($delete_files) != $num_deleted)
|
||||
{
|
||||
$error[] = $user->lang['FILES_GONE'];
|
||||
}
|
||||
@@ -1231,7 +1231,7 @@ class acp_attachments
|
||||
// Grab extensions
|
||||
$extensions = $cache->obtain_attach_extensions(true);
|
||||
|
||||
for ($i = 0, $end = sizeof($attachments_list); $i < $end; ++$i)
|
||||
for ($i = 0, $end = count($attachments_list); $i < $end; ++$i)
|
||||
{
|
||||
$row = $attachments_list[$i];
|
||||
|
||||
@@ -1266,7 +1266,7 @@ class acp_attachments
|
||||
break;
|
||||
}
|
||||
|
||||
if (sizeof($error))
|
||||
if (count($error))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_WARNING' => true,
|
||||
@@ -1274,7 +1274,7 @@ class acp_attachments
|
||||
);
|
||||
}
|
||||
|
||||
if (sizeof($notify))
|
||||
if (count($notify))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_NOTIFY' => true,
|
||||
@@ -1443,7 +1443,7 @@ class acp_attachments
|
||||
$row['group_name'] = $user->lang['NOT_ASSIGNED'];
|
||||
$group_name[] = $row;
|
||||
|
||||
for ($i = 0, $groups_size = sizeof($group_name); $i < $groups_size; $i++)
|
||||
for ($i = 0, $groups_size = count($group_name); $i < $groups_size; $i++)
|
||||
{
|
||||
if ($default_group === false)
|
||||
{
|
||||
@@ -1676,7 +1676,7 @@ class acp_attachments
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($iplist))
|
||||
if (count($iplist))
|
||||
{
|
||||
foreach ($iplist as $ip_entry)
|
||||
{
|
||||
@@ -1686,7 +1686,7 @@ class acp_attachments
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($hostlist))
|
||||
if (count($hostlist))
|
||||
{
|
||||
foreach ($hostlist as $host_entry)
|
||||
{
|
||||
@@ -1709,7 +1709,7 @@ class acp_attachments
|
||||
{
|
||||
$unip_sql = $request->variable('unip', array(0));
|
||||
|
||||
if (sizeof($unip_sql))
|
||||
if (count($unip_sql))
|
||||
{
|
||||
$l_unip_list = '';
|
||||
|
||||
|
@@ -494,7 +494,7 @@ class acp_bbcodes
|
||||
// Pad backreference numbers from tokens
|
||||
if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad))
|
||||
{
|
||||
$repad = $pad + sizeof(array_unique($repad[0]));
|
||||
$repad = $pad + count(array_unique($repad[0]));
|
||||
$replace = preg_replace_callback('/(?<!\\\\)\$([0-9]+)/', function ($match) use ($pad) {
|
||||
return '${' . ($match[1] + $pad) . '}';
|
||||
}, $replace);
|
||||
|
@@ -503,7 +503,7 @@ class acp_board
|
||||
$error[] = $user->lang['FORM_INVALID'];
|
||||
}
|
||||
// Do not write values if there is an error
|
||||
if (sizeof($error))
|
||||
if (count($error))
|
||||
{
|
||||
$submit = false;
|
||||
}
|
||||
@@ -690,7 +690,7 @@ class acp_board
|
||||
'L_TITLE' => $user->lang[$display_vars['title']],
|
||||
'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'],
|
||||
|
||||
'S_ERROR' => (sizeof($error)) ? true : false,
|
||||
'S_ERROR' => (count($error)) ? true : false,
|
||||
'ERROR_MSG' => implode('<br />', $error),
|
||||
|
||||
'U_ACTION' => $this->u_action)
|
||||
@@ -1110,7 +1110,7 @@ class acp_board
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Already emptied for all...
|
||||
if (sizeof($values))
|
||||
if (count($values))
|
||||
{
|
||||
// Set for selected forums
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
||||
|
@@ -55,7 +55,7 @@ class acp_bots
|
||||
switch ($action)
|
||||
{
|
||||
case 'activate':
|
||||
if ($bot_id || sizeof($mark))
|
||||
if ($bot_id || count($mark))
|
||||
{
|
||||
$sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')';
|
||||
|
||||
@@ -69,7 +69,7 @@ class acp_bots
|
||||
break;
|
||||
|
||||
case 'deactivate':
|
||||
if ($bot_id || sizeof($mark))
|
||||
if ($bot_id || count($mark))
|
||||
{
|
||||
$sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')';
|
||||
|
||||
@@ -83,7 +83,7 @@ class acp_bots
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if ($bot_id || sizeof($mark))
|
||||
if ($bot_id || count($mark))
|
||||
{
|
||||
if (confirm_box(true))
|
||||
{
|
||||
@@ -109,7 +109,7 @@ class acp_bots
|
||||
WHERE bot_id $sql_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (sizeof($user_id_ary))
|
||||
if (count($user_id_ary))
|
||||
{
|
||||
$_tables = array(USERS_TABLE, USER_GROUP_TABLE);
|
||||
foreach ($_tables as $table)
|
||||
@@ -207,7 +207,7 @@ class acp_bots
|
||||
$error[] = $user->lang['BOT_NAME_TAKEN'];
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
// New bot? Create a new user and group entry
|
||||
if ($action == 'add')
|
||||
@@ -338,7 +338,7 @@ class acp_bots
|
||||
'L_TITLE' => $user->lang['BOT_' . $l_title],
|
||||
'U_ACTION' => $this->u_action . "&id=$bot_id&action=$action",
|
||||
'U_BACK' => $this->u_action,
|
||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'ERROR_MSG' => (count($error)) ? implode('<br />', $error) : '',
|
||||
|
||||
'BOT_NAME' => $bot_row['bot_name'],
|
||||
'BOT_IP' => $bot_row['bot_ip'],
|
||||
@@ -348,7 +348,7 @@ class acp_bots
|
||||
'S_ACTIVE_OPTIONS' => $s_active_options,
|
||||
'S_STYLE_OPTIONS' => $style_select,
|
||||
'S_LANG_OPTIONS' => $lang_select,
|
||||
'S_ERROR' => (sizeof($error)) ? true : false,
|
||||
'S_ERROR' => (count($error)) ? true : false,
|
||||
)
|
||||
);
|
||||
|
||||
|
@@ -59,7 +59,7 @@ class acp_database
|
||||
$format = $request->variable('method', '');
|
||||
$where = $request->variable('where', '');
|
||||
|
||||
if (!sizeof($table))
|
||||
if (!count($table))
|
||||
{
|
||||
trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -495,7 +495,7 @@ function sanitize_data_mssql($text)
|
||||
{
|
||||
$val[] = "'" . $value . "'";
|
||||
}
|
||||
if (sizeof($matches[0]))
|
||||
if (count($matches[0]))
|
||||
{
|
||||
$val[] = 'char(' . ord(array_shift($matches[0])) . ')';
|
||||
}
|
||||
@@ -519,7 +519,7 @@ function sanitize_data_oracle($text)
|
||||
{
|
||||
$val[] = "'" . $value . "'";
|
||||
}
|
||||
if (sizeof($matches[0]))
|
||||
if (count($matches[0]))
|
||||
{
|
||||
$val[] = 'chr(' . ord(array_shift($matches[0])) . ')';
|
||||
}
|
||||
@@ -541,7 +541,7 @@ function sanitize_data_generic($text)
|
||||
{
|
||||
$val[] = "'" . $value . "'";
|
||||
}
|
||||
if (sizeof($matches[0]))
|
||||
if (count($matches[0]))
|
||||
{
|
||||
$val[] = "'" . array_shift($matches[0]) . "'";
|
||||
}
|
||||
@@ -583,7 +583,7 @@ function fgetd_seekless(&$fp, $delim, $read, $seek, $eof, $buffer = 8192)
|
||||
static $array = array();
|
||||
static $record = '';
|
||||
|
||||
if (!sizeof($array))
|
||||
if (!count($array))
|
||||
{
|
||||
while (!$eof($fp))
|
||||
{
|
||||
@@ -605,7 +605,7 @@ function fgetd_seekless(&$fp, $delim, $read, $seek, $eof, $buffer = 8192)
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($array))
|
||||
if (count($array))
|
||||
{
|
||||
return array_shift($array);
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ class acp_email
|
||||
$error[] = $user->lang['NO_EMAIL_MESSAGE'];
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
if (!empty($usernames))
|
||||
{
|
||||
@@ -168,7 +168,7 @@ class acp_email
|
||||
{
|
||||
$i = 0;
|
||||
|
||||
if (sizeof($email_list))
|
||||
if (count($email_list))
|
||||
{
|
||||
$j++;
|
||||
}
|
||||
@@ -235,16 +235,16 @@ class acp_email
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.acp_email_send_before', compact($vars)));
|
||||
|
||||
for ($i = 0, $size = sizeof($email_list); $i < $size; $i++)
|
||||
for ($i = 0, $size = count($email_list); $i < $size; $i++)
|
||||
{
|
||||
$used_lang = $email_list[$i][0]['lang'];
|
||||
$used_method = $email_list[$i][0]['method'];
|
||||
|
||||
for ($j = 0, $list_size = sizeof($email_list[$i]); $j < $list_size; $j++)
|
||||
for ($j = 0, $list_size = count($email_list[$i]); $j < $list_size; $j++)
|
||||
{
|
||||
$email_row = $email_list[$i][$j];
|
||||
|
||||
$messenger->{((sizeof($email_list[$i]) == 1) ? 'to' : 'bcc')}($email_row['email'], $email_row['name']);
|
||||
$messenger->{((count($email_list[$i]) == 1) ? 'to' : 'bcc')}($email_row['email'], $email_row['name']);
|
||||
$messenger->im($email_row['jabber'], $email_row['name']);
|
||||
}
|
||||
|
||||
@@ -322,8 +322,8 @@ class acp_email
|
||||
$s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
|
||||
|
||||
$template_data = array(
|
||||
'S_WARNING' => (sizeof($error)) ? true : false,
|
||||
'WARNING_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'S_WARNING' => (count($error)) ? true : false,
|
||||
'WARNING_MSG' => (count($error)) ? implode('<br />', $error) : '',
|
||||
'U_ACTION' => $this->u_action,
|
||||
'S_GROUP_OPTIONS' => $select_list,
|
||||
'USERNAMES' => implode("\n", $usernames),
|
||||
|
@@ -90,7 +90,7 @@ class acp_forums
|
||||
|
||||
$errors = $this->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id);
|
||||
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ class acp_forums
|
||||
|
||||
$errors = $this->update_forum_data($forum_data);
|
||||
|
||||
if (!sizeof($errors))
|
||||
if (!count($errors))
|
||||
{
|
||||
$forum_perm_from = $request->variable('forum_perm_from', 0);
|
||||
$cache->destroy('sql', FORUMS_TABLE);
|
||||
@@ -622,7 +622,7 @@ class acp_forums
|
||||
|
||||
$template_data = array(
|
||||
'S_EDIT_FORUM' => true,
|
||||
'S_ERROR' => (sizeof($errors)) ? true : false,
|
||||
'S_ERROR' => (count($errors)) ? true : false,
|
||||
'S_PARENT_ID' => $this->parent_id,
|
||||
'S_FORUM_PARENT_ID' => $forum_data['parent_id'],
|
||||
'S_ADD_ACTION' => ($action == 'add') ? true : false,
|
||||
@@ -632,7 +632,7 @@ class acp_forums
|
||||
|
||||
'L_COPY_PERMISSIONS_EXPLAIN' => $user->lang['COPY_PERMISSIONS_' . strtoupper($action) . '_EXPLAIN'],
|
||||
'L_TITLE' => $user->lang[$this->page_title],
|
||||
'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '',
|
||||
'ERROR_MSG' => (count($errors)) ? implode('<br />', $errors) : '',
|
||||
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'FORUM_DATA_LINK' => $forum_data['forum_link'],
|
||||
@@ -772,8 +772,8 @@ class acp_forums
|
||||
'S_FORUM_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
|
||||
'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false,
|
||||
'S_FORUMS_LIST' => $forums_list,
|
||||
'S_ERROR' => (sizeof($errors)) ? true : false,
|
||||
'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '')
|
||||
'S_ERROR' => (count($errors)) ? true : false,
|
||||
'ERROR_MSG' => (count($errors)) ? implode('<br />', $errors) : '')
|
||||
);
|
||||
|
||||
return;
|
||||
@@ -924,7 +924,7 @@ class acp_forums
|
||||
unset($rowset);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '',
|
||||
'ERROR_MSG' => (count($errors)) ? implode('<br />', $errors) : '',
|
||||
'NAVIGATION' => $navigation,
|
||||
'FORUM_BOX' => $forum_box,
|
||||
'U_SEL_ACTION' => $this->u_action,
|
||||
@@ -1053,7 +1053,7 @@ class acp_forums
|
||||
// What are we going to do tonight Brain? The same thing we do everynight,
|
||||
// try to take over the world ... or decide whether to continue update
|
||||
// and if so, whether it's a new forum/cat/link or an existing one
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
return $errors;
|
||||
}
|
||||
@@ -1217,12 +1217,12 @@ class acp_forums
|
||||
$errors = array_merge($errors, $this->delete_forum_content($_row['forum_id']));
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
return $errors;
|
||||
}
|
||||
|
||||
if (sizeof($forum_ids))
|
||||
if (count($forum_ids))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . FORUMS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
|
||||
@@ -1252,7 +1252,7 @@ class acp_forums
|
||||
$allowed_forums = array_diff($allowed_forums, $forum_ids);
|
||||
|
||||
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "
|
||||
SET allowed_forums = '" . ((sizeof($allowed_forums)) ? serialize($allowed_forums) : '') . "'
|
||||
SET allowed_forums = '" . ((count($allowed_forums)) ? serialize($allowed_forums) : '') . "'
|
||||
WHERE group_id = {$_row['group_id']}";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
@@ -1321,7 +1321,7 @@ class acp_forums
|
||||
$forum_data_sql['forum_last_poster_colour'] = '';
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
return $errors;
|
||||
}
|
||||
@@ -1338,7 +1338,7 @@ class acp_forums
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
return $errors;
|
||||
}
|
||||
@@ -1433,10 +1433,10 @@ class acp_forums
|
||||
|
||||
$moved_forums = get_forum_branch($from_id, 'children', 'descending');
|
||||
$from_data = $moved_forums[0];
|
||||
$diff = sizeof($moved_forums) * 2;
|
||||
$diff = count($moved_forums) * 2;
|
||||
|
||||
$moved_ids = array();
|
||||
for ($i = 0, $size = sizeof($moved_forums); $i < $size; ++$i)
|
||||
for ($i = 0, $size = count($moved_forums); $i < $size; ++$i)
|
||||
{
|
||||
$moved_ids[] = $moved_forums[$i]['forum_id'];
|
||||
}
|
||||
@@ -1612,7 +1612,7 @@ class acp_forums
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
return $errors;
|
||||
}
|
||||
@@ -1628,12 +1628,12 @@ class acp_forums
|
||||
$errors = array_merge($errors, $this->delete_forum_content($row['forum_id']));
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
return $errors;
|
||||
}
|
||||
|
||||
$diff = sizeof($forum_ids) * 2;
|
||||
$diff = count($forum_ids) * 2;
|
||||
|
||||
$sql = 'DELETE FROM ' . FORUMS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
|
||||
@@ -1706,7 +1706,7 @@ class acp_forums
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
return $errors;
|
||||
}
|
||||
@@ -1754,7 +1754,7 @@ class acp_forums
|
||||
$allowed_forums = array_diff($allowed_forums, $forum_ids);
|
||||
|
||||
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "
|
||||
SET allowed_forums = '" . ((sizeof($allowed_forums)) ? serialize($allowed_forums) : '') . "'
|
||||
SET allowed_forums = '" . ((count($allowed_forums)) ? serialize($allowed_forums) : '') . "'
|
||||
WHERE group_id = {$row['group_id']}";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
@@ -1927,9 +1927,9 @@ class acp_forums
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($ids))
|
||||
if (count($ids))
|
||||
{
|
||||
$start += sizeof($ids);
|
||||
$start += count($ids);
|
||||
|
||||
foreach ($tables as $table)
|
||||
{
|
||||
@@ -1937,7 +1937,7 @@ class acp_forums
|
||||
}
|
||||
}
|
||||
}
|
||||
while (sizeof($ids) == $batch_size);
|
||||
while (count($ids) == $batch_size);
|
||||
}
|
||||
unset($ids);
|
||||
|
||||
@@ -1978,7 +1978,7 @@ class acp_forums
|
||||
}
|
||||
|
||||
// Adjust users post counts
|
||||
if (sizeof($post_counts))
|
||||
if (count($post_counts))
|
||||
{
|
||||
foreach ($post_counts as $poster_id => $substract)
|
||||
{
|
||||
@@ -2062,7 +2062,7 @@ class acp_forums
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!sizeof($target))
|
||||
if (!count($target))
|
||||
{
|
||||
// The forum is already on top or bottom
|
||||
return false;
|
||||
|
@@ -187,7 +187,7 @@ class acp_groups
|
||||
|
||||
group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
|
||||
|
||||
$start = (sizeof($mark_ary) < 200) ? 0 : $start + 200;
|
||||
$start = (count($mark_ary) < 200) ? 0 : $start + 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -486,7 +486,7 @@ class acp_groups
|
||||
$error = array_merge($error, $validation_error);
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
// Only set the rank, colour, etc. if it's changed or if we're adding a new
|
||||
// group. This prevents existing group members being updated if no changes
|
||||
@@ -614,7 +614,7 @@ class acp_groups
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($error))
|
||||
if (count($error))
|
||||
{
|
||||
$error = array_map(array(&$user, 'lang'), $error);
|
||||
$group_rank = $submit_ary['rank'];
|
||||
@@ -732,12 +732,12 @@ class acp_groups
|
||||
'S_ADD_GROUP' => ($action == 'add') ? true : false,
|
||||
'S_GROUP_PERM' => ($action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) ? true : false,
|
||||
'S_INCLUDE_SWATCH' => true,
|
||||
'S_ERROR' => (sizeof($error)) ? true : false,
|
||||
'S_ERROR' => (count($error)) ? true : false,
|
||||
'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false,
|
||||
'S_USER_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
|
||||
'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
|
||||
|
||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'ERROR_MSG' => (count($error)) ? implode('<br />', $error) : '',
|
||||
'GROUP_NAME' => $group_helper->get_name($group_name),
|
||||
'GROUP_INTERNAL_NAME' => $group_name,
|
||||
'GROUP_DESC' => $group_desc_data['text'],
|
||||
|
@@ -48,7 +48,7 @@ class acp_help_phpbb
|
||||
$error[] = $user->lang['FORM_INVALID'];
|
||||
}
|
||||
// Do not write values if there is an error
|
||||
if (sizeof($error))
|
||||
if (count($error))
|
||||
{
|
||||
$submit = false;
|
||||
}
|
||||
|
@@ -166,7 +166,7 @@ class acp_icons
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($smilies))
|
||||
if (count($smilies))
|
||||
{
|
||||
foreach ($smilies as $row)
|
||||
{
|
||||
@@ -301,7 +301,7 @@ class acp_icons
|
||||
}
|
||||
|
||||
// Ok, another row for adding an addition code for a pre-existing image...
|
||||
if ($action == 'add' && $mode == 'smilies' && sizeof($smilies))
|
||||
if ($action == 'add' && $mode == 'smilies' && count($smilies))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_ADD_CODE' => true,
|
||||
@@ -378,7 +378,7 @@ class acp_icons
|
||||
{
|
||||
$smiley_count = $this->item_count($table);
|
||||
|
||||
$addable_smileys_count = sizeof($images);
|
||||
$addable_smileys_count = count($images);
|
||||
foreach ($images as $image)
|
||||
{
|
||||
if (!isset($image_add[$image]))
|
||||
@@ -546,8 +546,8 @@ class acp_icons
|
||||
{
|
||||
if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data))
|
||||
{
|
||||
if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
|
||||
((sizeof($data[1]) != 6 || (empty($data[1][4]) || empty($data[1][5]))) && $mode == 'smilies' ))
|
||||
if ((count($data[1]) != 4 && $mode == 'icons') ||
|
||||
((count($data[1]) != 6 || (empty($data[1][4]) || empty($data[1][5]))) && $mode == 'smilies' ))
|
||||
{
|
||||
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -605,7 +605,7 @@ class acp_icons
|
||||
if ($mode == 'smilies')
|
||||
{
|
||||
$smiley_count = $this->item_count($table);
|
||||
if ($smiley_count + sizeof($pak_ary) > SMILEY_LIMIT)
|
||||
if ($smiley_count + count($pak_ary) > SMILEY_LIMIT)
|
||||
{
|
||||
trigger_error($user->lang('TOO_MANY_SMILIES', SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -616,8 +616,8 @@ class acp_icons
|
||||
$data = array();
|
||||
if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data))
|
||||
{
|
||||
if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
|
||||
(sizeof($data[1]) != 6 && $mode == 'smilies'))
|
||||
if ((count($data[1]) != 4 && $mode == 'icons') ||
|
||||
(count($data[1]) != 6 && $mode == 'smilies'))
|
||||
{
|
||||
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ class acp_inactive
|
||||
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
|
||||
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
|
||||
|
||||
if ($submit && sizeof($mark))
|
||||
if ($submit && count($mark))
|
||||
{
|
||||
if ($action !== 'delete' && !check_form_key($form_key))
|
||||
{
|
||||
|
@@ -402,7 +402,7 @@ class acp_language
|
||||
|
||||
unset($installed);
|
||||
|
||||
if (sizeof($new_ary))
|
||||
if (count($new_ary))
|
||||
{
|
||||
foreach ($new_ary as $iso => $lang_ary)
|
||||
{
|
||||
|
@@ -57,7 +57,7 @@ class acp_logs
|
||||
{
|
||||
$conditions = array();
|
||||
|
||||
if ($deletemark && sizeof($marked))
|
||||
if ($deletemark && count($marked))
|
||||
{
|
||||
$conditions['log_id'] = array('IN' => $marked);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ class acp_logs
|
||||
'IP' => $row['ip'],
|
||||
'DATE' => $user->format_date($row['time']),
|
||||
'ACTION' => $row['action'],
|
||||
'DATA' => (sizeof($data)) ? implode(' | ', $data) : '',
|
||||
'DATA' => (count($data)) ? implode(' | ', $data) : '',
|
||||
'ID' => $row['id'],
|
||||
)
|
||||
);
|
||||
|
@@ -337,7 +337,7 @@ class acp_main
|
||||
}
|
||||
unset($posted);
|
||||
|
||||
if (sizeof($sql_ary))
|
||||
if (count($sql_ary))
|
||||
{
|
||||
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
|
||||
}
|
||||
|
@@ -249,7 +249,7 @@ class acp_modules
|
||||
trigger_error($msg . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if (!sizeof($errors))
|
||||
if (!count($errors))
|
||||
{
|
||||
$module_manager->remove_cache_file($this->module_class);
|
||||
|
||||
@@ -364,7 +364,7 @@ class acp_modules
|
||||
trigger_error($msg . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if (!sizeof($errors))
|
||||
if (!count($errors))
|
||||
{
|
||||
$module_manager->remove_cache_file($this->module_class);
|
||||
|
||||
@@ -430,7 +430,7 @@ class acp_modules
|
||||
array_change_key_case($module_data, CASE_UPPER))
|
||||
);
|
||||
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_ERROR' => true,
|
||||
@@ -444,7 +444,7 @@ class acp_modules
|
||||
}
|
||||
|
||||
// Default management page
|
||||
if (sizeof($errors))
|
||||
if (count($errors))
|
||||
{
|
||||
if ($request->is_ajax())
|
||||
{
|
||||
|
@@ -348,7 +348,7 @@ class acp_permission_roles
|
||||
{
|
||||
$hold_ary = $this->auth_admin->get_role_mask($role_id);
|
||||
|
||||
if (sizeof($hold_ary))
|
||||
if (count($hold_ary))
|
||||
{
|
||||
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
|
||||
|
||||
@@ -496,7 +496,7 @@ class acp_permission_roles
|
||||
|
||||
$content_array = $content_array[0];
|
||||
|
||||
$template->assign_var('S_NUM_PERM_COLS', sizeof($categories));
|
||||
$template->assign_var('S_NUM_PERM_COLS', count($categories));
|
||||
|
||||
// Assign to template
|
||||
foreach ($content_array as $cat => $cat_array)
|
||||
|
@@ -131,11 +131,11 @@ class acp_permissions
|
||||
}
|
||||
unset($usernames);
|
||||
|
||||
if (sizeof($username) && !sizeof($user_id))
|
||||
if (count($username) && !count($user_id))
|
||||
{
|
||||
user_get_id_name($user_id, $username);
|
||||
|
||||
if (!sizeof($user_id))
|
||||
if (!count($user_id))
|
||||
{
|
||||
trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -260,17 +260,17 @@ class acp_permissions
|
||||
{
|
||||
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
|
||||
|
||||
if ($all_users && sizeof($items['user_ids']))
|
||||
if ($all_users && count($items['user_ids']))
|
||||
{
|
||||
$user_id = $items['user_ids'];
|
||||
}
|
||||
else if ($all_groups && sizeof($items['group_ids']))
|
||||
else if ($all_groups && count($items['group_ids']))
|
||||
{
|
||||
$group_id = $items['group_ids'];
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($user_id) || sizeof($group_id))
|
||||
if (count($user_id) || count($group_id))
|
||||
{
|
||||
$this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
|
||||
}
|
||||
@@ -349,7 +349,7 @@ class acp_permissions
|
||||
{
|
||||
case 'forum_dropdown':
|
||||
|
||||
if (sizeof($forum_id))
|
||||
if (count($forum_id))
|
||||
{
|
||||
$this->check_existence('forum', $forum_id);
|
||||
continue 2;
|
||||
@@ -364,7 +364,7 @@ class acp_permissions
|
||||
|
||||
case 'forums':
|
||||
|
||||
if (sizeof($forum_id))
|
||||
if (count($forum_id))
|
||||
{
|
||||
$this->check_existence('forum', $forum_id);
|
||||
continue 2;
|
||||
@@ -394,7 +394,7 @@ class acp_permissions
|
||||
|
||||
case 'user':
|
||||
|
||||
if (sizeof($user_id))
|
||||
if (count($user_id))
|
||||
{
|
||||
$this->check_existence('user', $user_id);
|
||||
continue 2;
|
||||
@@ -409,7 +409,7 @@ class acp_permissions
|
||||
|
||||
case 'group':
|
||||
|
||||
if (sizeof($group_id))
|
||||
if (count($group_id))
|
||||
{
|
||||
$this->check_existence('group', $group_id);
|
||||
continue 2;
|
||||
@@ -428,14 +428,14 @@ class acp_permissions
|
||||
$all_users = (isset($_POST['all_users'])) ? true : false;
|
||||
$all_groups = (isset($_POST['all_groups'])) ? true : false;
|
||||
|
||||
if ((sizeof($user_id) && !$all_users) || (sizeof($group_id) && !$all_groups))
|
||||
if ((count($user_id) && !$all_users) || (count($group_id) && !$all_groups))
|
||||
{
|
||||
if (sizeof($user_id))
|
||||
if (count($user_id))
|
||||
{
|
||||
$this->check_existence('user', $user_id);
|
||||
}
|
||||
|
||||
if (sizeof($group_id))
|
||||
if (count($group_id))
|
||||
{
|
||||
$this->check_existence('group', $group_id);
|
||||
}
|
||||
@@ -446,13 +446,13 @@ class acp_permissions
|
||||
// Now we check the users... because the "all"-selection is different here (all defined users/groups)
|
||||
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
|
||||
|
||||
if ($all_users && sizeof($items['user_ids']))
|
||||
if ($all_users && count($items['user_ids']))
|
||||
{
|
||||
$user_id = $items['user_ids'];
|
||||
continue 2;
|
||||
}
|
||||
|
||||
if ($all_groups && sizeof($items['group_ids']))
|
||||
if ($all_groups && count($items['group_ids']))
|
||||
{
|
||||
$group_id = $items['group_ids'];
|
||||
continue 2;
|
||||
@@ -487,14 +487,14 @@ class acp_permissions
|
||||
'ANONYMOUS_USER_ID' => ANONYMOUS,
|
||||
|
||||
'S_SELECT_VICTIM' => true,
|
||||
'S_ALLOW_ALL_SELECT' => (sizeof($forum_id) > 5) ? false : true,
|
||||
'S_ALLOW_ALL_SELECT' => (count($forum_id) > 5) ? false : true,
|
||||
'S_CAN_SELECT_USER' => ($auth->acl_get('a_authusers')) ? true : false,
|
||||
'S_CAN_SELECT_GROUP' => ($auth->acl_get('a_authgroups')) ? true : false,
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||
);
|
||||
|
||||
// Let the forum names being displayed
|
||||
if (sizeof($forum_id))
|
||||
if (count($forum_id))
|
||||
{
|
||||
$sql = 'SELECT forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
@@ -510,7 +510,7 @@ class acp_permissions
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_FORUM_NAMES' => (sizeof($forum_names)) ? true : false,
|
||||
'S_FORUM_NAMES' => (count($forum_names)) ? true : false,
|
||||
'FORUM_NAMES' => implode($user->lang['COMMA_SEPARATOR'], $forum_names))
|
||||
);
|
||||
}
|
||||
@@ -527,13 +527,13 @@ class acp_permissions
|
||||
));
|
||||
|
||||
// Do not allow forum_ids being set and no other setting defined (will bog down the server too much)
|
||||
if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id))
|
||||
if (count($forum_id) && !count($user_id) && !count($group_id))
|
||||
{
|
||||
trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_PERMISSION_DROPDOWN' => (sizeof($this->permission_dropdown) > 1) ? $this->build_permission_dropdown($this->permission_dropdown, $permission_type, $permission_scope) : false,
|
||||
'S_PERMISSION_DROPDOWN' => (count($this->permission_dropdown) > 1) ? $this->build_permission_dropdown($this->permission_dropdown, $permission_type, $permission_scope) : false,
|
||||
'L_PERMISSION_TYPE' => $this->permissions->get_type_lang($permission_type),
|
||||
|
||||
'U_ACTION' => $this->u_action,
|
||||
@@ -546,8 +546,8 @@ class acp_permissions
|
||||
'S_SETTING_PERMISSIONS' => true)
|
||||
);
|
||||
|
||||
$hold_ary = $auth_admin->get_mask('set', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NO);
|
||||
$auth_admin->display_mask('set', $permission_type, $hold_ary, ((sizeof($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false));
|
||||
$hold_ary = $auth_admin->get_mask('set', (count($user_id)) ? $user_id : false, (count($group_id)) ? $group_id : false, (count($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NO);
|
||||
$auth_admin->display_mask('set', $permission_type, $hold_ary, ((count($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -555,8 +555,8 @@ class acp_permissions
|
||||
'S_VIEWING_PERMISSIONS' => true)
|
||||
);
|
||||
|
||||
$hold_ary = $auth_admin->get_mask('view', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NEVER);
|
||||
$auth_admin->display_mask('view', $permission_type, $hold_ary, ((sizeof($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false));
|
||||
$hold_ary = $auth_admin->get_mask('view', (count($user_id)) ? $user_id : false, (count($group_id)) ? $group_id : false, (count($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NEVER);
|
||||
$auth_admin->display_mask('view', $permission_type, $hold_ary, ((count($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,7 +652,7 @@ class acp_permissions
|
||||
break;
|
||||
}
|
||||
|
||||
if (sizeof($ids))
|
||||
if (count($ids))
|
||||
{
|
||||
$sql = "SELECT $sql_id
|
||||
FROM $table
|
||||
@@ -667,7 +667,7 @@ class acp_permissions
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (!sizeof($ids))
|
||||
if (!count($ids))
|
||||
{
|
||||
trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
@@ -684,7 +684,7 @@ class acp_permissions
|
||||
$psubmit = $request->variable('psubmit', array(0 => array(0 => 0)));
|
||||
|
||||
// User or group to be set?
|
||||
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
|
||||
$ug_type = (count($user_id)) ? 'user' : 'group';
|
||||
|
||||
// Check the permission setting again
|
||||
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
|
||||
@@ -715,7 +715,7 @@ class acp_permissions
|
||||
$ug_id = array($ug_id);
|
||||
$forum_id = array($forum_id);
|
||||
|
||||
if (sizeof($inherit))
|
||||
if (count($inherit))
|
||||
{
|
||||
foreach ($inherit as $_ug_id => $forum_id_ary)
|
||||
{
|
||||
@@ -771,7 +771,7 @@ class acp_permissions
|
||||
global $request;
|
||||
|
||||
// User or group to be set?
|
||||
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
|
||||
$ug_type = (count($user_id)) ? 'user' : 'group';
|
||||
|
||||
// Check the permission setting again
|
||||
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
|
||||
@@ -870,7 +870,7 @@ class acp_permissions
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof(array_diff_assoc($auth_settings, $test_auth_settings)))
|
||||
if (count(array_diff_assoc($auth_settings, $test_auth_settings)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -886,7 +886,7 @@ class acp_permissions
|
||||
global $user, $db, $cache, $auth;
|
||||
|
||||
// User or group to be set?
|
||||
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
|
||||
$ug_type = (count($user_id)) ? 'user' : 'group';
|
||||
|
||||
// Check the permission setting again
|
||||
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
|
||||
@@ -895,7 +895,7 @@ class acp_permissions
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$auth_admin->acl_delete($ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : false), $permission_type);
|
||||
$auth_admin->acl_delete($ug_type, (($ug_type == 'user') ? $user_id : $group_id), (count($forum_id) ? $forum_id : false), $permission_type);
|
||||
|
||||
// Do we need to recache the moderator lists?
|
||||
if ($permission_type == 'm_')
|
||||
@@ -903,7 +903,7 @@ class acp_permissions
|
||||
phpbb_cache_moderators($db, $cache, $auth);
|
||||
}
|
||||
|
||||
$this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : array(0 => 0)));
|
||||
$this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (count($forum_id) ? $forum_id : array(0 => 0)));
|
||||
|
||||
if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
|
||||
{
|
||||
@@ -1053,7 +1053,7 @@ class acp_permissions
|
||||
$total = ACL_NO;
|
||||
$add_key = (($forum_id) ? '_LOCAL' : '');
|
||||
|
||||
if (sizeof($groups))
|
||||
if (count($groups))
|
||||
{
|
||||
// Get group auth settings
|
||||
$hold_ary = $auth->acl_group_raw_data(array_keys($groups), $permission, $forum_id);
|
||||
@@ -1099,7 +1099,7 @@ class acp_permissions
|
||||
|
||||
// Get user specific permission... globally or for this forum
|
||||
$hold_ary = $auth->acl_user_raw_data($user_id, $permission, $forum_id);
|
||||
$auth_setting = (!sizeof($hold_ary)) ? ACL_NO : $hold_ary[$user_id][$forum_id][$permission];
|
||||
$auth_setting = (!count($hold_ary)) ? ACL_NO : $hold_ary[$user_id][$forum_id][$permission];
|
||||
|
||||
switch ($auth_setting)
|
||||
{
|
||||
@@ -1258,7 +1258,7 @@ class acp_permissions
|
||||
/** @var \phpbb\group\helper $group_helper */
|
||||
$group_helper = $phpbb_container->get('group_helper');
|
||||
|
||||
$sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND ' . $db->sql_in_set('a.forum_id', $forum_id) : 'AND a.forum_id <> 0');
|
||||
$sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((count($forum_id)) ? 'AND ' . $db->sql_in_set('a.forum_id', $forum_id) : 'AND a.forum_id <> 0');
|
||||
|
||||
// Permission options are only able to be a permission set... therefore we will pre-fetch the possible options and also the possible roles
|
||||
$option_ids = $role_ids = array();
|
||||
@@ -1274,7 +1274,7 @@ class acp_permissions
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($option_ids))
|
||||
if (count($option_ids))
|
||||
{
|
||||
$sql = 'SELECT DISTINCT role_id
|
||||
FROM ' . ACL_ROLES_DATA_TABLE . '
|
||||
@@ -1288,15 +1288,15 @@ class acp_permissions
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (sizeof($option_ids) && sizeof($role_ids))
|
||||
if (count($option_ids) && count($role_ids))
|
||||
{
|
||||
$sql_where = 'AND (' . $db->sql_in_set('a.auth_option_id', $option_ids) . ' OR ' . $db->sql_in_set('a.auth_role_id', $role_ids) . ')';
|
||||
}
|
||||
else if (sizeof($role_ids))
|
||||
else if (count($role_ids))
|
||||
{
|
||||
$sql_where = 'AND ' . $db->sql_in_set('a.auth_role_id', $role_ids);
|
||||
}
|
||||
else if (sizeof($option_ids))
|
||||
else if (count($option_ids))
|
||||
{
|
||||
$sql_where = 'AND ' . $db->sql_in_set('a.auth_option_id', $option_ids);
|
||||
}
|
||||
|
@@ -446,7 +446,7 @@ class acp_profile
|
||||
{
|
||||
$exploded_options = (is_array($options)) ? $options : explode("\n", $options);
|
||||
|
||||
if (sizeof($exploded_options) == sizeof($lang_options) || $action == 'create')
|
||||
if (count($exploded_options) == count($lang_options) || $action == 'create')
|
||||
{
|
||||
// The number of options in the field is equal to the number of options already in the database
|
||||
// Or we are creating a new dropdown list.
|
||||
@@ -567,7 +567,7 @@ class acp_profile
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($error))
|
||||
if (count($error))
|
||||
{
|
||||
$submit = false;
|
||||
}
|
||||
@@ -600,9 +600,9 @@ class acp_profile
|
||||
$s_hidden_fields .= build_hidden_fields($_new_key_ary);
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
if (($step == 3 && (sizeof($this->lang_defs['iso']) == 1 || $save)) || ($action == 'edit' && $save))
|
||||
if (($step == 3 && (count($this->lang_defs['iso']) == 1 || $save)) || ($action == 'edit' && $save))
|
||||
{
|
||||
if (!check_form_key($form_key))
|
||||
{
|
||||
@@ -616,7 +616,7 @@ class acp_profile
|
||||
$template->assign_vars(array(
|
||||
'S_EDIT' => true,
|
||||
'S_EDIT_MODE' => ($action == 'edit') ? true : false,
|
||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'ERROR_MSG' => (count($error)) ? implode('<br />', $error) : '',
|
||||
|
||||
'L_TITLE' => $user->lang['STEP_' . $step . '_TITLE_' . strtoupper($action)],
|
||||
'L_EXPLAIN' => $user->lang['STEP_' . $step . '_EXPLAIN_' . strtoupper($action)],
|
||||
@@ -664,7 +664,7 @@ class acp_profile
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_STEP_TWO' => true,
|
||||
'L_NEXT_STEP' => (sizeof($this->lang_defs['iso']) == 1) ? $user->lang['SAVE'] : $user->lang['PROFILE_LANG_OPTIONS'])
|
||||
'L_NEXT_STEP' => (count($this->lang_defs['iso']) == 1) ? $user->lang['SAVE'] : $user->lang['PROFILE_LANG_OPTIONS'])
|
||||
);
|
||||
|
||||
// Build options based on profile type
|
||||
@@ -750,7 +750,7 @@ class acp_profile
|
||||
$active_value = (!$row['field_active']) ? 'activate' : 'deactivate';
|
||||
$id = $row['field_id'];
|
||||
|
||||
$s_need_edit = (sizeof($this->lang_defs['diff'][$row['field_id']])) ? true : false;
|
||||
$s_need_edit = (count($this->lang_defs['diff'][$row['field_id']])) ? true : false;
|
||||
|
||||
if ($s_need_edit)
|
||||
{
|
||||
@@ -1011,7 +1011,7 @@ class acp_profile
|
||||
$this->update_insert(PROFILE_LANG_TABLE, $sql_ary, array('field_id' => $field_id, 'lang_id' => $default_lang_id));
|
||||
}
|
||||
|
||||
if (is_array($cp->vars['l_lang_name']) && sizeof($cp->vars['l_lang_name']))
|
||||
if (is_array($cp->vars['l_lang_name']) && count($cp->vars['l_lang_name']))
|
||||
{
|
||||
foreach ($cp->vars['l_lang_name'] as $lang_id => $data)
|
||||
{
|
||||
@@ -1087,7 +1087,7 @@ class acp_profile
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($cp->vars['l_lang_options']) && sizeof($cp->vars['l_lang_options']))
|
||||
if (is_array($cp->vars['l_lang_options']) && count($cp->vars['l_lang_options']))
|
||||
{
|
||||
$empty_lang = array();
|
||||
|
||||
@@ -1098,7 +1098,7 @@ class acp_profile
|
||||
$lang_ary = explode("\n", $lang_ary);
|
||||
}
|
||||
|
||||
if (sizeof($lang_ary) != sizeof($cp->vars['lang_options']))
|
||||
if (count($lang_ary) != count($cp->vars['lang_options']))
|
||||
{
|
||||
$empty_lang[$lang_id] = true;
|
||||
}
|
||||
@@ -1150,7 +1150,7 @@ class acp_profile
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($profile_lang_fields))
|
||||
if (count($profile_lang_fields))
|
||||
{
|
||||
foreach ($profile_lang_fields as $sql)
|
||||
{
|
||||
@@ -1213,7 +1213,7 @@ class acp_profile
|
||||
$where_sql[] = $key . ' = ' . ((is_string($value)) ? "'" . $db->sql_escape($value) . "'" : (int) $value);
|
||||
}
|
||||
|
||||
if (!sizeof($where_sql))
|
||||
if (!count($where_sql))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1229,14 +1229,14 @@ class acp_profile
|
||||
{
|
||||
$sql_ary = array_merge($where_fields, $sql_ary);
|
||||
|
||||
if (sizeof($sql_ary))
|
||||
if (count($sql_ary))
|
||||
{
|
||||
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql_ary));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sizeof($sql_ary))
|
||||
if (count($sql_ary))
|
||||
{
|
||||
$sql = "UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE ' . implode(' AND ', $where_sql);
|
||||
|
@@ -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]) . ')';
|
||||
}
|
||||
|
@@ -103,7 +103,7 @@ class acp_reasons
|
||||
}
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
// New reason?
|
||||
if ($action == 'add')
|
||||
@@ -171,7 +171,7 @@ class acp_reasons
|
||||
'L_TITLE' => $user->lang['REASON_' . $l_title],
|
||||
'U_ACTION' => $this->u_action . "&id=$reason_id&action=$action",
|
||||
'U_BACK' => $this->u_action,
|
||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'ERROR_MSG' => (count($error)) ? implode('<br />', $error) : '',
|
||||
|
||||
'REASON_TITLE' => $reason_row['reason_title'],
|
||||
'REASON_DESCRIPTION' => $reason_row['reason_description'],
|
||||
@@ -182,7 +182,7 @@ class acp_reasons
|
||||
'S_AVAILABLE_TITLES' => implode($user->lang['COMMA_SEPARATOR'], array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
|
||||
'S_EDIT_REASON' => true,
|
||||
'S_TRANSLATED' => $translated,
|
||||
'S_ERROR' => (sizeof($error)) ? true : false,
|
||||
'S_ERROR' => (count($error)) ? true : false,
|
||||
)
|
||||
);
|
||||
|
||||
|
@@ -332,9 +332,9 @@ class acp_search
|
||||
$forum_ids[] = $row['forum_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
$row_count += sizeof($ids);
|
||||
$row_count += count($ids);
|
||||
|
||||
if (sizeof($ids))
|
||||
if (count($ids))
|
||||
{
|
||||
$this->search->index_remove($ids, $posters, $forum_ids);
|
||||
}
|
||||
@@ -474,8 +474,8 @@ class acp_search
|
||||
$statistics = array();
|
||||
foreach ($data as $statistic => $value)
|
||||
{
|
||||
$n = sizeof($statistics);
|
||||
if ($n && sizeof($statistics[$n - 1]) < 3)
|
||||
$n = count($statistics);
|
||||
if ($n && count($statistics[$n - 1]) < 3)
|
||||
{
|
||||
$statistics[$n - 1] += array('statistic_2' => $statistic, 'value_2' => $value);
|
||||
}
|
||||
@@ -492,7 +492,7 @@ class acp_search
|
||||
'S_ACTIVE' => ($type == $config['search_type']) ? true : false,
|
||||
'S_HIDDEN_FIELDS' => build_hidden_fields(array('search_type' => $type)),
|
||||
'S_INDEXED' => (bool) $search->index_created(),
|
||||
'S_STATS' => (bool) sizeof($statistics))
|
||||
'S_STATS' => (bool) count($statistics))
|
||||
);
|
||||
|
||||
foreach ($statistics as $statistic)
|
||||
|
@@ -690,7 +690,7 @@ class acp_users
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($topic_id_ary))
|
||||
if (count($topic_id_ary))
|
||||
{
|
||||
$sql = 'SELECT topic_id, forum_id, topic_title, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, topic_attachment
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
@@ -718,12 +718,12 @@ class acp_users
|
||||
}
|
||||
|
||||
// Entire topic comprises posts by this user, move these topics
|
||||
if (sizeof($move_topic_ary))
|
||||
if (count($move_topic_ary))
|
||||
{
|
||||
move_topics($move_topic_ary, $new_forum_id, false);
|
||||
}
|
||||
|
||||
if (sizeof($move_post_ary))
|
||||
if (count($move_post_ary))
|
||||
{
|
||||
// Create new topic
|
||||
// Update post_ids, report_ids, attachment_ids
|
||||
@@ -769,13 +769,13 @@ class acp_users
|
||||
$forum_id_ary = array_unique($forum_id_ary);
|
||||
$topic_id_ary = array_unique(array_merge(array_keys($topic_id_ary), $new_topic_id_ary));
|
||||
|
||||
if (sizeof($topic_id_ary))
|
||||
if (count($topic_id_ary))
|
||||
{
|
||||
sync('topic_reported', 'topic_id', $topic_id_ary);
|
||||
sync('topic', 'topic_id', $topic_id_ary);
|
||||
}
|
||||
|
||||
if (sizeof($forum_id_ary))
|
||||
if (count($forum_id_ary))
|
||||
{
|
||||
sync('forum', 'forum_id', $forum_id_ary, false, true);
|
||||
}
|
||||
@@ -886,7 +886,7 @@ class acp_users
|
||||
$update_password = $data['new_password'] && !$passwords_manager->check($data['new_password'], $user_row['user_password']);
|
||||
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$sql_ary = array();
|
||||
|
||||
@@ -988,7 +988,7 @@ class acp_users
|
||||
));
|
||||
}
|
||||
|
||||
if (sizeof($sql_ary))
|
||||
if (count($sql_ary))
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
@@ -1341,7 +1341,7 @@ class acp_users
|
||||
{
|
||||
$s_hidden_fields['delall'] = 1;
|
||||
}
|
||||
if (isset($_POST['delall']) || (isset($_POST['delmarked']) && sizeof($marked)))
|
||||
if (isset($_POST['delall']) || (isset($_POST['delmarked']) && count($marked)))
|
||||
{
|
||||
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
|
||||
}
|
||||
@@ -1377,9 +1377,9 @@ class acp_users
|
||||
{
|
||||
// Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
|
||||
// It doesn't matter if we add more arguments than placeholders
|
||||
if ((substr_count($row['action'], '%') - sizeof($log_data_ary)) > 0)
|
||||
if ((substr_count($row['action'], '%') - count($log_data_ary)) > 0)
|
||||
{
|
||||
$log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($row['action'], '%') - sizeof($log_data_ary), ''));
|
||||
$log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($row['action'], '%') - count($log_data_ary), ''));
|
||||
}
|
||||
$row['action'] = vsprintf($row['action'], $log_data_ary);
|
||||
$row['action'] = bbcode_nl2br(censor_text($row['action']));
|
||||
@@ -1472,7 +1472,7 @@ class acp_users
|
||||
// validate custom profile fields
|
||||
$cp->submit_cp_field('profile', $user_row['iso_lang_id'], $cp_data, $cp_error);
|
||||
|
||||
if (sizeof($cp_error))
|
||||
if (count($cp_error))
|
||||
{
|
||||
$error = array_merge($error, $cp_error);
|
||||
}
|
||||
@@ -1493,7 +1493,7 @@ class acp_users
|
||||
$vars = array('submit', 'data', 'error');
|
||||
extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_validate', compact($vars)));
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$sql_ary = array(
|
||||
'user_jabber' => $data['jabber'],
|
||||
@@ -1637,7 +1637,7 @@ class acp_users
|
||||
$error[] = 'FORM_INVALID';
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$this->optionset($user_row, 'viewimg', $data['view_images']);
|
||||
$this->optionset($user_row, 'viewflash', $data['view_flash']);
|
||||
@@ -1688,7 +1688,7 @@ class acp_users
|
||||
$vars = array('data', 'user_row', 'sql_ary', 'error');
|
||||
extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_sql', compact($vars)));
|
||||
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
||||
@@ -2052,7 +2052,7 @@ class acp_users
|
||||
'sig'
|
||||
);
|
||||
|
||||
if (sizeof($warn_msg))
|
||||
if (count($warn_msg))
|
||||
{
|
||||
$error += $warn_msg;
|
||||
}
|
||||
@@ -2064,7 +2064,7 @@ class acp_users
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sizeof($error))
|
||||
if (!count($error))
|
||||
{
|
||||
$this->optionset($user_row, 'sig_bbcode', $enable_bbcode);
|
||||
$this->optionset($user_row, 'sig_smilies', $enable_smilies);
|
||||
@@ -2139,7 +2139,7 @@ class acp_users
|
||||
$sort_key = $request->variable('sk', 'a');
|
||||
$sort_dir = $request->variable('sd', 'd');
|
||||
|
||||
if ($deletemark && sizeof($marked))
|
||||
if ($deletemark && count($marked))
|
||||
{
|
||||
$sql = 'SELECT attach_id
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
@@ -2156,7 +2156,7 @@ class acp_users
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if ($deletemark && sizeof($marked))
|
||||
if ($deletemark && count($marked))
|
||||
{
|
||||
if (confirm_box(true))
|
||||
{
|
||||
@@ -2177,7 +2177,7 @@ class acp_users
|
||||
$attachment_manager->delete('attach', $marked);
|
||||
unset($attachment_manager);
|
||||
|
||||
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
|
||||
$message = (count($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
|
||||
|
||||
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACHMENTS_DELETED', false, array(implode($user->lang['COMMA_SEPARATOR'], $log_attachments)));
|
||||
trigger_error($message . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||
@@ -2447,7 +2447,7 @@ class acp_users
|
||||
// Select box for other groups
|
||||
$sql = 'SELECT group_id, group_name, group_type, group_founder_manage
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
' . ((sizeof($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . '
|
||||
' . ((count($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . '
|
||||
ORDER BY group_type DESC, group_name ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -2580,8 +2580,8 @@ class acp_users
|
||||
|
||||
// Assign general variables
|
||||
$template->assign_vars(array(
|
||||
'S_ERROR' => (sizeof($error)) ? true : false,
|
||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '')
|
||||
'S_ERROR' => (count($error)) ? true : false,
|
||||
'ERROR_MSG' => (count($error)) ? implode('<br />', $error) : '')
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -107,7 +107,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
$compare_options = array_diff(preg_replace('/^((?!' . $auth_option . ').+)|(' . $auth_option . ')$/', '', array_keys($this->acl_options[$scope])), array(''));
|
||||
|
||||
// If forum_ids is false and the scope is local we actually want to have all forums within the array
|
||||
if ($scope == 'local' && !sizeof($forum_ids))
|
||||
if ($scope == 'local' && !count($forum_ids))
|
||||
{
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE;
|
||||
@@ -177,9 +177,9 @@ class auth_admin extends \phpbb\auth\auth
|
||||
// Now, we need to fill the gaps with $acl_fill. ;)
|
||||
|
||||
// Now switch back to keys
|
||||
if (sizeof($compare_options))
|
||||
if (count($compare_options))
|
||||
{
|
||||
$compare_options = array_combine($compare_options, array_fill(1, sizeof($compare_options), $acl_fill));
|
||||
$compare_options = array_combine($compare_options, array_fill(1, count($compare_options), $acl_fill));
|
||||
}
|
||||
|
||||
// Defining the user-function here to save some memory
|
||||
@@ -189,7 +189,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
};
|
||||
|
||||
// Actually fill the gaps
|
||||
if (sizeof($hold_ary))
|
||||
if (count($hold_ary))
|
||||
{
|
||||
foreach ($hold_ary as $ug_id => $row)
|
||||
{
|
||||
@@ -356,7 +356,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
// Build js roles array (role data assignments)
|
||||
$s_role_js_array = '';
|
||||
|
||||
if (sizeof($roles))
|
||||
if (count($roles))
|
||||
{
|
||||
$s_role_js_array = array();
|
||||
|
||||
@@ -422,7 +422,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
// If we only have one forum id to display or being in local mode and more than one user/group to display,
|
||||
// we switch the complete interface to group by user/usergroup instead of grouping by forum
|
||||
// To achieve this, we need to switch the array a bit
|
||||
if (sizeof($forum_ids) == 1 || ($local && sizeof($ug_names_ary) > 1))
|
||||
if (count($forum_ids) == 1 || ($local && count($ug_names_ary) > 1))
|
||||
{
|
||||
$hold_ary_temp = $hold_ary;
|
||||
$hold_ary = array();
|
||||
@@ -453,9 +453,9 @@ class auth_admin extends \phpbb\auth\auth
|
||||
|
||||
'S_LOCAL' => ($local) ? true : false,
|
||||
'S_GLOBAL' => (!$local) ? true : false,
|
||||
'S_NUM_CATS' => sizeof($categories),
|
||||
'S_NUM_CATS' => count($categories),
|
||||
'S_VIEW' => ($mode == 'view') ? true : false,
|
||||
'S_NUM_OBJECTS' => sizeof($content_array),
|
||||
'S_NUM_OBJECTS' => count($content_array),
|
||||
'S_USER_MODE' => ($user_mode == 'user') ? true : false,
|
||||
'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
|
||||
);
|
||||
@@ -546,15 +546,15 @@ class auth_admin extends \phpbb\auth\auth
|
||||
'NAME' => $ug_name,
|
||||
'CATEGORIES' => implode('</th><th>', $categories),
|
||||
|
||||
'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_default[$ug_id]) : '',
|
||||
'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_custom[$ug_id]) : '',
|
||||
'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && count($user_groups_default[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_default[$ug_id]) : '',
|
||||
'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && count($user_groups_custom[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_custom[$ug_id]) : '',
|
||||
'L_ACL_TYPE' => $l_acl_type,
|
||||
|
||||
'S_LOCAL' => ($local) ? true : false,
|
||||
'S_GLOBAL' => (!$local) ? true : false,
|
||||
'S_NUM_CATS' => sizeof($categories),
|
||||
'S_NUM_CATS' => count($categories),
|
||||
'S_VIEW' => ($mode == 'view') ? true : false,
|
||||
'S_NUM_OBJECTS' => sizeof($content_array),
|
||||
'S_NUM_OBJECTS' => count($content_array),
|
||||
'S_USER_MODE' => ($user_mode == 'user') ? true : false,
|
||||
'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
|
||||
);
|
||||
@@ -637,7 +637,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
global $db, $template, $user, $phpbb_root_path, $phpEx;
|
||||
global $phpbb_container;
|
||||
|
||||
if (!sizeof($hold_ary))
|
||||
if (!count($hold_ary))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -669,7 +669,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
'FORUM_ID' => $forum_id)
|
||||
);
|
||||
|
||||
if (isset($auth_ary['users']) && sizeof($auth_ary['users']))
|
||||
if (isset($auth_ary['users']) && count($auth_ary['users']))
|
||||
{
|
||||
$sql = 'SELECT user_id, username
|
||||
FROM ' . USERS_TABLE . '
|
||||
@@ -688,7 +688,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (isset($auth_ary['groups']) && sizeof($auth_ary['groups']))
|
||||
if (isset($auth_ary['groups']) && count($auth_ary['groups']))
|
||||
{
|
||||
$sql = 'SELECT group_id, group_name, group_type
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
@@ -890,7 +890,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($role_ids))
|
||||
if (count($role_ids))
|
||||
{
|
||||
$sql = "DELETE FROM $table
|
||||
WHERE $forum_sql
|
||||
@@ -1000,7 +1000,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
}
|
||||
|
||||
// If no data is there, we set the any-flag to ACL_NEVER...
|
||||
if (!sizeof($sql_ary))
|
||||
if (!count($sql_ary))
|
||||
{
|
||||
$sql_ary[] = array(
|
||||
'role_id' => (int) $role_id,
|
||||
@@ -1083,7 +1083,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Get role data for resetting data
|
||||
if (sizeof($cur_role_auth))
|
||||
if (count($cur_role_auth))
|
||||
{
|
||||
$sql = 'SELECT ao.auth_option, rd.role_id, rd.auth_setting
|
||||
FROM ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_ROLES_DATA_TABLE . ' rd
|
||||
|
Reference in New Issue
Block a user