1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +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

@@ -96,14 +96,14 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$pagination = $phpbb_container->get('pagination');
$selected_ids = '';
if (sizeof($post_id_list) && $action != 'merge_topics')
if (count($post_id_list) && $action != 'merge_topics')
{
foreach ($post_id_list as $num => $post_id)
{
$selected_ids .= '&post_id_list[' . $num . ']=' . $post_id;
}
}
else if (sizeof($topic_id_list) && $action == 'merge_topics')
else if (count($topic_id_list) && $action == 'merge_topics')
{
foreach ($topic_id_list as $num => $topic_id)
{
@@ -221,13 +221,13 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$db->sql_freeresult($result);
// If there is more than one page, but we have no topic list, then the start parameter is... erm... out of sync
if (!sizeof($topic_list) && $forum_topics && $start > 0)
if (!count($topic_list) && $forum_topics && $start > 0)
{
redirect($url . "&i=$id&action=$action&mode=$mode");
}
// Get topic tracking info
if (sizeof($topic_list))
if (count($topic_list))
{
if ($config['load_db_lastread'])
{
@@ -358,7 +358,7 @@ function mcp_resync_topics($topic_ids)
{
global $db, $user, $phpbb_log, $request;
if (!sizeof($topic_ids))
if (!count($topic_ids))
{
trigger_error('NO_TOPIC_SELECTED');
}
@@ -389,7 +389,7 @@ function mcp_resync_topics($topic_ids)
}
$db->sql_freeresult($result);
$msg = (sizeof($topic_ids) == 1) ? $user->lang['TOPIC_RESYNC_SUCCESS'] : $user->lang['TOPICS_RESYNC_SUCCESS'];
$msg = (count($topic_ids) == 1) ? $user->lang['TOPIC_RESYNC_SUCCESS'] : $user->lang['TOPICS_RESYNC_SUCCESS'];
$redirect = $request->variable('redirect', $user->data['session_page']);
@@ -406,7 +406,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
{
global $db, $template, $user, $phpEx, $phpbb_root_path, $phpbb_log, $request, $phpbb_dispatcher;
if (!sizeof($topic_ids))
if (!count($topic_ids))
{
$template->assign_var('MESSAGE', $user->lang['NO_TOPIC_SELECTED']);
return;
@@ -421,7 +421,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
$all_topic_data = phpbb_get_topic_data($sync_topics, 'm_merge');
if (!sizeof($all_topic_data) || empty($all_topic_data[$to_topic_id]))
if (!count($all_topic_data) || empty($all_topic_data[$to_topic_id]))
{
$template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']);
return;
@@ -440,7 +440,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
$post_id_list = $request->variable('post_id_list', array(0));
$start = $request->variable('start', 0);
if (!sizeof($post_id_list) && sizeof($topic_ids))
if (!count($post_id_list) && count($topic_ids))
{
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
@@ -455,7 +455,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
$db->sql_freeresult($result);
}
if (!sizeof($post_id_list))
if (!count($post_id_list))
{
$template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
return;