aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2016-01-09 17:53:04 +0100
committerTristan Darricau <tristan.darricau@sensiolabs.com>2016-01-09 17:53:04 +0100
commitb2324607ad7d23450aafddbf6fb286fa05e3a9d5 (patch)
tree44b6b7108c59e1e2da190424b0cd8395b3abba47 /phpBB/includes/mcp
parent81cbabc1f6cebb4e93f9897c9e9e099fa9429ffe (diff)
parent3f44f368172f744499055c482dcaccb0108660ab (diff)
downloadforums-b2324607ad7d23450aafddbf6fb286fa05e3a9d5.tar
forums-b2324607ad7d23450aafddbf6fb286fa05e3a9d5.tar.gz
forums-b2324607ad7d23450aafddbf6fb286fa05e3a9d5.tar.bz2
forums-b2324607ad7d23450aafddbf6fb286fa05e3a9d5.tar.xz
forums-b2324607ad7d23450aafddbf6fb286fa05e3a9d5.zip
Merge pull request #4058 from marc1706/ticket/13454
[ticket/13454] Remove unused variables, globals, and parameters * marc1706/ticket/13454: [ticket/13454] Add excessively removed code back [ticket/13454] Remove more unused variables [ticket/13454] Remove double semi-colons [ticket/13454] Remove unused variables [ticket/13454] Fix code sniffer complaints [ticket/13454] Fix a few issues introduced by overdeleting stuff [ticket/13454] Remove unused variables [ticket/13454] Remove unused variables [ticket/13454] Remove unused variables [ticket/13454] Remove unused variables
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_forum.php8
-rw-r--r--phpBB/includes/mcp/mcp_front.php2
-rw-r--r--phpBB/includes/mcp/mcp_logs.php2
-rw-r--r--phpBB/includes/mcp/mcp_main.php16
-rw-r--r--phpBB/includes/mcp/mcp_notes.php6
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php2
-rw-r--r--phpBB/includes/mcp/mcp_post.php5
-rw-r--r--phpBB/includes/mcp/mcp_queue.php20
-rw-r--r--phpBB/includes/mcp/mcp_reports.php11
-rw-r--r--phpBB/includes/mcp/mcp_topic.php15
-rw-r--r--phpBB/includes/mcp/mcp_warn.php17
11 files changed, 39 insertions, 65 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 90a3db0949..dc4d59cc46 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -241,8 +241,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
foreach ($topic_list as $topic_id)
{
- $topic_title = '';
-
$row_ary = &$topic_rows[$topic_id];
$replies = $phpbb_content_visibility->get_count('topic_posts', $row_ary, $forum_id) - 1;
@@ -358,7 +356,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
*/
function mcp_resync_topics($topic_ids)
{
- global $auth, $db, $template, $phpEx, $user, $phpbb_root_path, $phpbb_log, $request;
+ global $db, $user, $phpbb_log, $request;
if (!sizeof($topic_ids))
{
@@ -406,7 +404,7 @@ function mcp_resync_topics($topic_ids)
*/
function merge_topics($forum_id, $topic_ids, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request;
+ global $db, $template, $user, $phpEx, $phpbb_root_path, $phpbb_log, $request;
if (!sizeof($topic_ids))
{
@@ -479,7 +477,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
'redirect' => $redirect,
'topic_id_list' => $topic_ids)
);
- $success_msg = $return_link = '';
+ $return_link = '';
if (confirm_box(true))
{
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index 23a0604ccd..432b26ad11 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
*/
function mcp_front_view($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
+ global $phpEx, $phpbb_root_path;
global $template, $db, $user, $auth, $module;
global $phpbb_dispatcher, $request;
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index bf2d462801..fca0412321 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -36,7 +36,7 @@ class mcp_logs
function main($id, $mode)
{
global $auth, $db, $user, $template, $request;
- global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log;
+ global $config, $phpbb_container, $phpbb_log;
$user->add_lang('acp/common');
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index e2fb1e4afa..9702056d7b 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -35,8 +35,8 @@ class mcp_main
function main($id, $mode)
{
- global $auth, $db, $user, $template, $action;
- global $config, $phpbb_root_path, $phpEx, $request;
+ global $auth, $user, $action;
+ global $phpbb_root_path, $phpEx, $request;
global $phpbb_dispatcher;
$quickmod = ($mode == 'quickmod') ? true : false;
@@ -262,7 +262,7 @@ class mcp_main
*/
function lock_unlock($action, $ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_log, $phpbb_dispatcher;
+ global $user, $db, $request, $phpbb_log, $phpbb_dispatcher;
if ($action == 'lock' || $action == 'unlock')
{
@@ -306,7 +306,6 @@ function lock_unlock($action, $ids)
'action' => $action,
'redirect' => $redirect)
);
- $success_msg = '';
if (confirm_box(true))
{
@@ -367,7 +366,7 @@ function lock_unlock($action, $ids)
*/
function change_topic_type($action, $topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_log;
+ global $user, $db, $request, $phpbb_log;
switch ($action)
{
@@ -412,7 +411,6 @@ function change_topic_type($action, $topic_ids)
'action' => $action,
'redirect' => $redirect,
);
- $success_msg = '';
if (confirm_box(true))
{
@@ -729,7 +727,7 @@ function mcp_move_topic($topic_ids)
*/
function mcp_restore_topic($topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log;
+ global $user, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log;
if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_approve')))
{
@@ -877,7 +875,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
if (!$is_soft)
{
- $return = delete_topics('topic_id', $topic_ids);
+ delete_topics('topic_id', $topic_ids);
}
}
else
@@ -1346,8 +1344,6 @@ function mcp_fork_topic($topic_ids)
if ($topic_row['poll_start'])
{
- $poll_rows = array();
-
$sql = 'SELECT *
FROM ' . POLL_OPTIONS_TABLE . "
WHERE topic_id = $topic_id";
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 502d4cb1e7..67f59bd618 100644
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -35,8 +35,8 @@ class mcp_notes
function main($id, $mode)
{
- global $auth, $db, $user, $template, $request;
- global $config, $phpbb_root_path, $phpEx;
+ global $user, $template, $request;
+ global $phpbb_root_path, $phpEx;
$action = $request->variable('action', array('' => ''));
@@ -74,7 +74,7 @@ class mcp_notes
*/
function mcp_notes_user_view($action)
{
- global $phpEx, $phpbb_root_path, $config, $phpbb_log, $request;
+ global $config, $phpbb_log, $request;
global $template, $db, $user, $auth, $phpbb_container;
$user_id = $request->variable('u', 0);
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 6e1d594135..67a1a959e4 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -35,7 +35,7 @@ class mcp_pm_reports
function main($id, $mode)
{
- global $auth, $db, $user, $template, $cache, $request;
+ global $auth, $db, $user, $template, $request;
global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 33aebccb22..7fa6ef4fff 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
function mcp_post_details($id, $mode, $action)
{
global $phpEx, $phpbb_root_path, $config, $request;
- global $template, $db, $user, $auth, $cache;
+ global $template, $db, $user, $auth;
global $phpbb_dispatcher;
$user->add_lang('posting');
@@ -128,7 +128,6 @@ function mcp_post_details($id, $mode, $action)
$users_ary = $usernames_ary = array();
$attachments = $extensions = array();
$post_id = $post_info['post_id'];
- $topic_tracking_info = array();
// Get topic tracking info
if ($config['load_db_lastread'])
@@ -150,8 +149,6 @@ function mcp_post_details($id, $mode, $action)
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{
- $extensions = $cache->obtain_attach_extensions($post_info['forum_id']);
-
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE post_msg_id = ' . $post_id . '
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 9fdd16e791..bf93593c74 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -35,7 +35,7 @@ class mcp_queue
public function main($id, $mode)
{
- global $auth, $db, $user, $template, $cache, $request;
+ global $auth, $db, $user, $template, $request;
global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
global $phpbb_dispatcher;
@@ -195,7 +195,7 @@ class mcp_queue
));
}
- $extensions = $attachments = $topic_tracking_info = array();
+ $attachments = $topic_tracking_info = array();
// Get topic tracking info
if ($config['load_db_lastread'])
@@ -217,8 +217,6 @@ class mcp_queue
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{
- $extensions = $cache->obtain_attach_extensions($post_info['forum_id']);
-
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE post_msg_id = ' . $post_id . '
@@ -402,7 +400,6 @@ class mcp_queue
trigger_error('NOT_MODERATOR');
}
- $forum_info = $forum_info[$forum_id];
$forum_list = $forum_id;
}
@@ -417,7 +414,6 @@ class mcp_queue
$sort_by_sql = $sort_order_sql = array();
phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
- $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total;
$limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
$forum_names = array();
@@ -621,7 +617,7 @@ class mcp_queue
*/
static public function approve_posts($action, $post_id_list, $id, $mode)
{
- global $db, $template, $user, $config, $request, $phpbb_container, $phpbb_dispatcher;
+ global $template, $user, $request, $phpbb_container, $phpbb_dispatcher;
global $phpEx, $phpbb_root_path, $phpbb_log;
if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
@@ -631,7 +627,7 @@ class mcp_queue
$redirect = $request->variable('redirect', build_url(array('quickmod')));
$redirect = reapply_sid($redirect);
- $success_msg = $post_url = '';
+ $post_url = '';
$approve_log = array();
$num_topics = 0;
@@ -876,7 +872,7 @@ class mcp_queue
*/
static public function approve_topics($action, $topic_id_list, $id, $mode)
{
- global $db, $template, $user, $config, $phpbb_log;
+ global $db, $template, $user, $phpbb_log;
global $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_dispatcher;
if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve')))
@@ -1073,7 +1069,7 @@ class mcp_queue
*/
static public function disapprove_posts($post_id_list, $id, $mode)
{
- global $db, $template, $user, $config, $phpbb_container, $phpbb_dispatcher;
+ global $db, $template, $user, $phpbb_container, $phpbb_dispatcher;
global $phpEx, $phpbb_root_path, $request, $phpbb_log;
if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
@@ -1085,7 +1081,7 @@ class mcp_queue
$redirect = reapply_sid($redirect);
$reason = $request->variable('reason', '', true);
$reason_id = $request->variable('reason_id', 0);
- $success_msg = $additional_msg = '';
+ $additional_msg = '';
$s_hidden_fields = build_hidden_fields(array(
'i' => $id,
@@ -1143,7 +1139,7 @@ class mcp_queue
if (confirm_box(true))
{
- $disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array();
+ $disapprove_log_topics = $disapprove_log_posts = array();
$topic_posts_unapproved = $post_disapprove_list = $topic_information = array();
// Build a list of posts to be disapproved and get the related topics real replies count
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 45265c89e7..48d0e8d890 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -35,7 +35,7 @@ class mcp_reports
function main($id, $mode)
{
- global $auth, $db, $user, $template, $cache, $request;
+ global $auth, $db, $user, $template, $request;
global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container, $phpbb_dispatcher;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
@@ -182,7 +182,7 @@ class mcp_reports
));
}
- $topic_tracking_info = $extensions = $attachments = array();
+ $attachments = array();
// Get topic tracking info
if ($config['load_db_lastread'])
{
@@ -351,8 +351,6 @@ class mcp_reports
trigger_error('NOT_MODERATOR');
}
- $global_id = $forum_list[0];
-
$sql = 'SELECT SUM(forum_topics_approved) as sum_forum_topics
FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list);
@@ -369,7 +367,6 @@ class mcp_reports
trigger_error('NOT_MODERATOR');
}
- $forum_info = $forum_info[$forum_id];
$forum_list = array($forum_id);
}
@@ -391,7 +388,6 @@ class mcp_reports
$sort_by_sql = $sort_order_sql = array();
phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
- $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total;
$limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : '';
if ($mode == 'reports')
@@ -460,7 +456,6 @@ class mcp_reports
ORDER BY ' . $sort_order_sql;
$result = $db->sql_query($sql);
- $report_data = $rowset = array();
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('postrow', array(
@@ -522,7 +517,7 @@ class mcp_reports
*/
function close_report($report_id_list, $mode, $action, $pm = false)
{
- global $db, $template, $user, $config, $auth, $phpbb_log, $request;
+ global $db, $user, $auth, $phpbb_log, $request;
global $phpEx, $phpbb_root_path, $phpbb_container;
$pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 ';
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 70794312f4..ba86484040 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
function mcp_topic_view($id, $mode, $action)
{
global $phpEx, $phpbb_root_path, $config, $request;
- global $template, $db, $user, $auth, $cache, $phpbb_container, $phpbb_dispatcher;
+ global $template, $db, $user, $auth, $phpbb_container, $phpbb_dispatcher;
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
@@ -156,8 +156,6 @@ function mcp_topic_view($id, $mode, $action)
}
$db->sql_freeresult($result);
- $topic_tracking_info = array();
-
// Get topic tracking info
if ($config['load_db_lastread'])
{
@@ -173,11 +171,9 @@ function mcp_topic_view($id, $mode, $action)
$has_unapproved_posts = $has_deleted_posts = false;
// Grab extensions
- $extensions = $attachments = array();
+ $attachments = array();
if ($topic_info['topic_attachment'] && sizeof($post_id_list))
{
- $extensions = $cache->obtain_attach_extensions($topic_info['forum_id']);
-
// Get attachments...
if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_info['forum_id']))
{
@@ -271,8 +267,6 @@ function mcp_topic_view($id, $mode, $action)
'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
);
- $current_row_number = $i;
-
/**
* Event to modify the template data block for topic reviews in the MCP
*
@@ -481,7 +475,6 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
'to_forum_id' => $to_forum_id,
'icon' => $request->variable('icon', 0))
);
- $success_msg = $return_link = '';
if (confirm_box(true))
{
@@ -644,7 +637,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
*/
function merge_posts($topic_id, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request;
+ global $db, $template, $user, $phpEx, $phpbb_root_path, $phpbb_log, $request;
if (!$to_topic_id)
{
@@ -696,7 +689,7 @@ function merge_posts($topic_id, $to_topic_id)
'redirect' => $redirect,
't' => $topic_id)
);
- $success_msg = $return_link = '';
+ $return_link = '';
if (confirm_box(true))
{
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index d4c5486ed4..0b66aae030 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -35,8 +35,7 @@ class mcp_warn
function main($id, $mode)
{
- global $auth, $db, $user, $template, $request;
- global $config, $phpbb_root_path, $phpEx;
+ global $request;
$action = $request->variable('action', array('' => ''));
@@ -78,8 +77,8 @@ class mcp_warn
*/
function mcp_warn_front_view()
{
- global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth;
+ global $phpEx, $phpbb_root_path;
+ global $template, $db, $user;
$template->assign_vars(array(
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
@@ -132,7 +131,7 @@ class mcp_warn
function mcp_warn_list_view($action)
{
global $phpEx, $phpbb_root_path, $config, $phpbb_container;
- global $template, $db, $user, $auth, $request;
+ global $template, $user, $auth, $request;
/* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
@@ -191,7 +190,7 @@ class mcp_warn
function mcp_warn_post_view($action)
{
global $phpEx, $phpbb_root_path, $config, $request;
- global $template, $db, $user, $auth, $phpbb_dispatcher;
+ global $template, $db, $user, $phpbb_dispatcher;
$post_id = $request->variable('p', 0);
$forum_id = $request->variable('f', 0);
@@ -370,8 +369,8 @@ class mcp_warn
*/
function mcp_warn_user_view($action)
{
- global $phpEx, $phpbb_root_path, $config, $module, $request;
- global $template, $db, $user, $auth, $phpbb_dispatcher;
+ global $phpEx, $phpbb_root_path, $config, $request;
+ global $template, $db, $user, $phpbb_dispatcher;
$user_id = $request->variable('u', 0);
$username = $request->variable('username', '', true);
@@ -524,7 +523,7 @@ class mcp_warn
function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
{
global $phpEx, $phpbb_root_path, $config, $phpbb_log;
- global $template, $db, $user, $auth;
+ global $db, $user;
if ($send_pm)
{