1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[ticket/16790] Remove unused code

PHPBB3-16790
This commit is contained in:
rubencm
2021-06-05 01:42:01 +02:00
committed by Ruben Calvo
parent 072d62b0c0
commit 2f41ce219c
22 changed files with 51 additions and 197 deletions

View File

@@ -594,11 +594,6 @@ function mcp_move_topic($topic_ids)
$topic_data = phpbb_get_topic_data($topic_ids);
$leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false;
$forum_sync_data = array();
$forum_sync_data[$forum_id] = current($topic_data);
$forum_sync_data[$to_forum_id] = $forum_data;
$topics_moved = $topics_moved_unapproved = $topics_moved_softdeleted = 0;
$posts_moved = $posts_moved_unapproved = $posts_moved_softdeleted = 0;
@@ -636,12 +631,8 @@ function mcp_move_topic($topic_ids)
}
$shadow_topics = 0;
$forum_ids = array($to_forum_id);
foreach ($topic_data as $topic_id => $row)
{
// Get the list of forums to resync
$forum_ids[] = $row['forum_id'];
// We add the $to_forum_id twice, because 'forum_id' is updated
// when the topic is moved again later.
$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MOVE', false, array(
@@ -1202,7 +1193,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
$post_data = phpbb_get_post_data($post_ids);
foreach ($post_data as $id => $row)
foreach ($post_data as $row)
{
$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_DELETE_POST', false, array(
@@ -1741,7 +1732,7 @@ function mcp_fork_topic($topic_ids)
$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)
foreach ($new_topic_id_list as $new_topic_id)
{
$phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_FORK', false, array(
'forum_id' => $to_forum_id,

View File

@@ -135,6 +135,7 @@ class mcp_pm_reports
ORDER BY filetime DESC';
$result = $db->sql_query($sql);
$attachments = [];
while ($row = $db->sql_fetchrow($result))
{
$attachments[] = $row;
@@ -242,12 +243,10 @@ class mcp_pm_reports
ORDER BY $sort_order_sql";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$i = 0;
$report_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$report_ids[] = $row['report_id'];
$row_num[$row['report_id']] = $i++;
}
$db->sql_freeresult($result);

View File

@@ -129,7 +129,7 @@ function mcp_post_details($id, $mode, $action)
// Set some vars
$users_ary = $usernames_ary = array();
$attachments = $extensions = array();
$attachments = array();
$post_id = $post_info['post_id'];
// Get topic tracking info

View File

@@ -369,7 +369,6 @@ class mcp_queue
$user->add_lang(array('viewtopic', 'viewforum'));
$topic_id = $request->variable('t', 0);
$forum_info = array();
// If 'sort' is set, "Go" was pressed which is located behind the forums <select> box
// Then, unset the topic id so it does not override the forum id
@@ -413,13 +412,6 @@ class mcp_queue
{
trigger_error('NOT_MODERATOR');
}
$sql = 'SELECT SUM(forum_topics_approved) as sum_forum_topics
FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list);
$result = $db->sql_query($sql);
$forum_info['forum_topics_approved'] = (int) $db->sql_fetchfield('sum_forum_topics');
$db->sql_freeresult($result);
}
else
{
@@ -486,12 +478,10 @@ class mcp_queue
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$i = 0;
$post_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$post_ids[] = $row['post_id'];
$row_num[$row['post_id']] = $i++;
}
$db->sql_freeresult($result);

View File

@@ -342,7 +342,6 @@ class mcp_reports
$topic_id = $request->variable('t', 0, false, \phpbb\request\request_interface::POST);
}
$forum_info = array();
$forum_list_reports = get_forum_list('m_report', false, true);
$forum_list_read = array_flip(get_forum_list('f_read', true, true)); // Flipped so we can isset() the forum IDs
@@ -389,13 +388,6 @@ class mcp_reports
{
trigger_error('NOT_MODERATOR');
}
$sql = 'SELECT SUM(forum_topics_approved) as sum_forum_topics
FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list);
$result = $db->sql_query($sql);
$forum_info['forum_topics_approved'] = (int) $db->sql_fetchfield('sum_forum_topics');
$db->sql_freeresult($result);
}
else
{