diff options
author | rxu <rxu@mail.ru> | 2017-06-28 00:58:03 +0700 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2018-01-01 13:56:04 +0100 |
commit | f8fbe3793680af1dae2db2829cfc84068831c52f (patch) | |
tree | 54c7108b28fb58688a8695a0b592c163314a09f9 /phpBB/includes/mcp | |
parent | ff18802656e72981f6ecb613d756bc19f2462689 (diff) | |
download | forums-f8fbe3793680af1dae2db2829cfc84068831c52f.tar forums-f8fbe3793680af1dae2db2829cfc84068831c52f.tar.gz forums-f8fbe3793680af1dae2db2829cfc84068831c52f.tar.bz2 forums-f8fbe3793680af1dae2db2829cfc84068831c52f.tar.xz forums-f8fbe3793680af1dae2db2829cfc84068831c52f.zip |
[ticket/14972] replace all occurrences of sizeof() with the count()
PHPBB3-14972
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r-- | phpBB/includes/mcp/mcp_ban.php | 2 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 20 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_logs.php | 4 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 82 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_pm_reports.php | 10 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_post.php | 10 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 38 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_reports.php | 32 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 24 |
9 files changed, 111 insertions, 111 deletions
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index 2f3405f915..b878b1af0a 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -268,7 +268,7 @@ class mcp_ban { $post_info = phpbb_get_post_data($post_id, 'm_ban'); - if (sizeof($post_info) && !empty($post_info[$post_id])) + if (count($post_info) && !empty($post_info[$post_id])) { switch ($mode) { diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 3e214797c8..19f71e092a 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -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; diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index c34c915a40..cbc84e8c64 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -115,7 +115,7 @@ class mcp_logs { if (confirm_box(true)) { - if ($deletemark && sizeof($marked)) + if ($deletemark && count($marked)) { $conditions = array( 'forum_id' => array('IN' => $forum_list), @@ -221,7 +221,7 @@ class mcp_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'], ) ); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 3d56bba21c..2133bd9a19 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -47,7 +47,7 @@ class mcp_main case 'unlock': $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); - if (!sizeof($topic_ids)) + if (!count($topic_ids)) { trigger_error('NO_TOPIC_SELECTED'); } @@ -60,7 +60,7 @@ class mcp_main $post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0)); - if (!sizeof($post_ids)) + if (!count($post_ids)) { trigger_error('NO_POST_SELECTED'); } @@ -75,7 +75,7 @@ class mcp_main $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); - if (!sizeof($topic_ids)) + if (!count($topic_ids)) { trigger_error('NO_TOPIC_SELECTED'); } @@ -88,7 +88,7 @@ class mcp_main $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); - if (!sizeof($topic_ids)) + if (!count($topic_ids)) { trigger_error('NO_TOPIC_SELECTED'); } @@ -101,7 +101,7 @@ class mcp_main $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); - if (!sizeof($topic_ids)) + if (!count($topic_ids)) { trigger_error('NO_TOPIC_SELECTED'); } @@ -118,7 +118,7 @@ class mcp_main $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); $soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false; - if (!sizeof($topic_ids)) + if (!count($topic_ids)) { trigger_error('NO_TOPIC_SELECTED'); } @@ -135,7 +135,7 @@ class mcp_main $post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0)); $soft_delete = (($request->is_set_post('confirm') && !$request->is_set_post('delete_permanent')) || !$auth->acl_get('m_delete', $forum_id)) ? true : false; - if (!sizeof($post_ids)) + if (!count($post_ids)) { trigger_error('NO_POST_SELECTED'); } @@ -148,7 +148,7 @@ class mcp_main $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); - if (!sizeof($topic_ids)) + if (!count($topic_ids)) { trigger_error('NO_TOPIC_SELECTED'); } @@ -193,7 +193,7 @@ class mcp_main $forum_info = phpbb_get_forum_data($forum_id, 'm_', true); - if (!sizeof($forum_info)) + if (!count($forum_info)) { $this->main('main', 'front'); return; @@ -342,7 +342,7 @@ function lock_unlock($action, $ids) ); extract($phpbb_dispatcher->trigger_event('core.mcp_lock_unlock_after', compact($vars))); - $success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; + $success_msg = $l_prefix . ((count($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; meta_refresh(2, $redirect); $message = $user->lang[$success_msg]; @@ -355,7 +355,7 @@ function lock_unlock($action, $ids) } else { - confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((sizeof($ids) == 1) ? '' : 'S'), $s_hidden_fields); + confirm_box(false, strtoupper($action) . '_' . $l_prefix . ((count($ids) == 1) ? '' : 'S'), $s_hidden_fields); } redirect($redirect); @@ -373,25 +373,25 @@ function change_topic_type($action, $topic_ids) case 'make_announce': $new_topic_type = POST_ANNOUNCE; $check_acl = 'f_announce'; - $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_ANNOUNCEMENT' : 'MCP_MAKE_ANNOUNCEMENTS'; + $l_new_type = (count($topic_ids) == 1) ? 'MCP_MAKE_ANNOUNCEMENT' : 'MCP_MAKE_ANNOUNCEMENTS'; break; case 'make_global': $new_topic_type = POST_GLOBAL; $check_acl = 'f_announce_global'; - $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_GLOBAL' : 'MCP_MAKE_GLOBALS'; + $l_new_type = (count($topic_ids) == 1) ? 'MCP_MAKE_GLOBAL' : 'MCP_MAKE_GLOBALS'; break; case 'make_sticky': $new_topic_type = POST_STICKY; $check_acl = 'f_sticky'; - $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_STICKY' : 'MCP_MAKE_STICKIES'; + $l_new_type = (count($topic_ids) == 1) ? 'MCP_MAKE_STICKY' : 'MCP_MAKE_STICKIES'; break; default: $new_topic_type = POST_NORMAL; $check_acl = false; - $l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_NORMAL' : 'MCP_MAKE_NORMALS'; + $l_new_type = (count($topic_ids) == 1) ? 'MCP_MAKE_NORMAL' : 'MCP_MAKE_NORMALS'; break; } @@ -419,7 +419,7 @@ function change_topic_type($action, $topic_ids) WHERE " . $db->sql_in_set('topic_id', $topic_ids); $db->sql_query($sql); - if (($new_topic_type == POST_GLOBAL) && sizeof($topic_ids)) + if (($new_topic_type == POST_GLOBAL) && count($topic_ids)) { // Delete topic shadows for global announcements $sql = 'DELETE FROM ' . TOPICS_TABLE . ' @@ -432,9 +432,9 @@ function change_topic_type($action, $topic_ids) $db->sql_query($sql); } - $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED'; + $success_msg = (count($topic_ids) == 1) ? 'TOPIC_TYPE_CHANGED' : 'TOPICS_TYPE_CHANGED'; - if (sizeof($topic_ids)) + if (count($topic_ids)) { $data = phpbb_get_topic_data($topic_ids); @@ -496,7 +496,7 @@ function mcp_move_topic($topic_ids) { $forum_data = phpbb_get_forum_data($to_forum_id, 'f_post'); - if (!sizeof($forum_data)) + if (!count($forum_data)) { $additional_msg = $user->lang['FORUM_NOT_EXIST']; } @@ -691,7 +691,7 @@ function mcp_move_topic($topic_ids) $sync_sql[$forum_id][] = 'forum_topics_softdeleted = forum_topics_softdeleted - ' . (int) $topics_moved_softdeleted; } - $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_MOVED_SUCCESS' : 'TOPICS_MOVED_SUCCESS'; + $success_msg = (count($topic_ids) == 1) ? 'TOPIC_MOVED_SUCCESS' : 'TOPICS_MOVED_SUCCESS'; foreach ($sync_sql as $forum_id_key => $array) { @@ -714,7 +714,7 @@ function mcp_move_topic($topic_ids) 'ADDITIONAL_MSG' => $additional_msg) ); - confirm_box(false, 'MOVE_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); + confirm_box(false, 'MOVE_TOPIC' . ((count($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); } $redirect = $request->variable('redirect', "index.$phpEx"); @@ -762,7 +762,7 @@ function mcp_restore_topic($topic_ids) if (confirm_box(true)) { - $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_RESTORED_SUCCESS' : 'TOPICS_RESTORED_SUCCESS'; + $success_msg = (count($topic_ids) == 1) ? 'TOPIC_RESTORED_SUCCESS' : 'TOPICS_RESTORED_SUCCESS'; $data = phpbb_get_topic_data($topic_ids); @@ -784,7 +784,7 @@ function mcp_restore_topic($topic_ids) } else { - confirm_box(false, (sizeof($topic_ids) == 1) ? 'RESTORE_TOPIC' : 'RESTORE_TOPICS', $s_hidden_fields); + confirm_box(false, (count($topic_ids) == 1) ? 'RESTORE_TOPIC' : 'RESTORE_TOPICS', $s_hidden_fields); } $topic_id = $request->variable('t', 0); @@ -842,7 +842,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = '' if (confirm_box(true)) { - $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_DELETED_SUCCESS' : 'TOPICS_DELETED_SUCCESS'; + $success_msg = (count($topic_ids) == 1) ? 'TOPIC_DELETED_SUCCESS' : 'TOPICS_DELETED_SUCCESS'; $data = phpbb_get_topic_data($topic_ids); @@ -927,10 +927,10 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = '' 'S_TOPIC_MODE' => true, 'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id), 'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id), - 'DELETE_TOPIC_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_TOPIC_PERMANENTLY', sizeof($topic_ids)), + 'DELETE_TOPIC_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_TOPIC_PERMANENTLY', count($topic_ids)), )); - $l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS'; + $l_confirm = (count($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS'; if ($only_softdeleted) { $l_confirm .= '_PERMANENTLY'; @@ -1042,11 +1042,11 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', { $phpbb_content_visibility->set_post_visibility(ITEM_DELETED, $topic_data['posts'], $topic_id, $topic_data['forum_id'], $user->data['user_id'], time(), $soft_delete_reason, isset($topic_data['first_post']), isset($topic_data['last_post'])); } - $affected_topics = sizeof($topic_info); + $affected_topics = count($topic_info); // None of the topics is really deleted, so a redirect won't hurt much. $deleted_topics = 0; - $success_msg = (sizeof($post_info) == 1) ? $user->lang['POST_DELETED_SUCCESS'] : $user->lang['POSTS_DELETED_SUCCESS']; + $success_msg = (count($post_info) == 1) ? $user->lang['POST_DELETED_SUCCESS'] : $user->lang['POSTS_DELETED_SUCCESS']; foreach ($approve_log as $row) { @@ -1093,7 +1093,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', { $topic_id_list[] = $row['topic_id']; } - $affected_topics = sizeof($topic_id_list); + $affected_topics = count($topic_id_list); $db->sql_freeresult($result); $post_data = phpbb_get_post_data($post_ids); @@ -1132,7 +1132,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', } $return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>'); - if (sizeof($post_ids) == 1) + if (count($post_ids) == 1) { if ($deleted_topics) { @@ -1181,10 +1181,10 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', 'S_SOFTDELETED' => $only_softdeleted, 'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id), 'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id), - 'DELETE_POST_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_POST_PERMANENTLY', sizeof($post_ids)), + 'DELETE_POST_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_POST_PERMANENTLY', count($post_ids)), )); - $l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS'; + $l_confirm = (count($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS'; if ($only_softdeleted) { $l_confirm .= '_PERMANENTLY'; @@ -1247,11 +1247,11 @@ function mcp_fork_topic($topic_ids) { $forum_data = phpbb_get_forum_data($to_forum_id, 'f_post'); - if (!sizeof($topic_ids)) + if (!count($topic_ids)) { $additional_msg = $user->lang['NO_TOPIC_SELECTED']; } - else if (!sizeof($forum_data)) + else if (!count($forum_data)) { $additional_msg = $user->lang['FORUM_NOT_EXIST']; } @@ -1409,7 +1409,7 @@ function mcp_fork_topic($topic_ids) } $db->sql_freeresult($result); - if (!sizeof($post_rows)) + if (!count($post_rows)) { continue; } @@ -1512,7 +1512,7 @@ function mcp_fork_topic($topic_ids) } $db->sql_freeresult($result); - if (sizeof($sql_ary)) + if (count($sql_ary)) { $db->sql_multi_insert(ATTACHMENTS_TABLE, $sql_ary); } @@ -1536,7 +1536,7 @@ function mcp_fork_topic($topic_ids) } $db->sql_freeresult($result); - if (sizeof($sql_ary)) + if (count($sql_ary)) { $db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary); } @@ -1557,7 +1557,7 @@ function mcp_fork_topic($topic_ids) } $db->sql_freeresult($result); - if (sizeof($sql_ary)) + if (count($sql_ary)) { $db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary); } @@ -1589,7 +1589,7 @@ function mcp_fork_topic($topic_ids) sync('topic', 'topic_id', $new_topic_id_list); sync('forum', 'forum_id', $to_forum_id); - $config->increment('num_topics', sizeof($new_topic_id_list), false); + $config->increment('num_topics', count($new_topic_id_list), false); $config->increment('num_posts', $total_posts, false); foreach ($new_topic_id_list as $topic_id => $new_topic_id) @@ -1601,7 +1601,7 @@ function mcp_fork_topic($topic_ids) )); } - $success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_FORKED_SUCCESS' : 'TOPICS_FORKED_SUCCESS'; + $success_msg = (count($topic_ids) == 1) ? 'TOPIC_FORKED_SUCCESS' : 'TOPICS_FORKED_SUCCESS'; } else { @@ -1611,7 +1611,7 @@ function mcp_fork_topic($topic_ids) 'ADDITIONAL_MSG' => $additional_msg) ); - confirm_box(false, 'FORK_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); + confirm_box(false, 'FORK_TOPIC' . ((count($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); } $redirect = $request->variable('redirect', "index.$phpEx"); diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index 67a1a959e4..c17b9985af 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -55,7 +55,7 @@ class mcp_pm_reports $report_id_list = $request->variable('report_id_list', array(0)); - if (!sizeof($report_id_list)) + if (!count($report_id_list)) { trigger_error('NO_REPORT_SELECTED'); } @@ -104,7 +104,7 @@ class mcp_pm_reports $pm_info = phpbb_get_pm_data(array($pm_id)); - if (!sizeof($pm_info)) + if (!count($pm_info)) { trigger_error('NO_REPORT_SELECTED'); } @@ -141,7 +141,7 @@ class mcp_pm_reports } $db->sql_freeresult($result); - if (sizeof($attachments)) + if (count($attachments)) { $update_count = array(); parse_attachments(0, $message, $attachments, $update_count); @@ -251,7 +251,7 @@ class mcp_pm_reports } $db->sql_freeresult($result); - if (sizeof($report_ids)) + if (count($report_ids)) { $sql = 'SELECT p.*, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru @@ -270,7 +270,7 @@ class mcp_pm_reports } $db->sql_freeresult($result); - if (sizeof($pm_list)) + if (count($pm_list)) { $address_list = get_recipient_strings($pm_by_id); diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 60ec3b8f5a..d6d0369e48 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -38,7 +38,7 @@ function mcp_post_details($id, $mode, $action) add_form_key('mcp_post_details'); - if (!sizeof($post_info)) + if (!count($post_info)) { trigger_error('POST_NOT_EXIST'); } @@ -165,7 +165,7 @@ function mcp_post_details($id, $mode, $action) } $db->sql_freeresult($result); - if (sizeof($attachments)) + if (count($attachments)) { $user->add_lang('viewtopic'); $update_count = array(); @@ -409,7 +409,7 @@ function mcp_post_details($id, $mode, $action) ); } - if (sizeof($users_ary)) + if (count($users_ary)) { // Get the usernames $sql = 'SELECT user_id, username @@ -495,7 +495,7 @@ function mcp_post_details($id, $mode, $action) $user_select = ''; - if (sizeof($usernames_ary)) + if (count($usernames_ary)) { ksort($usernames_ary); @@ -656,7 +656,7 @@ function change_poster(&$post_info, $userdata) // Renew post info $post_info = phpbb_get_post_data(array($post_id), false, true); - if (!sizeof($post_info)) + if (!count($post_info)) { trigger_error('POST_NOT_EXIST'); } diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index d489649649..2e0a1cf9e6 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -179,7 +179,7 @@ class mcp_queue $post_info = phpbb_get_post_data(array($post_id), 'm_approve', true); - if (!sizeof($post_info)) + if (!count($post_info)) { trigger_error('NO_POST_SELECTED'); } @@ -230,7 +230,7 @@ class mcp_queue } $db->sql_freeresult($result); - if (sizeof($attachments)) + if (count($attachments)) { $update_count = array(); parse_attachments($post_info['forum_id'], $message, $attachments, $update_count); @@ -377,7 +377,7 @@ class mcp_queue { $topic_info = phpbb_get_topic_data(array($topic_id)); - if (!sizeof($topic_info)) + if (!count($topic_info)) { trigger_error('TOPIC_NOT_EXIST'); } @@ -407,7 +407,7 @@ class mcp_queue $forum_list[] = $row['forum_id']; } - if (!sizeof($forum_list)) + if (!count($forum_list)) { trigger_error('NOT_MODERATOR'); } @@ -423,7 +423,7 @@ class mcp_queue { $forum_info = phpbb_get_forum_data(array($forum_id), $m_perm); - if (!sizeof($forum_info)) + if (!count($forum_info)) { trigger_error('NOT_MODERATOR'); } @@ -493,7 +493,7 @@ class mcp_queue } $db->sql_freeresult($result); - if (sizeof($post_ids)) + if (count($post_ids)) { $sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u @@ -565,7 +565,7 @@ class mcp_queue $db->sql_freeresult($result); } - if (sizeof($forum_names)) + if (count($forum_names)) { // Select the names for the forum_ids $sql = 'SELECT forum_id, forum_name @@ -799,7 +799,7 @@ class mcp_queue } else { - $success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS'; + $success_msg = (count($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS'; } /** @@ -842,7 +842,7 @@ class mcp_queue $message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); // If approving one post, also give links back to post... - if (sizeof($post_info) == 1 && $post_url) + if (count($post_info) == 1 && $post_url) { $message .= '<br /><br />' . $user->lang('RETURN_POST', '<a href="' . $post_url . '">', '</a>'); } @@ -875,14 +875,14 @@ class mcp_queue // Create the confirm box message $action_msg = strtoupper($action); - $num_posts = sizeof($post_id_list) - $num_topics; + $num_posts = count($post_id_list) - $num_topics; if ($num_topics > 0 && $num_posts <= 0) { $action_msg .= '_TOPIC' . (($num_topics == 1) ? '' : 'S'); } else { - $action_msg .= '_POST' . ((sizeof($post_id_list) == 1) ? '' : 'S'); + $action_msg .= '_POST' . ((count($post_id_list) == 1) ? '' : 'S'); } confirm_box(false, $action_msg, $s_hidden_fields, 'mcp_approve.html'); } @@ -947,9 +947,9 @@ class mcp_queue ); } - if (sizeof($topic_info) >= 1) + if (count($topic_info) >= 1) { - $success_msg = (sizeof($topic_info) == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS'; + $success_msg = (count($topic_info) == 1) ? 'TOPIC_' . strtoupper($action) . 'D_SUCCESS' : 'TOPICS_' . strtoupper($action) . 'D_SUCCESS'; } foreach ($approve_log as $log_data) @@ -1052,7 +1052,7 @@ class mcp_queue $message .= '<br /><br />' . $user->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); // If approving one topic, also give links back to topic... - if (sizeof($topic_info) == 1 && $topic_url) + if (count($topic_info) == 1 && $topic_url) { $message .= '<br /><br />' . $user->lang('RETURN_TOPIC', '<a href="' . $topic_url . '">', '</a>'); } @@ -1083,7 +1083,7 @@ class mcp_queue 'S_' . strtoupper($action) => true, )); - confirm_box(false, strtoupper($action) . '_TOPIC' . ((sizeof($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html'); + confirm_box(false, strtoupper($action) . '_TOPIC' . ((count($topic_id_list) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_approve.html'); } redirect($redirect); @@ -1234,8 +1234,8 @@ class mcp_queue } // Get disapproved posts/topics counts separately - $num_disapproved_topics = sizeof($disapprove_log_topics); - $num_disapproved_posts = sizeof($disapprove_log_posts); + $num_disapproved_topics = count($disapprove_log_topics); + $num_disapproved_posts = count($disapprove_log_posts); // Build the whole log $disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts); @@ -1244,7 +1244,7 @@ class mcp_queue unset($post_data, $disapprove_log_topics, $disapprove_log_posts); // Let's do the job - delete disapproved posts - if (sizeof($post_disapprove_list)) + if (count($post_disapprove_list)) { if (!function_exists('delete_posts')) { @@ -1472,7 +1472,7 @@ class mcp_queue $l_confirm_msg = 'DELETE_POST_PERMANENTLY'; $confirm_template = 'confirm_delete_body.html'; } - $l_confirm_msg .= ((sizeof($post_id_list) == 1) ? '' : 'S'); + $l_confirm_msg .= ((count($post_id_list) == 1) ? '' : 'S'); $template->assign_vars(array( 'S_NOTIFY_POSTER' => $show_notify, diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 1462acf110..f5147deb49 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -53,7 +53,7 @@ class mcp_reports $report_id_list = $request->variable('report_id_list', array(0)); - if (!sizeof($report_id_list)) + if (!count($report_id_list)) { trigger_error('NO_REPORT_SELECTED'); } @@ -158,7 +158,7 @@ class mcp_reports $post_info = phpbb_get_post_data(array($post_id), 'm_report', true); - if (!sizeof($post_info)) + if (!count($post_info)) { trigger_error('NO_REPORT_SELECTED'); } @@ -222,7 +222,7 @@ class mcp_reports } $db->sql_freeresult($result); - if (sizeof($attachments)) + if (count($attachments)) { $update_count = array(); parse_attachments($post_info['forum_id'], $message, $attachments, $update_count); @@ -321,7 +321,7 @@ class mcp_reports { $topic_info = phpbb_get_topic_data(array($topic_id)); - if (!sizeof($topic_info)) + if (!count($topic_info)) { trigger_error('TOPIC_NOT_EXIST'); } @@ -346,7 +346,7 @@ class mcp_reports $forum_list[] = $row['forum_id']; } - if (!sizeof($forum_list)) + if (!count($forum_list)) { trigger_error('NOT_MODERATOR'); } @@ -362,7 +362,7 @@ class mcp_reports { $forum_info = phpbb_get_forum_data(array($forum_id), 'm_report'); - if (!sizeof($forum_info)) + if (!count($forum_info)) { trigger_error('NOT_MODERATOR'); } @@ -443,7 +443,7 @@ class mcp_reports } $db->sql_freeresult($result); - if (sizeof($report_ids)) + if (count($report_ids)) { $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, p.post_attachment, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru @@ -617,12 +617,12 @@ function close_report($report_id_list, $mode, $action, $pm = false) } $db->sql_freeresult($result); - if (sizeof($reports)) + if (count($reports)) { $close_report_posts = array_unique($close_report_posts); $close_report_topics = array_unique($close_report_topics); - if (!$pm && sizeof($close_report_posts)) + if (!$pm && count($close_report_posts)) { // Get a list of topics that still contain reported posts $sql = 'SELECT DISTINCT topic_id @@ -658,7 +658,7 @@ function close_report($report_id_list, $mode, $action, $pm = false) } $db->sql_query($sql); - if (sizeof($close_report_posts)) + if (count($close_report_posts)) { if ($pm) { @@ -679,7 +679,7 @@ function close_report($report_id_list, $mode, $action, $pm = false) WHERE ' . $db->sql_in_set('post_id', $close_report_posts); $db->sql_query($sql); - if (sizeof($close_report_topics)) + if (count($close_report_topics)) { $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_reported = 0 @@ -721,7 +721,7 @@ function close_report($report_id_list, $mode, $action, $pm = false) } // Notify reporters - if (sizeof($notify_reporters)) + if (count($notify_reporters)) { foreach ($notify_reporters as $report_id => $reporter) { @@ -761,11 +761,11 @@ function close_report($report_id_list, $mode, $action, $pm = false) unset($notify_reporters, $post_info, $reports); - $success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS'; + $success_msg = (count($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS'; } else { - confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields); + confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((count($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields); } $redirect = $request->variable('redirect', "index.$phpEx"); @@ -784,12 +784,12 @@ function close_report($report_id_list, $mode, $action, $pm = false) if (!$pm) { - if (sizeof($forum_ids) === 1) + if (count($forum_ids) === 1) { $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; } - if (sizeof($topic_ids) === 1) + if (count($topic_ids) === 1) { $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; } diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 76df5b3a5e..9c63245982 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -36,7 +36,7 @@ function mcp_topic_view($id, $mode, $action) $topic_id = $request->variable('t', 0); $topic_info = phpbb_get_topic_data(array($topic_id), false, true); - if (!sizeof($topic_info)) + if (!count($topic_info)) { trigger_error('TOPIC_NOT_EXIST'); } @@ -97,7 +97,7 @@ function mcp_topic_view($id, $mode, $action) include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); - if (!sizeof($post_id_list)) + if (!count($post_id_list)) { trigger_error('NO_POST_SELECTED'); } @@ -172,7 +172,7 @@ function mcp_topic_view($id, $mode, $action) // Grab extensions $attachments = array(); - if ($topic_info['topic_attachment'] && sizeof($post_id_list)) + if ($topic_info['topic_attachment'] && count($post_id_list)) { // Get attachments... if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_info['forum_id'])) @@ -326,7 +326,7 @@ function mcp_topic_view($id, $mode, $action) { $to_topic_info = phpbb_get_topic_data(array($to_topic_id), 'm_merge'); - if (!sizeof($to_topic_info)) + if (!count($to_topic_info)) { $to_topic_id = 0; } @@ -408,7 +408,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $forum_id = $request->variable('forum_id', 0); $start = $request->variable('start', 0); - if (!sizeof($post_id_list)) + if (!count($post_id_list)) { $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']); return; @@ -422,7 +422,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $post_id = $post_id_list[0]; $post_info = phpbb_get_post_data(array($post_id)); - if (!sizeof($post_info)) + if (!count($post_info)) { $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']); return; @@ -446,7 +446,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $forum_info = phpbb_get_forum_data(array($to_forum_id), 'f_post'); - if (!sizeof($forum_info)) + if (!count($forum_info)) { $template->assign_var('MESSAGE', $user->lang['USER_CANNOT_POST']); return; @@ -530,7 +530,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $db->sql_freeresult($result); } - if (!sizeof($post_id_list)) + if (!count($post_id_list)) { trigger_error('NO_POST_SELECTED'); } @@ -628,7 +628,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) } $db->sql_freeresult($result); - if (sizeof($sql_ary)) + if (count($sql_ary)) { $db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary); } @@ -649,7 +649,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) } $db->sql_freeresult($result); - if (sizeof($sql_ary)) + if (count($sql_ary)) { $db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary); } @@ -690,7 +690,7 @@ function merge_posts($topic_id, $to_topic_id) $topic_data = phpbb_get_topic_data($sync_topics, 'm_merge'); - if (!sizeof($topic_data) || empty($topic_data[$to_topic_id])) + if (!count($topic_data) || empty($topic_data[$to_topic_id])) { $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']); return; @@ -707,7 +707,7 @@ function merge_posts($topic_id, $to_topic_id) $post_id_list = $request->variable('post_id_list', array(0)); $start = $request->variable('start', 0); - if (!sizeof($post_id_list)) + if (!count($post_id_list)) { $template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']); return; |