mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
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
This commit is contained in:
commit
b2324607ad
106 changed files with 240 additions and 454 deletions
|
@ -389,7 +389,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
|
|||
foreach ($sql_subary as $sql)
|
||||
{
|
||||
$sql = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_setting) VALUES ($sql)";
|
||||
$result = $db->sql_query($sql);
|
||||
$db->sql_query($sql);
|
||||
$sql = '';
|
||||
}
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
|
|||
if ($sql != '')
|
||||
{
|
||||
$sql = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_setting) $sql";
|
||||
$result = $db->sql_query($sql);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -405,7 +405,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
|
|||
case 'delete':
|
||||
foreach ($sql_subary as $sql)
|
||||
{
|
||||
$result = $db->sql_query($sql);
|
||||
$db->sql_query($sql);
|
||||
$sql = '';
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -143,7 +143,7 @@ function filldb($newposts)
|
|||
if ((rand(0,30) < 1) || ($forum_topic_count[$forum] == 0))
|
||||
{
|
||||
// create a new topic 1 in 30 times (or when there are none);
|
||||
$topic = make_topic($userid, "Testing topic $i", $forum);
|
||||
make_topic($userid, "Testing topic $i", $forum);
|
||||
$forum_topic_count[$forum]++;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -19,7 +19,7 @@ if (!headers_sent())
|
|||
function unicode_to_utf8($string)
|
||||
{
|
||||
$utf8 = '';
|
||||
$chars = array();
|
||||
|
||||
for ($i = 0; $i < strlen($string); $i++)
|
||||
{
|
||||
if (isset($string[$i + 5]) && substr($string, $i, 2) == '\\u' && ctype_xdigit(substr($string, $i + 2, 4)))
|
||||
|
|
|
@ -709,8 +709,6 @@ class acp_attachments
|
|||
$forum_ids = array();
|
||||
}
|
||||
|
||||
$extensions = array();
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . EXTENSIONS_TABLE . "
|
||||
WHERE group_id = $group_id
|
||||
|
@ -1572,7 +1570,6 @@ class acp_attachments
|
|||
if ($ip_2_counter == 0 && $ip_2_end == 254)
|
||||
{
|
||||
$ip_2_counter = 256;
|
||||
$ip_2_fragment = 256;
|
||||
|
||||
$iplist[] = "'$ip_1_counter.*'";
|
||||
}
|
||||
|
@ -1585,7 +1582,6 @@ class acp_attachments
|
|||
if ($ip_3_counter == 0 && $ip_3_end == 254)
|
||||
{
|
||||
$ip_3_counter = 256;
|
||||
$ip_3_fragment = 256;
|
||||
|
||||
$iplist[] = "'$ip_1_counter.$ip_2_counter.*'";
|
||||
}
|
||||
|
@ -1598,7 +1594,6 @@ class acp_attachments
|
|||
if ($ip_4_counter == 0 && $ip_4_end == 254)
|
||||
{
|
||||
$ip_4_counter = 256;
|
||||
$ip_4_fragment = 256;
|
||||
|
||||
$iplist[] = "'$ip_1_counter.$ip_2_counter.$ip_3_counter.*'";
|
||||
}
|
||||
|
|
|
@ -195,7 +195,6 @@ class acp_ban
|
|||
case 'user':
|
||||
|
||||
$field = 'username';
|
||||
$l_ban_cell = $user->lang['USERNAME'];
|
||||
|
||||
$sql = 'SELECT b.*, u.user_id, u.username, u.username_clean
|
||||
FROM ' . BANLIST_TABLE . ' b, ' . USERS_TABLE . ' u
|
||||
|
@ -208,7 +207,6 @@ class acp_ban
|
|||
case 'ip':
|
||||
|
||||
$field = 'ban_ip';
|
||||
$l_ban_cell = $user->lang['IP_HOSTNAME'];
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . BANLIST_TABLE . '
|
||||
|
@ -221,7 +219,6 @@ class acp_ban
|
|||
case 'email':
|
||||
|
||||
$field = 'ban_email';
|
||||
$l_ban_cell = $user->lang['EMAIL_ADDRESS'];
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . BANLIST_TABLE . '
|
||||
|
|
|
@ -25,8 +25,8 @@ class acp_bbcodes
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher, $phpbb_container;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log;
|
||||
global $db, $user, $template, $cache, $request, $phpbb_dispatcher, $phpbb_container;
|
||||
global $phpbb_log;
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
||||
|
|
|
@ -30,13 +30,12 @@ class acp_board
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $user, $template, $request;
|
||||
global $config, $phpbb_root_path, $phpEx;
|
||||
global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log;
|
||||
|
||||
$user->add_lang('acp/board');
|
||||
|
||||
$action = $request->variable('action', '');
|
||||
$submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
|
||||
|
||||
$form_key = 'acp_board';
|
||||
|
@ -760,7 +759,7 @@ class acp_board
|
|||
*/
|
||||
function select_auth_method($selected_method, $key = '')
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $phpbb_container;
|
||||
global $phpbb_container;
|
||||
|
||||
/* @var $auth_providers \phpbb\auth\provider_collection */
|
||||
$auth_providers = $phpbb_container->get('auth.provider_collection');
|
||||
|
@ -940,8 +939,6 @@ class acp_board
|
|||
*/
|
||||
function board_disable($value, $key)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$radio_ary = array(1 => 'YES', 0 => 'NO');
|
||||
|
||||
return h_radio('config[board_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $this->new_config['board_disable_msg'] . '" />';
|
||||
|
@ -1051,8 +1048,6 @@ class acp_board
|
|||
*/
|
||||
function select_news_forums($value, $key)
|
||||
{
|
||||
global $user, $config;
|
||||
|
||||
$forum_list = make_forum_select(false, false, true, true, true, false, true);
|
||||
|
||||
// Build forum options
|
||||
|
@ -1070,8 +1065,6 @@ class acp_board
|
|||
|
||||
function select_exclude_forums($value, $key)
|
||||
{
|
||||
global $user, $config;
|
||||
|
||||
$forum_list = make_forum_select(false, false, true, true, true, false, true);
|
||||
|
||||
// Build forum options
|
||||
|
@ -1127,7 +1120,7 @@ class acp_board
|
|||
*/
|
||||
function enable_mod_rewrite($value, $key)
|
||||
{
|
||||
global $user, $config;
|
||||
global $user;
|
||||
|
||||
// Determine whether mod_rewrite is enabled on the server
|
||||
// NOTE: This only works on Apache servers on which PHP is NOT
|
||||
|
|
|
@ -25,8 +25,8 @@ class acp_bots
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache, $request, $phpbb_log;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
global $config, $db, $user, $template, $cache, $request, $phpbb_log;
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
$action = $request->variable('action', '');
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
|
|
@ -25,8 +25,8 @@ class acp_captcha
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $user, $auth, $template, $phpbb_log, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
|
||||
global $user, $template, $phpbb_log, $request;
|
||||
global $config, $phpbb_container;
|
||||
|
||||
$user->add_lang('acp/board');
|
||||
|
||||
|
@ -178,7 +178,7 @@ class acp_captcha
|
|||
*/
|
||||
function deliver_demo($selected)
|
||||
{
|
||||
global $db, $user, $config, $phpbb_container;
|
||||
global $phpbb_container;
|
||||
|
||||
$captcha = $phpbb_container->get('captcha.factory')->get_instance($selected);
|
||||
$captcha->init(CONFIRM_REG);
|
||||
|
|
|
@ -37,7 +37,6 @@ class acp_database
|
|||
$this->page_title = 'ACP_DATABASE';
|
||||
|
||||
$action = $request->variable('action', '');
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
||||
$template->assign_vars(array(
|
||||
'MODE' => $mode
|
||||
|
|
|
@ -25,8 +25,7 @@ class acp_disallow
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
|
||||
global $config, $phpbb_admin_path;
|
||||
global $db, $user, $template, $cache, $phpbb_log, $request;
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ class acp_email
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache, $phpbb_log, $request;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher;
|
||||
global $config, $db, $user, $template, $phpbb_log, $request;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_dispatcher;
|
||||
|
||||
$user->add_lang('acp/email');
|
||||
$this->tpl_name = 'acp_email';
|
||||
|
|
|
@ -34,7 +34,7 @@ class acp_extensions
|
|||
function main()
|
||||
{
|
||||
// Start the page
|
||||
global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpEx, $phpbb_log, $cache;
|
||||
global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpbb_log, $cache;
|
||||
|
||||
$this->db = $db;
|
||||
$this->config = $config;
|
||||
|
|
|
@ -27,7 +27,7 @@ class acp_forums
|
|||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
|
||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log;
|
||||
global $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log;
|
||||
|
||||
$user->add_lang('acp/forums');
|
||||
$this->tpl_name = 'acp_forums';
|
||||
|
@ -1264,8 +1264,6 @@ class acp_forums
|
|||
return array($user->lang['NO_FORUM']);
|
||||
}
|
||||
|
||||
$subforums_to_name = $_row['forum_name'];
|
||||
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE . "
|
||||
WHERE parent_id = {$row['forum_id']}";
|
||||
|
@ -1383,7 +1381,7 @@ class acp_forums
|
|||
{
|
||||
global $db, $user, $phpbb_dispatcher;
|
||||
|
||||
$to_data = $moved_ids = $errors = array();
|
||||
$errors = array();
|
||||
|
||||
// Check if we want to move to a parent with link type
|
||||
if ($to_id > 0)
|
||||
|
|
|
@ -26,7 +26,7 @@ class acp_groups
|
|||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $request, $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
$user->add_lang('acp/groups');
|
||||
|
@ -306,8 +306,6 @@ class acp_groups
|
|||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
}
|
||||
|
||||
$data = $submit_ary = array();
|
||||
|
||||
if ($action == 'edit' && !$group_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
|
@ -1094,7 +1092,6 @@ class acp_groups
|
|||
ORDER BY group_legend ASC, group_type DESC, group_name ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_group_select_legend = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$group_name = $group_helper->get_name($row['group_name']);
|
||||
|
@ -1132,7 +1129,6 @@ class acp_groups
|
|||
ORDER BY t.teampage_position ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$category_data = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['teampage_id'] == $category_id)
|
||||
|
@ -1175,7 +1171,6 @@ class acp_groups
|
|||
ORDER BY g.group_type DESC, g.group_name ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_group_select_teampage = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$group_name = $group_helper->get_name($row['group_name']);
|
||||
|
|
|
@ -28,8 +28,8 @@ class acp_icons
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_container;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $template, $cache;
|
||||
global $config, $phpbb_root_path;
|
||||
global $request, $phpbb_container;
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
@ -194,7 +194,6 @@ class acp_icons
|
|||
|
||||
$data = array();
|
||||
$after = false;
|
||||
$display = 0;
|
||||
$order_lists = array('', '');
|
||||
$add_order_lists = array('', '');
|
||||
$display_count = 0;
|
||||
|
@ -209,7 +208,6 @@ class acp_icons
|
|||
if ($row[$fields . '_id'] == $icon_id)
|
||||
{
|
||||
$after = true;
|
||||
$display = $row['display_on_posting'];
|
||||
$data[$row[$fields . '_url']] = $row;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -32,7 +32,7 @@ class acp_inactive
|
|||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_container, $phpbb_log, $request;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
|
||||
if (!function_exists('user_active_flip'))
|
||||
{
|
||||
|
|
|
@ -29,8 +29,8 @@ class acp_jabber
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $phpbb_log, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $template, $phpbb_log, $request;
|
||||
global $config, $phpbb_root_path, $phpEx;
|
||||
|
||||
$user->add_lang('acp/board');
|
||||
|
||||
|
@ -39,7 +39,6 @@ class acp_jabber
|
|||
include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
|
||||
}
|
||||
|
||||
$action = $request->variable('action', '');
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
||||
if ($mode != 'settings')
|
||||
|
@ -68,8 +67,6 @@ class acp_jabber
|
|||
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$error = array();
|
||||
|
||||
$message = $user->lang['JAB_SETTINGS_CHANGED'];
|
||||
$log = 'JAB_SETTINGS_CHANGED';
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ class acp_logs
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_container;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $user, $auth, $template, $phpbb_container;
|
||||
global $config;
|
||||
global $request;
|
||||
|
||||
$user->add_lang('mcp');
|
||||
|
@ -34,7 +34,6 @@ class acp_logs
|
|||
// Set up general vars
|
||||
$action = $request->variable('action', '');
|
||||
$forum_id = $request->variable('f', 0);
|
||||
$topic_id = $request->variable('t', 0);
|
||||
$start = $request->variable('start', 0);
|
||||
$deletemark = $request->variable('delmarked', false, false, \phpbb\request\request_interface::POST);
|
||||
$deleteall = $request->variable('delall', false, false, \phpbb\request\request_interface::POST);
|
||||
|
|
|
@ -579,7 +579,7 @@ class acp_modules
|
|||
*/
|
||||
function make_module_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $ignore_noncat = false)
|
||||
{
|
||||
global $db, $user, $auth, $config;
|
||||
global $db, $user;
|
||||
|
||||
$sql = 'SELECT module_id, module_enabled, module_basename, parent_id, module_langname, left_id, right_id, module_auth
|
||||
FROM ' . MODULES_TABLE . "
|
||||
|
|
|
@ -26,8 +26,8 @@ class acp_permission_roles
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_container;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $template, $phpbb_container;
|
||||
global $phpbb_root_path, $phpEx;
|
||||
global $request, $phpbb_log;
|
||||
|
||||
if (!function_exists('user_get_id_name'))
|
||||
|
@ -477,7 +477,7 @@ class acp_permission_roles
|
|||
*/
|
||||
function display_auth_options($auth_options)
|
||||
{
|
||||
global $template, $user, $phpbb_container;
|
||||
global $template, $phpbb_container;
|
||||
|
||||
/* @var $phpbb_permissions \phpbb\permissions */
|
||||
$phpbb_permissions = $phpbb_container->get('acl.permissions');
|
||||
|
|
|
@ -31,8 +31,8 @@ class acp_permissions
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_container, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $phpbb_container, $request;
|
||||
global $config, $phpbb_root_path, $phpEx;
|
||||
|
||||
if (!function_exists('user_get_id_name'))
|
||||
{
|
||||
|
@ -167,8 +167,6 @@ class acp_permissions
|
|||
}
|
||||
|
||||
// Define some common variables for every mode
|
||||
$error = array();
|
||||
|
||||
$permission_scope = (strpos($mode, '_global') !== false) ? 'global' : 'local';
|
||||
|
||||
// Showing introductionary page?
|
||||
|
@ -692,8 +690,6 @@ class acp_permissions
|
|||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$ug_id = $forum_id = 0;
|
||||
|
||||
// We loop through the auth settings defined in our submit
|
||||
list($ug_id, ) = each($psubmit);
|
||||
list($forum_id, ) = each($psubmit[$ug_id]);
|
||||
|
|
|
@ -25,8 +25,7 @@ class acp_php_info
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $template;
|
||||
|
||||
if ($mode != 'info')
|
||||
{
|
||||
|
|
|
@ -33,8 +33,8 @@ class acp_profile
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
||||
global $config, $db, $user, $template;
|
||||
global $phpbb_root_path, $phpEx;
|
||||
global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
|
||||
|
||||
if (!function_exists('generate_smilies'))
|
||||
|
@ -55,7 +55,6 @@ class acp_profile
|
|||
$action = (isset($_POST['create'])) ? 'create' : $request->variable('action', '');
|
||||
|
||||
$error = array();
|
||||
$s_hidden_fields = '';
|
||||
|
||||
if (!$field_id && in_array($action, array('delete','activate', 'deactivate', 'move_up', 'move_down', 'edit')))
|
||||
{
|
||||
|
@ -776,7 +775,7 @@ class acp_profile
|
|||
*/
|
||||
function build_language_options(&$cp, $field_type, $action = 'create')
|
||||
{
|
||||
global $user, $config, $db, $phpbb_container, $request;
|
||||
global $user, $config, $db, $request;
|
||||
|
||||
$default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']];
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class acp_prune
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path;
|
||||
global $user, $phpEx, $phpbb_root_path;
|
||||
|
||||
$user->add_lang('acp/prune');
|
||||
|
||||
|
@ -55,8 +55,7 @@ class acp_prune
|
|||
*/
|
||||
function prune_forums($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $phpbb_log, $request;
|
||||
|
||||
$all_forums = $request->variable('all_forums', 0);
|
||||
$forum_id = $request->variable('f', array(0));
|
||||
|
@ -233,8 +232,8 @@ class acp_prune
|
|||
*/
|
||||
function prune_users($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
|
||||
global $db, $user, $auth, $template, $phpbb_log, $request;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
|
||||
|
||||
/** @var \phpbb\group\helper $group_helper */
|
||||
$group_helper = $phpbb_container->get('group_helper');
|
||||
|
@ -441,7 +440,6 @@ class acp_prune
|
|||
}
|
||||
|
||||
$key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
|
||||
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
|
||||
|
||||
$where_sql = '';
|
||||
$where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';
|
||||
|
|
|
@ -25,8 +25,8 @@ class acp_ranks
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log;
|
||||
global $db, $user, $template, $cache, $request, $phpbb_dispatcher;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpbb_log;
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
||||
|
@ -162,7 +162,7 @@ class acp_ranks
|
|||
case 'edit':
|
||||
case 'add':
|
||||
|
||||
$data = $ranks = $existing_imgs = array();
|
||||
$ranks = $existing_imgs = array();
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . RANKS_TABLE . '
|
||||
|
|
|
@ -25,8 +25,7 @@ class acp_reasons
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $template;
|
||||
global $request, $phpbb_log;
|
||||
|
||||
$user->add_lang(array('mcp', 'acp/posting'));
|
||||
|
|
|
@ -50,8 +50,8 @@ class acp_search
|
|||
|
||||
function settings($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $user, $template, $phpbb_log, $request;
|
||||
global $config, $phpbb_admin_path, $phpEx;
|
||||
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
||||
|
@ -232,8 +232,8 @@ class acp_search
|
|||
|
||||
function index($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $template, $phpbb_log, $request;
|
||||
global $config, $phpbb_admin_path, $phpEx;
|
||||
|
||||
$action = $request->variable('action', '');
|
||||
$this->state = explode(',', $config['search_indexing_state']);
|
||||
|
@ -551,7 +551,7 @@ class acp_search
|
|||
|
||||
function get_search_types()
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $phpbb_extension_manager;
|
||||
global $phpbb_extension_manager;
|
||||
|
||||
$finder = $phpbb_extension_manager->get_finder();
|
||||
|
||||
|
|
|
@ -201,7 +201,6 @@ class acp_styles
|
|||
$messages = array();
|
||||
$installed_names = array();
|
||||
$installed_dirs = array();
|
||||
$last_installed = false;
|
||||
foreach ($dirs as $dir)
|
||||
{
|
||||
if (in_array($dir, $this->reserved_style_names))
|
||||
|
@ -224,7 +223,6 @@ class acp_styles
|
|||
$style['style_id'] = $this->install_style($style);
|
||||
$style['_installed'] = true;
|
||||
$found = true;
|
||||
$last_installed = $style['style_id'];
|
||||
$installed_names[] = $style['style_name'];
|
||||
$installed_dirs[] = $style['style_path'];
|
||||
$messages[] = sprintf($this->user->lang['STYLE_INSTALLED'], htmlspecialchars($style['style_name']));
|
||||
|
|
|
@ -31,8 +31,8 @@ class acp_users
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $cache;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
|
||||
global $config, $db, $user, $auth, $template;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $phpbb_dispatcher, $request;
|
||||
global $phpbb_container, $phpbb_log;
|
||||
|
||||
|
@ -298,13 +298,11 @@ class acp_users
|
|||
case 'banuser':
|
||||
$ban[] = $user_row['username'];
|
||||
$reason = 'USER_ADMIN_BAN_NAME_REASON';
|
||||
$log = 'LOG_USER_BAN_USER';
|
||||
break;
|
||||
|
||||
case 'banemail':
|
||||
$ban[] = $user_row['user_email'];
|
||||
$reason = 'USER_ADMIN_BAN_EMAIL_REASON';
|
||||
$log = 'LOG_USER_BAN_EMAIL';
|
||||
break;
|
||||
|
||||
case 'banip':
|
||||
|
@ -322,7 +320,6 @@ class acp_users
|
|||
$db->sql_freeresult($result);
|
||||
|
||||
$reason = 'USER_ADMIN_BAN_IP_REASON';
|
||||
$log = 'LOG_USER_BAN_IP';
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1271,17 +1268,10 @@ class acp_users
|
|||
$user->add_lang('mcp');
|
||||
|
||||
// Set up general vars
|
||||
$start = $request->variable('start', 0);
|
||||
$deletemark = (isset($_POST['delmarked'])) ? true : false;
|
||||
$deleteall = (isset($_POST['delall'])) ? true : false;
|
||||
$confirm = (isset($_POST['confirm'])) ? true : false;
|
||||
$marked = $request->variable('mark', array(0));
|
||||
$message = $request->variable('message', '', true);
|
||||
|
||||
// Sort keys
|
||||
$sort_days = $request->variable('st', 0);
|
||||
$sort_key = $request->variable('sk', 't');
|
||||
$sort_dir = $request->variable('sd', 'd');
|
||||
|
||||
// Delete entries if requested and able
|
||||
if ($deletemark || $deleteall || $confirm)
|
||||
|
@ -1546,7 +1536,6 @@ class acp_users
|
|||
$selected = ($i == $data['bday_month']) ? ' selected="selected"' : '';
|
||||
$s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>";
|
||||
}
|
||||
$s_birthday_year_options = '';
|
||||
|
||||
$now = getdate();
|
||||
$s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>';
|
||||
|
@ -2296,10 +2285,6 @@ class acp_users
|
|||
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$founder_manage = 0;
|
||||
}
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
|
|
|
@ -28,8 +28,7 @@ class acp_words
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache, $phpbb_log, $request, $phpbb_container;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $user, $template, $cache, $phpbb_log, $request, $phpbb_container;
|
||||
|
||||
$user->add_lang('acp/posting');
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ class auth_admin extends \phpbb\auth\auth
|
|||
*/
|
||||
function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
|
||||
{
|
||||
global $template, $user, $db, $phpbb_root_path, $phpEx, $phpbb_container;
|
||||
global $template, $user, $db, $phpbb_container;
|
||||
|
||||
/* @var $phpbb_permissions \phpbb\permissions */
|
||||
$phpbb_permissions = $phpbb_container->get('acl.permissions');
|
||||
|
@ -607,7 +607,7 @@ class auth_admin extends \phpbb\auth\auth
|
|||
*/
|
||||
function display_role_mask(&$hold_ary)
|
||||
{
|
||||
global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $template, $user, $phpbb_root_path, $phpEx;
|
||||
global $phpbb_container;
|
||||
|
||||
if (!sizeof($hold_ary))
|
||||
|
@ -1106,7 +1106,7 @@ class auth_admin extends \phpbb\auth\auth
|
|||
*/
|
||||
function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false)
|
||||
{
|
||||
global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container;
|
||||
global $template, $phpbb_admin_path, $phpEx, $phpbb_container;
|
||||
|
||||
/* @var $phpbb_permissions \phpbb\permissions */
|
||||
$phpbb_permissions = $phpbb_container->get('acl.permissions');
|
||||
|
@ -1195,7 +1195,7 @@ class auth_admin extends \phpbb\auth\auth
|
|||
*/
|
||||
function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array)
|
||||
{
|
||||
global $user, $phpbb_container;
|
||||
global $phpbb_container;
|
||||
|
||||
/* @var $phpbb_permissions \phpbb\permissions */
|
||||
$phpbb_permissions = $phpbb_container->get('acl.permissions');
|
||||
|
|
|
@ -140,7 +140,7 @@ class bbcode
|
|||
*/
|
||||
function bbcode_cache_init()
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $config, $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_path_helper, $phpbb_container, $phpbb_filesystem;
|
||||
global $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem;
|
||||
|
||||
if (empty($this->template_filename))
|
||||
{
|
||||
|
|
|
@ -955,7 +955,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
|||
*/
|
||||
function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $global_announce_list = false)
|
||||
{
|
||||
global $config, $user;
|
||||
global $user;
|
||||
|
||||
$last_read = array();
|
||||
|
||||
|
@ -1260,7 +1260,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
|
|||
*/
|
||||
function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false)
|
||||
{
|
||||
global $db, $tracking_topics, $user, $config, $auth, $request, $phpbb_container;
|
||||
global $db, $tracking_topics, $user, $config, $request, $phpbb_container;
|
||||
|
||||
// Determine the users last forum mark time if not given.
|
||||
if ($mark_time_forum === false)
|
||||
|
@ -1318,8 +1318,6 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
|
|||
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||
{
|
||||
// Get information from cookie
|
||||
$row = false;
|
||||
|
||||
if (!isset($tracking_topics['tf'][$forum_id]))
|
||||
{
|
||||
// We do not need to mark read, this happened before. Therefore setting this to true
|
||||
|
@ -1719,9 +1717,7 @@ function generate_board_url($without_script_path = false)
|
|||
*/
|
||||
function redirect($url, $return = false, $disable_cd_check = false)
|
||||
{
|
||||
global $db, $cache, $config, $user, $phpbb_root_path, $phpbb_filesystem, $phpbb_path_helper, $phpEx, $phpbb_dispatcher;
|
||||
|
||||
$failover_flag = false;
|
||||
global $user, $phpbb_path_helper, $phpbb_dispatcher;
|
||||
|
||||
if (!$user->is_setup())
|
||||
{
|
||||
|
@ -2241,7 +2237,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
|
|||
*/
|
||||
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
|
||||
{
|
||||
global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
|
||||
global $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
|
||||
global $request, $phpbb_container, $phpbb_dispatcher, $phpbb_log;
|
||||
|
||||
$err = '';
|
||||
|
@ -3213,7 +3209,7 @@ function phpbb_checkdnsrr($host, $type = 'MX')
|
|||
function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||
{
|
||||
global $cache, $db, $auth, $template, $config, $user, $request;
|
||||
global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log;
|
||||
global $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log;
|
||||
|
||||
// Do not display notices if we suppress them via @
|
||||
if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE)
|
||||
|
@ -3545,7 +3541,7 @@ function obtain_guest_count($item_id = 0, $item = 'forum')
|
|||
*/
|
||||
function obtain_users_online($item_id = 0, $item = 'forum')
|
||||
{
|
||||
global $db, $config, $user;
|
||||
global $db, $config;
|
||||
|
||||
$reading_sql = '';
|
||||
if ($item_id !== 0)
|
||||
|
@ -3611,7 +3607,6 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
|
|||
{
|
||||
global $config, $db, $user, $auth, $phpbb_dispatcher;
|
||||
|
||||
$guests_online = $hidden_online = $l_online_users = $online_userlist = $visible_online = '';
|
||||
$user_online_link = $rowset = array();
|
||||
// Need caps version of $item for language-strings
|
||||
$item_caps = strtoupper($item);
|
||||
|
@ -4008,8 +4003,7 @@ function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config
|
|||
*/
|
||||
function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
|
||||
{
|
||||
global $user, $config, $cache, $phpbb_root_path, $phpEx;
|
||||
global $request;
|
||||
global $user, $config;
|
||||
global $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
if (!$config['allow_avatar'] && !$ignore_config)
|
||||
|
@ -4560,7 +4554,7 @@ function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \php
|
|||
*/
|
||||
function page_footer($run_cron = true, $display_template = true, $exit_handler = true)
|
||||
{
|
||||
global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx;
|
||||
global $db, $config, $template, $user, $auth, $cache, $phpEx;
|
||||
global $request, $phpbb_dispatcher, $phpbb_admin_path;
|
||||
|
||||
// A listener can set this variable to `true` when it overrides this function
|
||||
|
@ -4701,7 +4695,7 @@ function garbage_collection()
|
|||
*/
|
||||
function exit_handler()
|
||||
{
|
||||
global $phpbb_hook, $config;
|
||||
global $phpbb_hook;
|
||||
|
||||
if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__))
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
|
|||
*/
|
||||
function adm_page_header($page_title)
|
||||
{
|
||||
global $config, $db, $user, $template;
|
||||
global $config, $user, $template;
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
|
||||
global $phpbb_dispatcher;
|
||||
|
||||
|
@ -140,8 +140,8 @@ function adm_page_header($page_title)
|
|||
*/
|
||||
function adm_page_footer($copyright_html = true)
|
||||
{
|
||||
global $db, $config, $template, $user, $auth, $cache;
|
||||
global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $db, $config, $template, $user, $auth;
|
||||
global $phpbb_root_path;
|
||||
global $request, $phpbb_dispatcher;
|
||||
|
||||
// A listener can set this variable to `true` when it overrides this function
|
||||
|
@ -273,7 +273,7 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars)
|
|||
break;
|
||||
|
||||
case 'number':
|
||||
$min = $max = $maxlength = '';
|
||||
$max = $maxlength = '';
|
||||
$min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false;
|
||||
if ( isset($tpl_type[2]) )
|
||||
{
|
||||
|
@ -285,7 +285,7 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars)
|
|||
break;
|
||||
|
||||
case 'dimension':
|
||||
$min = $max = $maxlength = $size = '';
|
||||
$max = $maxlength = $size = '';
|
||||
|
||||
$min = (int) $tpl_type[1];
|
||||
|
||||
|
@ -321,8 +321,6 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars)
|
|||
case 'select':
|
||||
case 'custom':
|
||||
|
||||
$return = '';
|
||||
|
||||
if (isset($vars['method']))
|
||||
{
|
||||
$call = array($module->module, $vars['method']);
|
||||
|
@ -652,8 +650,6 @@ function validate_range($value_ary, &$error)
|
|||
foreach ($value_ary as $value)
|
||||
{
|
||||
$column = explode(':', $value['column_type']);
|
||||
$max = $min = 0;
|
||||
$type = 0;
|
||||
if (!isset($column_types[$column[0]]))
|
||||
{
|
||||
continue;
|
||||
|
|
|
@ -65,7 +65,7 @@ function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = ar
|
|||
*/
|
||||
function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $only_acl_post = false, $return_array = false)
|
||||
{
|
||||
global $db, $user, $auth;
|
||||
global $db, $auth;
|
||||
|
||||
// This query is identical to the jumpbox one
|
||||
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id
|
||||
|
@ -2009,7 +2009,6 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
|||
AND u.user_id = p.poster_id';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$post_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_id = intval($row['topic_id']);
|
||||
|
@ -2082,7 +2081,6 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
|||
AND u.user_id = p.poster_id';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$post_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_id = (int) $row['topic_id'];
|
||||
|
@ -2377,7 +2375,7 @@ function phpbb_cache_moderators($db, $cache, $auth)
|
|||
}
|
||||
|
||||
// We add moderators who have forum moderator permissions without an explicit ACL_NEVER setting
|
||||
$hold_ary = $ug_id_ary = $sql_ary = array();
|
||||
$sql_ary = array();
|
||||
|
||||
// Grab all users having moderative options...
|
||||
$hold_ary = $auth->acl_user_raw_data(false, 'm_%', false);
|
||||
|
|
|
@ -56,7 +56,6 @@ class compress
|
|||
// Clean up path, add closing / if not present
|
||||
$src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path;
|
||||
|
||||
$filelist = array();
|
||||
$filelist = filelist("$phpbb_root_path$src", '', '*');
|
||||
krsort($filelist);
|
||||
|
||||
|
|
|
@ -651,7 +651,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
|
|||
*/
|
||||
function generate_text_for_edit($text, $uid, $flags)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
|
||||
global $phpbb_dispatcher;
|
||||
|
||||
/**
|
||||
* Use this event to modify the text before it is decoded for editing
|
||||
|
@ -1056,7 +1056,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
|
|||
// Some basics...
|
||||
$attachment['extension'] = strtolower(trim($attachment['extension']));
|
||||
$filename = $phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($attachment['physical_filename']);
|
||||
$thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . utf8_basename($attachment['physical_filename']);
|
||||
|
||||
$upload_icon = '';
|
||||
|
||||
|
@ -1098,7 +1097,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
|
|||
|
||||
if (!$denied)
|
||||
{
|
||||
$l_downloaded_viewed = $download_link = '';
|
||||
$display_cat = $extensions[$attachment['extension']]['display_cat'];
|
||||
|
||||
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE)
|
||||
|
@ -1316,8 +1314,6 @@ function extension_allowed($forum_id, $extension, &$extensions)
|
|||
*/
|
||||
function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '')
|
||||
{
|
||||
$chars = array();
|
||||
|
||||
$strip_reply = false;
|
||||
$stripped = false;
|
||||
if ($allow_reply && strpos($string, 'Re: ') === 0)
|
||||
|
|
|
@ -423,7 +423,7 @@ function remote_avatar_dims()
|
|||
|
||||
function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false)
|
||||
{
|
||||
global $config, $convert, $phpbb_root_path, $user;
|
||||
global $config, $convert, $user;
|
||||
|
||||
$relative_path = empty($convert->convertor['source_path_absolute']);
|
||||
|
||||
|
@ -492,7 +492,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false
|
|||
|
||||
function import_attachment_files($category_name = '')
|
||||
{
|
||||
global $config, $convert, $phpbb_root_path, $db, $user;
|
||||
global $config, $convert, $db, $user;
|
||||
|
||||
$sql = 'SELECT config_value AS upload_path
|
||||
FROM ' . CONFIG_TABLE . "
|
||||
|
@ -590,7 +590,7 @@ function import_attachment($source, $use_target = false)
|
|||
return '';
|
||||
}
|
||||
|
||||
global $convert, $phpbb_root_path, $config, $user;
|
||||
global $convert, $config, $user;
|
||||
|
||||
// check for trailing slash
|
||||
if (rtrim($convert->convertor['upload_path'], '/') === '')
|
||||
|
@ -632,7 +632,7 @@ function import_rank($source, $use_target = false)
|
|||
return '';
|
||||
}
|
||||
|
||||
global $convert, $phpbb_root_path, $config, $user;
|
||||
global $convert, $user;
|
||||
|
||||
if (!isset($convert->convertor['ranks_path']))
|
||||
{
|
||||
|
@ -650,7 +650,7 @@ function import_smiley($source, $use_target = false)
|
|||
return '';
|
||||
}
|
||||
|
||||
global $convert, $phpbb_root_path, $config, $user;
|
||||
global $convert, $user;
|
||||
|
||||
// check for trailing slash
|
||||
if (rtrim($convert->convertor['smilies_path'], '/') === '')
|
||||
|
@ -671,7 +671,7 @@ function import_avatar($source, $use_target = false, $user_id = false)
|
|||
return;
|
||||
}
|
||||
|
||||
global $convert, $phpbb_root_path, $config, $user;
|
||||
global $convert, $config, $user;
|
||||
|
||||
// check for trailing slash
|
||||
if (rtrim($convert->convertor['avatar_path'], '/') === '')
|
||||
|
@ -684,7 +684,7 @@ function import_avatar($source, $use_target = false, $user_id = false)
|
|||
$use_target = $config['avatar_salt'] . '_' . $user_id . '.' . substr(strrchr($source, '.'), 1);
|
||||
}
|
||||
|
||||
$result = _import_check('avatar_path', $source, $use_target);
|
||||
_import_check('avatar_path', $source, $use_target);
|
||||
|
||||
return ((!empty($user_id)) ? $user_id : $use_target) . '.' . substr(strrchr($source, '.'), 1);
|
||||
}
|
||||
|
@ -750,7 +750,7 @@ function get_smiley_dim($source, $axis)
|
|||
return $smiley_cache[$source][$axis];
|
||||
}
|
||||
|
||||
global $convert, $phpbb_root_path, $config, $user;
|
||||
global $convert, $user;
|
||||
|
||||
$orig_source = $source;
|
||||
|
||||
|
@ -858,14 +858,12 @@ function get_upload_avatar_dim($source, $axis)
|
|||
return $cachedims[$axis];
|
||||
}
|
||||
|
||||
$orig_source = $source;
|
||||
|
||||
if (substr($source, 0, 7) == 'upload:')
|
||||
{
|
||||
$source = substr($source, 7);
|
||||
}
|
||||
|
||||
global $convert, $phpbb_root_path, $config, $user;
|
||||
global $convert, $user;
|
||||
|
||||
if (!isset($convert->convertor['avatar_path']))
|
||||
{
|
||||
|
@ -907,7 +905,7 @@ function get_gallery_avatar_dim($source, $axis)
|
|||
return $avatar_cache[$source][$axis];
|
||||
}
|
||||
|
||||
global $convert, $phpbb_root_path, $config, $user;
|
||||
global $convert, $user;
|
||||
|
||||
$orig_source = $source;
|
||||
|
||||
|
@ -1122,7 +1120,7 @@ function words_unique(&$words)
|
|||
*/
|
||||
function add_user_group($group_id, $user_id, $group_leader = false)
|
||||
{
|
||||
global $convert, $phpbb_root_path, $config, $user, $db;
|
||||
global $db;
|
||||
|
||||
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
||||
'group_id' => $group_id,
|
||||
|
@ -1142,7 +1140,7 @@ function add_user_group($group_id, $user_id, $group_leader = false)
|
|||
*/
|
||||
function user_group_auth($group, $select_query, $use_src_db)
|
||||
{
|
||||
global $convert, $phpbb_root_path, $config, $user, $db, $src_db, $same_db;
|
||||
global $convert, $user, $db, $src_db, $same_db;
|
||||
|
||||
if (!in_array($group, array('guests', 'registered', 'registered_coppa', 'global_moderators', 'administrators', 'bots')))
|
||||
{
|
||||
|
@ -1198,7 +1196,7 @@ function get_config()
|
|||
return $convert_config;
|
||||
}
|
||||
|
||||
global $src_db, $same_db, $phpbb_root_path, $config;
|
||||
global $src_db, $same_db;
|
||||
global $convert;
|
||||
|
||||
if ($convert->config_schema['table_format'] != 'file')
|
||||
|
@ -1277,7 +1275,7 @@ function get_config()
|
|||
*/
|
||||
function restore_config($schema)
|
||||
{
|
||||
global $db, $config;
|
||||
global $config;
|
||||
|
||||
$convert_config = get_config();
|
||||
|
||||
|
@ -1322,7 +1320,7 @@ function restore_config($schema)
|
|||
*/
|
||||
function update_folder_pm_count()
|
||||
{
|
||||
global $db, $convert, $user;
|
||||
global $db;
|
||||
|
||||
$sql = 'SELECT user_id, folder_id, COUNT(msg_id) as num_messages
|
||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
|
@ -1381,7 +1379,7 @@ function extract_variables_from_file($_filename)
|
|||
|
||||
function get_path($src_path, $src_url, $test_file)
|
||||
{
|
||||
global $config, $phpbb_root_path, $phpEx;
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
$board_config = get_config();
|
||||
|
||||
|
@ -1492,7 +1490,7 @@ function compare_table($tables, $tablename, &$prefixes)
|
|||
*/
|
||||
function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO)
|
||||
{
|
||||
global $db, $convert, $user, $config;
|
||||
global $db;
|
||||
static $acl_option_ids, $group_ids;
|
||||
|
||||
if (($ug_type == 'group' || $ug_type == 'group_role') && is_string($ug_id))
|
||||
|
@ -2039,7 +2037,7 @@ function update_dynamic_config()
|
|||
*/
|
||||
function update_topics_posted()
|
||||
{
|
||||
global $db, $config;
|
||||
global $db;
|
||||
|
||||
switch ($db->get_sql_layer())
|
||||
{
|
||||
|
@ -2180,7 +2178,7 @@ function fix_empty_primary_groups()
|
|||
*/
|
||||
function remove_invalid_users()
|
||||
{
|
||||
global $convert, $db, $phpEx, $phpbb_root_path;
|
||||
global $db, $phpEx, $phpbb_root_path;
|
||||
|
||||
// username_clean is UNIQUE
|
||||
$sql = 'SELECT user_id
|
||||
|
@ -2316,7 +2314,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
|
|||
|
||||
function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
|
||||
{
|
||||
global $convert, $phpbb_root_path, $config, $user, $db, $phpbb_filesystem;
|
||||
global $convert, $phpbb_root_path, $user, $phpbb_filesystem;
|
||||
|
||||
/** @var \phpbb\filesystem\filesystem_interface $filesystem */
|
||||
$filesystem = $phpbb_filesystem;
|
||||
|
@ -2373,7 +2371,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
|
|||
|
||||
function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
|
||||
{
|
||||
global $convert, $phpbb_root_path, $config, $user, $db, $phpbb_filesystem;
|
||||
global $convert, $phpbb_root_path, $config, $user, $phpbb_filesystem;
|
||||
|
||||
/** @var \phpbb\filesystem\filesystem_interface $filesystem */
|
||||
$filesystem = $phpbb_filesystem;
|
||||
|
@ -2485,7 +2483,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
|
|||
|
||||
function relative_base($path, $is_relative = true, $line = false, $file = false)
|
||||
{
|
||||
global $convert, $phpbb_root_path, $config, $user, $db;
|
||||
global $convert, $user;
|
||||
|
||||
if (!$is_relative)
|
||||
{
|
||||
|
|
|
@ -30,7 +30,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
|
||||
$forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
|
||||
$parent_id = $visible_forums = 0;
|
||||
$sql_from = '';
|
||||
|
||||
// Mark forums read?
|
||||
$mark_read = $request->variable('mark', '');
|
||||
|
@ -732,7 +731,7 @@ function generate_forum_rules(&$forum_data)
|
|||
return;
|
||||
}
|
||||
|
||||
global $template, $phpbb_root_path, $phpEx;
|
||||
global $template;
|
||||
|
||||
if ($forum_data['forum_rules'])
|
||||
{
|
||||
|
@ -752,7 +751,7 @@ function generate_forum_rules(&$forum_data)
|
|||
*/
|
||||
function generate_forum_nav(&$forum_data_ary)
|
||||
{
|
||||
global $db, $user, $template, $auth, $config;
|
||||
global $template, $auth, $config;
|
||||
global $phpEx, $phpbb_root_path, $phpbb_dispatcher;
|
||||
|
||||
if (!$auth->acl_get('f_list', $forum_data_ary['forum_id']))
|
||||
|
@ -760,7 +759,7 @@ function generate_forum_nav(&$forum_data_ary)
|
|||
return;
|
||||
}
|
||||
|
||||
$navlinks = $navlinks_parents = $forum_template_data = array();
|
||||
$navlinks_parents = $forum_template_data = array();
|
||||
|
||||
// Get forum parents
|
||||
$forum_parents = get_forum_parents($forum_data_ary);
|
||||
|
@ -887,7 +886,7 @@ function get_forum_parents(&$forum_data)
|
|||
*/
|
||||
function get_moderators(&$forum_moderators, $forum_id = false)
|
||||
{
|
||||
global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth;
|
||||
global $db, $phpbb_root_path, $phpEx, $user, $auth;
|
||||
global $phpbb_container;
|
||||
|
||||
$forum_id_ary = array();
|
||||
|
@ -1003,8 +1002,6 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
|
|||
{
|
||||
global $user, $config;
|
||||
|
||||
$folder = $folder_new = '';
|
||||
|
||||
if ($topic_row['topic_status'] == ITEM_MOVED)
|
||||
{
|
||||
$topic_type = $user->lang['VIEW_TOPIC_MOVED'];
|
||||
|
@ -1295,7 +1292,7 @@ function display_user_activity(&$userdata_ary)
|
|||
*/
|
||||
function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '')
|
||||
{
|
||||
global $template, $db, $user, $phpEx, $start, $phpbb_root_path;
|
||||
global $db, $user, $phpEx, $start, $phpbb_root_path;
|
||||
global $request;
|
||||
|
||||
$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
|
||||
|
|
|
@ -123,7 +123,7 @@ function wrap_img_in_html($src, $title)
|
|||
*/
|
||||
function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
{
|
||||
global $user, $db, $config, $phpbb_root_path, $request;
|
||||
global $user, $db, $phpbb_root_path, $request;
|
||||
|
||||
$filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ class messenger
|
|||
*/
|
||||
function template($template_file, $template_lang = '', $template_path = '')
|
||||
{
|
||||
global $config, $phpbb_root_path, $phpEx, $user, $phpbb_extension_manager;
|
||||
global $config, $phpbb_root_path, $user;
|
||||
|
||||
$this->setup_template();
|
||||
|
||||
|
@ -349,7 +349,7 @@ class messenger
|
|||
*/
|
||||
function error($type, $msg)
|
||||
{
|
||||
global $user, $phpEx, $phpbb_root_path, $config, $request, $phpbb_log;
|
||||
global $user, $config, $request, $phpbb_log;
|
||||
|
||||
// Session doesn't exist, create it
|
||||
if (!isset($user->session_id) || $user->session_id === '')
|
||||
|
@ -359,7 +359,6 @@ class messenger
|
|||
|
||||
$calling_page = htmlspecialchars_decode($request->server('PHP_SELF'));
|
||||
|
||||
$message = '';
|
||||
switch ($type)
|
||||
{
|
||||
case 'EMAIL':
|
||||
|
@ -453,7 +452,7 @@ class messenger
|
|||
*/
|
||||
function msg_email()
|
||||
{
|
||||
global $config, $user;
|
||||
global $config;
|
||||
|
||||
if (empty($config['email_enable']))
|
||||
{
|
||||
|
@ -551,7 +550,7 @@ class messenger
|
|||
*/
|
||||
function msg_jabber()
|
||||
{
|
||||
global $config, $db, $user, $phpbb_root_path, $phpEx;
|
||||
global $config, $user, $phpbb_root_path, $phpEx;
|
||||
|
||||
if (empty($config['jab_enable']) || empty($config['jab_host']) || empty($config['jab_username']) || empty($config['jab_password']))
|
||||
{
|
||||
|
@ -623,7 +622,7 @@ class messenger
|
|||
*/
|
||||
protected function setup_template()
|
||||
{
|
||||
global $config, $phpbb_path_helper, $user, $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem;
|
||||
global $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem;
|
||||
|
||||
if ($this->template instanceof \phpbb\template\template)
|
||||
{
|
||||
|
@ -715,7 +714,7 @@ class queue
|
|||
*/
|
||||
function process()
|
||||
{
|
||||
global $db, $config, $phpEx, $phpbb_root_path, $user;
|
||||
global $config, $phpEx, $phpbb_root_path, $user;
|
||||
|
||||
$lock = new \phpbb\lock\flock($this->cache_file);
|
||||
$lock->acquire();
|
||||
|
@ -1258,8 +1257,6 @@ class smtp_class
|
|||
{
|
||||
global $user;
|
||||
|
||||
$err_msg = '';
|
||||
|
||||
// Here we try to determine the *real* hostname (reverse DNS entry preferrably)
|
||||
$local_host = $user->host;
|
||||
|
||||
|
@ -1294,7 +1291,7 @@ class smtp_class
|
|||
$this->server_send("QUIT");
|
||||
fclose($this->socket);
|
||||
|
||||
$result = $this->pop_before_smtp($hostname, $username, $password);
|
||||
$this->pop_before_smtp($hostname, $username, $password);
|
||||
$username = $password = $default_auth_method = '';
|
||||
|
||||
// We need to close the previous session, else the server is not
|
||||
|
@ -1736,7 +1733,7 @@ function mail_encode($str, $eol = "\r\n")
|
|||
*/
|
||||
function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
|
||||
{
|
||||
global $config, $phpbb_root_path, $phpEx;
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
// We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used...
|
||||
// Reference: http://bugs.php.net/bug.php?id=15841
|
||||
|
|
|
@ -82,8 +82,8 @@ class p_master
|
|||
*/
|
||||
function list_modules($p_class)
|
||||
{
|
||||
global $auth, $db, $user, $cache;
|
||||
global $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
|
||||
global $db, $user, $cache;
|
||||
global $phpbb_dispatcher;
|
||||
|
||||
// Sanitise for future path use, it's escaped as appropriate for queries
|
||||
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
|
||||
|
@ -729,8 +729,6 @@ class p_master
|
|||
*/
|
||||
function get_parents($parent_id, $left_id, $right_id, &$all_parents)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$parents = array();
|
||||
|
||||
if ($parent_id > 0)
|
||||
|
@ -822,7 +820,7 @@ class p_master
|
|||
// Make sure the module_url has a question mark set, effectively determining the delimiter to use
|
||||
$delim = (strpos($module_url, '?') === false) ? '?' : '&';
|
||||
|
||||
$current_padding = $current_depth = 0;
|
||||
$current_depth = 0;
|
||||
$linear_offset = 'l_block1';
|
||||
$tabular_offset = 't_block2';
|
||||
|
||||
|
|
|
@ -333,7 +333,7 @@ function posting_gen_topic_icons($mode, $icon_id)
|
|||
*/
|
||||
function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
|
||||
{
|
||||
global $auth, $user, $template, $topic_type;
|
||||
global $auth, $user, $template;
|
||||
|
||||
$toggle = false;
|
||||
|
||||
|
@ -833,7 +833,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
|
|||
foreach ($draft_rows as $draft)
|
||||
{
|
||||
$link_topic = $link_forum = $link_pm = false;
|
||||
$insert_url = $view_url = $title = '';
|
||||
$view_url = $title = '';
|
||||
|
||||
if (isset($topic_rows[$draft['topic_id']])
|
||||
&& (
|
||||
|
@ -886,7 +886,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
|
|||
*/
|
||||
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
|
||||
{
|
||||
global $user, $auth, $db, $template, $cache;
|
||||
global $user, $auth, $db, $template;
|
||||
global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
/* @var $phpbb_content_visibility \phpbb\content_visibility */
|
||||
|
@ -959,11 +959,9 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
|||
$db->sql_freeresult($result);
|
||||
|
||||
// Grab extensions
|
||||
$extensions = $attachments = array();
|
||||
$attachments = array();
|
||||
if ($has_attachments && $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id))
|
||||
{
|
||||
$extensions = $cache->obtain_attach_extensions($forum_id);
|
||||
|
||||
// Get attachments...
|
||||
$sql = 'SELECT *
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
|
@ -1101,7 +1099,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
|||
*/
|
||||
function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $softdelete_reason = '')
|
||||
{
|
||||
global $db, $user, $auth, $phpbb_container;
|
||||
global $db, $user, $phpbb_container;
|
||||
global $config, $phpEx, $phpbb_root_path;
|
||||
|
||||
// Specify our post mode
|
||||
|
@ -1190,7 +1188,6 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
|
|||
|
||||
if ($is_soft)
|
||||
{
|
||||
$topic_row = array();
|
||||
$phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $forum_id, $user->data['user_id'], time(), $softdelete_reason);
|
||||
}
|
||||
else
|
||||
|
@ -1362,7 +1359,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
|
|||
*/
|
||||
function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data_ary, $update_message = true, $update_search_index = true)
|
||||
{
|
||||
global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request;
|
||||
global $db, $auth, $user, $config, $phpEx, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request;
|
||||
|
||||
$poll = $poll_ary;
|
||||
$data = $data_ary;
|
||||
|
@ -1589,7 +1586,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
|
|||
|
||||
break;
|
||||
}
|
||||
$topic_row = array();
|
||||
|
||||
// And the topic ladies and gentlemen
|
||||
switch ($post_mode)
|
||||
|
|
|
@ -226,7 +226,7 @@ function get_folder($user_id, $folder_id = false)
|
|||
*/
|
||||
function clean_sentbox($num_sentbox_messages)
|
||||
{
|
||||
global $db, $user, $config;
|
||||
global $db, $user;
|
||||
|
||||
// Check Message Limit
|
||||
if ($user->data['message_limit'] && $num_sentbox_messages > $user->data['message_limit'])
|
||||
|
@ -255,8 +255,6 @@ function clean_sentbox($num_sentbox_messages)
|
|||
*/
|
||||
function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
|
||||
{
|
||||
global $user, $config;
|
||||
|
||||
if (!isset($rules[$rule_row['rule_check']][$rule_row['rule_connection']]))
|
||||
{
|
||||
return false;
|
||||
|
@ -335,7 +333,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
|
|||
break;
|
||||
|
||||
case ACTION_DELETE_MESSAGE:
|
||||
global $db, $auth;
|
||||
global $db;
|
||||
|
||||
// Check for admins/mods - users are not allowed to remove those messages...
|
||||
// We do the check here to make sure the data we use is consistent
|
||||
|
@ -546,7 +544,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
|
|||
}
|
||||
|
||||
// We place actions into arrays, to save queries.
|
||||
$sql = $unread_ids = $delete_ids = $important_ids = array();
|
||||
$unread_ids = $delete_ids = $important_ids = array();
|
||||
|
||||
foreach ($action_ary as $msg_id => $msg_ary)
|
||||
{
|
||||
|
@ -942,7 +940,6 @@ function handle_mark_actions($user_id, $mark_action)
|
|||
|
||||
$msg_ids = $request->variable('marked_msg_id', array(0));
|
||||
$cur_folder_id = $request->variable('cur_folder_id', PRIVMSGS_NO_BOX);
|
||||
$confirm = (isset($_POST['confirm'])) ? true : false;
|
||||
|
||||
if (!sizeof($msg_ids))
|
||||
{
|
||||
|
@ -1007,7 +1004,7 @@ function handle_mark_actions($user_id, $mark_action)
|
|||
*/
|
||||
function delete_pm($user_id, $msg_ids, $folder_id)
|
||||
{
|
||||
global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
|
||||
global $db, $user, $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
$user_id = (int) $user_id;
|
||||
$folder_id = (int) $folder_id;
|
||||
|
@ -1177,8 +1174,6 @@ function delete_pm($user_id, $msg_ids, $folder_id)
|
|||
*/
|
||||
function phpbb_delete_user_pms($user_id)
|
||||
{
|
||||
global $db, $user, $phpbb_root_path, $phpEx;
|
||||
|
||||
$user_id = (int) $user_id;
|
||||
|
||||
if (!$user_id)
|
||||
|
@ -1198,7 +1193,7 @@ function phpbb_delete_user_pms($user_id)
|
|||
*/
|
||||
function phpbb_delete_users_pms($user_ids)
|
||||
{
|
||||
global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container;
|
||||
global $db, $phpbb_container;
|
||||
|
||||
$user_id_sql = $db->sql_in_set('user_id', $user_ids);
|
||||
$author_id_sql = $db->sql_in_set('author_id', $user_ids);
|
||||
|
@ -1396,8 +1391,6 @@ function phpbb_delete_users_pms($user_ids)
|
|||
*/
|
||||
function rebuild_header($check_ary)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$address = array();
|
||||
|
||||
foreach ($check_ary as $check_type => $address_field)
|
||||
|
@ -1577,7 +1570,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false)
|
|||
*/
|
||||
function get_folder_status($folder_id, $folder)
|
||||
{
|
||||
global $db, $user, $config;
|
||||
global $user;
|
||||
|
||||
if (isset($folder[$folder_id]))
|
||||
{
|
||||
|
@ -1610,7 +1603,7 @@ function get_folder_status($folder_id, $folder)
|
|||
*/
|
||||
function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true)
|
||||
{
|
||||
global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $request;
|
||||
global $db, $auth, $config, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $request;
|
||||
|
||||
// We do not handle erasing pms here
|
||||
if ($mode == 'delete')
|
||||
|
@ -1764,8 +1757,6 @@ function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true)
|
|||
|
||||
if (sizeof($sql_data))
|
||||
{
|
||||
$query = '';
|
||||
|
||||
if ($mode == 'post' || $mode == 'reply' || $mode == 'quote' || $mode == 'quotepost' || $mode == 'forward')
|
||||
{
|
||||
$db->sql_query('INSERT INTO ' . PRIVMSGS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data));
|
||||
|
@ -1966,7 +1957,7 @@ function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true)
|
|||
*/
|
||||
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
|
||||
{
|
||||
global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth;
|
||||
global $db, $user, $template, $phpbb_root_path, $phpEx, $auth;
|
||||
|
||||
// Select all receipts and the author from the pm we currently view, to only display their pm-history
|
||||
$sql = 'SELECT author_id, user_id
|
||||
|
|
|
@ -406,9 +406,6 @@ class ftp extends transfer
|
|||
*/
|
||||
function _put($from_file, $to_file)
|
||||
{
|
||||
// get the file extension
|
||||
$file_extension = strtolower(substr(strrchr($to_file, '.'), 1));
|
||||
|
||||
// We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced)
|
||||
$mode = FTP_BINARY;
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ function user_update_name($old_name, $new_name)
|
|||
*/
|
||||
function user_add($user_row, $cp_data = false, $notifications_data = null)
|
||||
{
|
||||
global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;
|
||||
global $db, $config;
|
||||
global $phpbb_dispatcher, $phpbb_container;
|
||||
|
||||
if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))
|
||||
|
@ -866,7 +866,7 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
|
|||
*/
|
||||
function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason = '')
|
||||
{
|
||||
global $db, $user, $auth, $cache, $phpbb_log;
|
||||
global $db, $user, $cache, $phpbb_log;
|
||||
|
||||
// Delete stale bans
|
||||
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
|
||||
|
@ -1015,7 +1015,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
|||
if ($ip_2_counter == 0 && $ip_2_end == 254)
|
||||
{
|
||||
$ip_2_counter = 256;
|
||||
$ip_2_fragment = 256;
|
||||
|
||||
$banlist_ary[] = "$ip_1_counter.*";
|
||||
}
|
||||
|
@ -1028,7 +1027,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
|||
if ($ip_3_counter == 0 && $ip_3_end == 254)
|
||||
{
|
||||
$ip_3_counter = 256;
|
||||
$ip_3_fragment = 256;
|
||||
|
||||
$banlist_ary[] = "$ip_1_counter.$ip_2_counter.*";
|
||||
}
|
||||
|
@ -1041,7 +1039,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
|||
if ($ip_4_counter == 0 && $ip_4_end == 254)
|
||||
{
|
||||
$ip_4_counter = 256;
|
||||
$ip_4_fragment = 256;
|
||||
|
||||
$banlist_ary[] = "$ip_1_counter.$ip_2_counter.$ip_3_counter.*";
|
||||
}
|
||||
|
@ -1292,7 +1289,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
|||
*/
|
||||
function user_unban($mode, $ban)
|
||||
{
|
||||
global $db, $user, $auth, $cache, $phpbb_log;
|
||||
global $db, $user, $cache, $phpbb_log;
|
||||
|
||||
// Delete stale bans
|
||||
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
|
||||
|
@ -2141,7 +2138,7 @@ function phpbb_style_is_active($style_id)
|
|||
*/
|
||||
function avatar_delete($mode, $row, $clean_db = false)
|
||||
{
|
||||
global $phpbb_root_path, $config, $db, $user;
|
||||
global $phpbb_root_path, $config;
|
||||
|
||||
// Check if the users avatar is actually *not* a group avatar
|
||||
if ($mode == 'user')
|
||||
|
@ -2213,7 +2210,7 @@ function phpbb_avatar_explanation_string()
|
|||
*/
|
||||
function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
|
||||
{
|
||||
global $phpbb_root_path, $config, $db, $user, $file_upload, $phpbb_container, $phpbb_log;
|
||||
global $db, $user, $phpbb_container, $phpbb_log;
|
||||
|
||||
/** @var \phpbb\group\helper $group_helper */
|
||||
$group_helper = $phpbb_container->get('group_helper');
|
||||
|
@ -2325,8 +2322,6 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
|||
// Setting the log message before we set the group id (if group gets added)
|
||||
$log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED';
|
||||
|
||||
$query = '';
|
||||
|
||||
if ($group_id)
|
||||
{
|
||||
$sql = 'SELECT user_id
|
||||
|
@ -2508,7 +2503,7 @@ function group_correct_avatar($group_id, $old_entry)
|
|||
*/
|
||||
function avatar_remove_db($avatar_name)
|
||||
{
|
||||
global $config, $db;
|
||||
global $db;
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||
SET user_avatar = '',
|
||||
|
@ -3012,7 +3007,7 @@ function remove_default_rank($group_id, $user_ids)
|
|||
*/
|
||||
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
|
||||
{
|
||||
global $db, $auth, $user, $phpbb_root_path, $phpEx, $config, $phpbb_container, $phpbb_log;
|
||||
global $db, $auth, $user, $phpbb_container, $phpbb_log;
|
||||
|
||||
// We need both username and user_id info
|
||||
$result = user_get_id_name($user_id_ary, $username_ary);
|
||||
|
@ -3159,7 +3154,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
|||
*/
|
||||
function group_validate_groupname($group_id, $group_name)
|
||||
{
|
||||
global $config, $db;
|
||||
global $db;
|
||||
|
||||
$group_name = utf8_clean_string($group_name);
|
||||
|
||||
|
@ -3356,7 +3351,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
|
|||
*/
|
||||
function get_group_name($group_id)
|
||||
{
|
||||
global $db, $user, $phpbb_container;
|
||||
global $db, $phpbb_container;
|
||||
|
||||
$sql = 'SELECT group_name, group_type
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 . '
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ';
|
||||
|
|
|
@ -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&mode=report_details&f=' . $topic_info['forum_id'] . '&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))
|
||||
{
|
||||
|
|
|
@ -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&form=mcp&field=username&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)
|
||||
{
|
||||
|
|
|
@ -798,8 +798,6 @@ class bbcode_firstpass extends bbcode
|
|||
*/
|
||||
function bbcode_quote($in)
|
||||
{
|
||||
global $config, $user;
|
||||
|
||||
$in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in)));
|
||||
|
||||
if (!$in)
|
||||
|
@ -1009,8 +1007,6 @@ class bbcode_firstpass extends bbcode
|
|||
*/
|
||||
function validate_url($var1, $var2)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$var1 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var1)));
|
||||
$var2 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var2)));
|
||||
|
||||
|
@ -1155,7 +1151,7 @@ class parse_message extends bbcode_firstpass
|
|||
*/
|
||||
function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post')
|
||||
{
|
||||
global $config, $db, $user, $phpbb_dispatcher, $phpbb_container;
|
||||
global $config, $user, $phpbb_dispatcher, $phpbb_container;
|
||||
|
||||
$this->mode = $mode;
|
||||
|
||||
|
@ -1770,7 +1766,7 @@ class parse_message extends bbcode_firstpass
|
|||
*/
|
||||
function get_submitted_attachment_data($check_user_id = false)
|
||||
{
|
||||
global $user, $db, $phpbb_root_path, $phpEx, $config;
|
||||
global $user, $db;
|
||||
global $request;
|
||||
|
||||
$this->filename_data['filecomment'] = $request->variable('filecomment', '', true);
|
||||
|
@ -1858,7 +1854,7 @@ class parse_message extends bbcode_firstpass
|
|||
*/
|
||||
function parse_poll(&$poll)
|
||||
{
|
||||
global $auth, $user, $config;
|
||||
global $user, $config;
|
||||
|
||||
$poll_max_options = $poll['poll_max_options'];
|
||||
|
||||
|
|
|
@ -257,7 +257,7 @@ class phpbb_questionnaire_phpbb_data_provider
|
|||
*/
|
||||
function get_data()
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $phpbb_config_php_file;
|
||||
global $phpbb_config_php_file;
|
||||
|
||||
extract($phpbb_config_php_file->get_all());
|
||||
unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution
|
||||
|
|
|
@ -1659,7 +1659,6 @@ class SphinxClient
|
|||
return false;
|
||||
}
|
||||
|
||||
$res = substr ( $response, 4 ); // just ignore length, error handling, etc
|
||||
$p = 0;
|
||||
list ( $rows, $cols ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class ucp_activate
|
|||
function main($id, $mode)
|
||||
{
|
||||
global $config, $phpbb_root_path, $phpEx, $request;
|
||||
global $db, $user, $auth, $template, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
|
||||
global $db, $user, $auth, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
|
||||
|
||||
$user_id = $request->variable('u', 0);
|
||||
$key = $request->variable('k', '');
|
||||
|
|
|
@ -36,7 +36,6 @@ class ucp_attachments
|
|||
$sort_dir = $request->variable('sd', 'a');
|
||||
|
||||
$delete = (isset($_POST['delete'])) ? true : false;
|
||||
$confirm = (isset($_POST['confirm'])) ? true : false;
|
||||
$delete_ids = array_keys($request->variable('attachment', array(0)));
|
||||
|
||||
if ($delete && sizeof($delete_ids))
|
||||
|
|
|
@ -36,7 +36,7 @@ class ucp_confirm
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container, $request;
|
||||
global $config, $phpbb_container, $request;
|
||||
|
||||
$captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
|
||||
$captcha->init($request->variable('type', 0));
|
||||
|
|
|
@ -38,8 +38,6 @@ class ucp_groups
|
|||
|
||||
$mark_ary = $request->variable('mark', array(0));
|
||||
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
|
||||
$delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST);
|
||||
$error = $data = array();
|
||||
|
||||
/** @var \phpbb\group\helper $group_helper */
|
||||
$group_helper = $phpbb_container->get('group_helper');
|
||||
|
@ -462,11 +460,8 @@ class ucp_groups
|
|||
trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page);
|
||||
}
|
||||
|
||||
$file_uploads = (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false;
|
||||
$user->add_lang(array('acp/groups', 'acp/common'));
|
||||
|
||||
$data = $submit_ary = array();
|
||||
|
||||
$update = (isset($_POST['update'])) ? true : false;
|
||||
|
||||
$error = array();
|
||||
|
@ -535,7 +530,6 @@ class ucp_groups
|
|||
{
|
||||
// Handle avatar
|
||||
$driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', ''));
|
||||
$config_name = preg_replace('#^avatar\.driver.#', '', $driver_name);
|
||||
|
||||
if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
|
||||
{
|
||||
|
@ -624,7 +618,6 @@ class ucp_groups
|
|||
}
|
||||
else if (!$group_id)
|
||||
{
|
||||
$group_name = $request->variable('group_name', '', true);
|
||||
$group_desc_data = array(
|
||||
'text' => '',
|
||||
'allow_bbcode' => true,
|
||||
|
|
|
@ -99,7 +99,7 @@ class ucp_login_link
|
|||
else
|
||||
{
|
||||
// Finish login
|
||||
$result = $user->session_create($login_result['user_row']['user_id'], false, false, true);
|
||||
$user->session_create($login_result['user_row']['user_id'], false, false, true);
|
||||
|
||||
// Perform a redirect as the account has been linked
|
||||
$this->perform_redirect();
|
||||
|
@ -182,7 +182,7 @@ class ucp_login_link
|
|||
*/
|
||||
protected function process_login_result($result)
|
||||
{
|
||||
global $config, $request, $template, $user, $phpbb_container;
|
||||
global $config, $template, $user, $phpbb_container;
|
||||
|
||||
$login_error = null;
|
||||
|
||||
|
|
|
@ -221,7 +221,6 @@ class ucp_main
|
|||
{
|
||||
$forums = array_keys($request->variable('f', array(0 => 0)));
|
||||
$topics = array_keys($request->variable('t', array(0 => 0)));
|
||||
$msg = '';
|
||||
|
||||
if (sizeof($forums) || sizeof($topics))
|
||||
{
|
||||
|
|
|
@ -598,7 +598,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
|||
$enable_urls = true;
|
||||
}
|
||||
|
||||
$enable_magic_url = $drafts = false;
|
||||
$drafts = false;
|
||||
|
||||
// User own some drafts?
|
||||
if ($auth->acl_get('u_savedrafts') && $action != 'delete')
|
||||
|
@ -739,16 +739,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
|||
$enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1;
|
||||
$enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false);
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$status_switch = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1);
|
||||
$status_switch = ($status_switch != $check_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$status_switch = 1;
|
||||
}
|
||||
|
||||
// Parse Attachments - before checksum is calculated
|
||||
$message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true);
|
||||
|
||||
|
@ -1062,7 +1052,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
|||
}
|
||||
|
||||
// Now Build the address list
|
||||
$plain_address_field = '';
|
||||
foreach ($address_list as $type => $adr_ary)
|
||||
{
|
||||
foreach ($adr_ary as $id => $field)
|
||||
|
|
|
@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
|
|||
*/
|
||||
function message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db, $request;
|
||||
global $phpbb_root_path, $phpEx, $user, $template, $config, $db, $request;
|
||||
|
||||
$redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=options");
|
||||
|
||||
|
@ -80,7 +80,6 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
|||
if (check_form_key('ucp_pm_options'))
|
||||
{
|
||||
$folder_name = $request->variable('foldername', '', true);
|
||||
$msg = '';
|
||||
|
||||
if ($folder_name)
|
||||
{
|
||||
|
@ -611,7 +610,7 @@ function define_check_option($hardcoded, $check_option, $check_lang)
|
|||
*/
|
||||
function define_action_option($hardcoded, $action_option, $action_lang, $folder)
|
||||
{
|
||||
global $db, $template, $user;
|
||||
global $template;
|
||||
|
||||
$l_action = $s_action_options = '';
|
||||
if ($hardcoded)
|
||||
|
@ -722,7 +721,6 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
|
|||
|
||||
// Define Condition
|
||||
$condition = $global_rule_conditions[$rule_option];
|
||||
$current_value = '';
|
||||
|
||||
switch ($condition)
|
||||
{
|
||||
|
|
|
@ -41,9 +41,6 @@ function view_folder($id, $mode, $folder_id, $folder)
|
|||
|
||||
$color_rows = array('marked', 'replied');
|
||||
|
||||
// only show the friend/foe color rows if the module is enabled
|
||||
$zebra_enabled = false;
|
||||
|
||||
$_module = new p_master();
|
||||
$_module->list_modules('ucp');
|
||||
$_module->set_active('zebra');
|
||||
|
|
|
@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
|
|||
*/
|
||||
function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
{
|
||||
global $user, $template, $auth, $db, $cache, $phpbb_container;
|
||||
global $user, $template, $auth, $db, $phpbb_container;
|
||||
global $phpbb_root_path, $request, $phpEx, $config, $phpbb_dispatcher;
|
||||
|
||||
$user->add_lang(array('viewtopic', 'memberlist'));
|
||||
|
@ -50,9 +50,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
|||
trigger_error('NO_AUTH_READ_HOLD_MESSAGE');
|
||||
}
|
||||
|
||||
// Grab icons
|
||||
$icons = $cache->obtain_icons();
|
||||
|
||||
// Load the custom profile fields
|
||||
if ($config['load_cpf_pm'])
|
||||
{
|
||||
|
@ -357,7 +354,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
|||
*/
|
||||
function get_user_information($user_id, $user_row)
|
||||
{
|
||||
global $db, $auth, $user, $cache;
|
||||
global $db, $auth, $user;
|
||||
global $phpbb_root_path, $phpEx, $config;
|
||||
|
||||
if (!$user_id)
|
||||
|
|
|
@ -29,7 +29,7 @@ class ucp_prefs
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $request;
|
||||
global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $request;
|
||||
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
$error = $data = array();
|
||||
|
|
|
@ -31,13 +31,12 @@ class ucp_profile
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
||||
global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
|
||||
|
||||
$user->add_lang('posting');
|
||||
|
||||
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
|
||||
$delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST);
|
||||
$error = $data = array();
|
||||
$s_hidden_fields = '';
|
||||
|
||||
|
@ -430,7 +429,6 @@ class ucp_profile
|
|||
$selected = ($i == $data['bday_month']) ? ' selected="selected"' : '';
|
||||
$s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>";
|
||||
}
|
||||
$s_birthday_year_options = '';
|
||||
|
||||
$now = getdate();
|
||||
$s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>';
|
||||
|
|
|
@ -29,7 +29,7 @@ class ucp_register
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
|
||||
global $config, $db, $user, $template, $phpbb_root_path, $phpEx;
|
||||
global $request, $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
//
|
||||
|
@ -484,7 +484,6 @@ class ucp_register
|
|||
$s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields());
|
||||
}
|
||||
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
|
||||
$confirm_image = '';
|
||||
|
||||
// Visual Confirmation - Show images
|
||||
if ($config['enable_confirm'])
|
||||
|
@ -507,7 +506,9 @@ class ucp_register
|
|||
break;
|
||||
}
|
||||
|
||||
$timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true);
|
||||
// Assign template vars for timezone select
|
||||
phpbb_timezone_select($template, $user, $data['tz'], true);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'USERNAME' => $data['username'],
|
||||
|
|
|
@ -30,7 +30,7 @@ class ucp_remind
|
|||
function main($id, $mode)
|
||||
{
|
||||
global $config, $phpbb_root_path, $phpEx, $request;
|
||||
global $db, $user, $auth, $template, $phpbb_container;
|
||||
global $db, $user, $template, $phpbb_container;
|
||||
|
||||
if (!$config['allow_password_reset'])
|
||||
{
|
||||
|
|
|
@ -25,7 +25,7 @@ class ucp_zebra
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher;
|
||||
global $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher;
|
||||
|
||||
$submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
|
||||
$s_hidden_fields = '';
|
||||
|
|
|
@ -1153,7 +1153,6 @@ function utf8_case_fold_nfkc($text, $option = 'full')
|
|||
"\xF0\x9D\x9E\xBB" => "\xCF\x83",
|
||||
"\xF0\x9D\x9F\x8A" => "\xCF\x9D",
|
||||
);
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
// do the case fold
|
||||
$text = utf8_case_fold($text, $option);
|
||||
|
@ -1244,7 +1243,6 @@ function utf8_case_fold_nfc($text, $option = 'full')
|
|||
"\xE1\xBF\xB7" => "\xE1\xBF\xB6\xCD\x85",
|
||||
"\xE1\xBF\xBC" => "\xCE\xA9\xCD\x85",
|
||||
);
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
// perform a small trick, avoid further normalization on composed points that contain U+0345 in their decomposition
|
||||
$text = strtr($text, $ypogegrammeni);
|
||||
|
|
|
@ -54,7 +54,7 @@ function phpbb_forum_flags()
|
|||
*/
|
||||
function phpbb_insert_forums()
|
||||
{
|
||||
global $db, $src_db, $same_db, $convert, $user, $config;
|
||||
global $db, $src_db, $same_db, $convert, $user;
|
||||
|
||||
$db->sql_query($convert->truncate_statement . FORUMS_TABLE);
|
||||
|
||||
|
@ -179,7 +179,6 @@ function phpbb_insert_forums()
|
|||
$db->sql_query($sql);
|
||||
|
||||
$cats_added[$unknown_cat_id] = $max_forum_id;
|
||||
$max_forum_id++;
|
||||
}
|
||||
|
||||
// Now insert the forums
|
||||
|
@ -422,8 +421,6 @@ function phpbb_set_encoding($text, $grab_user_lang = true)
|
|||
}
|
||||
}
|
||||
|
||||
$encoding = $lang_enc_array[$get_lang];
|
||||
|
||||
return utf8_recode($text, $lang_enc_array[$get_lang]);
|
||||
}
|
||||
|
||||
|
@ -564,7 +561,7 @@ function phpbb_copy_table_fields()
|
|||
*/
|
||||
function phpbb_convert_authentication($mode)
|
||||
{
|
||||
global $db, $src_db, $same_db, $convert, $user, $config, $cache;
|
||||
global $db, $src_db, $same_db, $convert, $config;
|
||||
|
||||
if ($mode == 'start')
|
||||
{
|
||||
|
@ -1221,7 +1218,7 @@ function phpbb_replace_size($matches)
|
|||
*/
|
||||
function phpbb_prepare_message($message)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $db, $convert, $user, $config, $cache, $convert_row, $message_parser;
|
||||
global $convert, $user, $convert_row, $message_parser;
|
||||
|
||||
if (!$message)
|
||||
{
|
||||
|
@ -1251,9 +1248,6 @@ function phpbb_prepare_message($message)
|
|||
$message = str_replace('\"', '"', $message);
|
||||
}
|
||||
|
||||
// Already the new user id ;)
|
||||
$user_id = $convert->row['poster_id'];
|
||||
|
||||
$message = str_replace('<br />', "\n", $message);
|
||||
$message = str_replace('<', '<', $message);
|
||||
$message = str_replace('>', '>', $message);
|
||||
|
@ -1305,7 +1299,7 @@ function get_bbcode_bitfield()
|
|||
*/
|
||||
function phpbb_post_edit_user()
|
||||
{
|
||||
global $convert_row, $config;
|
||||
global $convert_row;
|
||||
|
||||
if (isset($convert_row['post_edit_count']))
|
||||
{
|
||||
|
@ -1326,7 +1320,7 @@ function phpbb_get_files_dir()
|
|||
return;
|
||||
}
|
||||
|
||||
global $src_db, $same_db, $convert, $user, $config, $cache;
|
||||
global $src_db, $same_db, $convert, $user;
|
||||
|
||||
if ($convert->mysql_convert && $same_db)
|
||||
{
|
||||
|
@ -1365,7 +1359,7 @@ function phpbb_get_files_dir()
|
|||
*/
|
||||
function phpbb_copy_thumbnails()
|
||||
{
|
||||
global $db, $convert, $user, $config, $cache, $phpbb_root_path;
|
||||
global $convert, $config, $phpbb_root_path;
|
||||
|
||||
$src_path = $convert->options['forum_path'] . '/' . phpbb_get_files_dir() . '/thumbs/';
|
||||
|
||||
|
@ -1611,8 +1605,6 @@ function phpbb_get_avatar_width($user_avatar)
|
|||
*/
|
||||
function phpbb_privmsgs_to_userid($to_userid)
|
||||
{
|
||||
global $config;
|
||||
|
||||
return 'u_' . phpbb_user_id($to_userid);
|
||||
}
|
||||
|
||||
|
@ -1659,7 +1651,7 @@ function phpbb_get_savebox_id($user_id)
|
|||
*/
|
||||
function phpbb_import_attach_config()
|
||||
{
|
||||
global $db, $src_db, $same_db, $convert, $config;
|
||||
global $src_db, $same_db, $convert, $config;
|
||||
|
||||
if ($convert->mysql_convert && $same_db)
|
||||
{
|
||||
|
@ -1765,9 +1757,8 @@ function phpbb_disallowed_username($username)
|
|||
*/
|
||||
function phpbb_create_userconv_table()
|
||||
{
|
||||
global $db, $src_db, $convert, $table_prefix, $user, $lang;
|
||||
global $db;
|
||||
|
||||
$map_dbms = '';
|
||||
switch ($db->get_sql_layer())
|
||||
{
|
||||
case 'mysql':
|
||||
|
@ -1856,7 +1847,7 @@ function phpbb_create_userconv_table()
|
|||
|
||||
function phpbb_check_username_collisions()
|
||||
{
|
||||
global $db, $src_db, $convert, $table_prefix, $user, $lang;
|
||||
global $db, $src_db, $convert, $user, $lang;
|
||||
|
||||
// now find the clean version of the usernames that collide
|
||||
$sql = 'SELECT username_clean
|
||||
|
@ -1969,7 +1960,7 @@ function phpbb_add_notification_options($user_notify_pm)
|
|||
);
|
||||
}
|
||||
|
||||
$sql = $db->sql_multi_insert(USER_NOTIFICATIONS_TABLE, $rows);
|
||||
$db->sql_multi_insert(USER_NOTIFICATIONS_TABLE, $rows);
|
||||
}
|
||||
|
||||
function phpbb_convert_password_hash($hash)
|
||||
|
|
|
@ -628,7 +628,6 @@ function utf8_new_case_fold_nfkc($text, $option = 'full')
|
|||
"\xF0\x9D\x9E\xBB" => "\xCF\x83",
|
||||
"\xF0\x9D\x9F\x8A" => "\xCF\x9D",
|
||||
);
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
// do the case fold
|
||||
$text = utf8_new_case_fold($text, $option);
|
||||
|
|
|
@ -97,13 +97,12 @@ class gd
|
|||
|
||||
if ($config['captcha_gd_3d_noise'])
|
||||
{
|
||||
$xoffset = mt_rand(0,9);
|
||||
$noise_bitmaps = $this->captcha_noise_bg_bitmaps();
|
||||
for ($i = 0; $i < $code_len; ++$i)
|
||||
{
|
||||
$noise[$i] = new char_cube3d($noise_bitmaps, mt_rand(1, sizeof($noise_bitmaps['data'])));
|
||||
|
||||
list($min, $max) = $noise[$i]->range();
|
||||
$noise[$i]->range();
|
||||
//$box = $noise[$i]->dimensions($sizes[$i]);
|
||||
}
|
||||
$xoffset = 0;
|
||||
|
@ -151,8 +150,6 @@ class gd
|
|||
*/
|
||||
function wave($img)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$period_x = mt_rand(12,18);
|
||||
$period_y = mt_rand(7,14);
|
||||
$amp_x = mt_rand(5,10);
|
||||
|
|
|
@ -23,8 +23,6 @@ class gd_wave
|
|||
|
||||
function execute($code, $seed)
|
||||
{
|
||||
global $starttime;
|
||||
|
||||
// seed the random generator
|
||||
mt_srand($seed);
|
||||
|
||||
|
@ -77,7 +75,6 @@ class gd_wave
|
|||
// TODO
|
||||
$background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255));
|
||||
imagefill($img, 0, 0, $background);
|
||||
$black = imagecolorallocate($img, 0, 0, 0);
|
||||
|
||||
$random = array();
|
||||
$fontcolors = array();
|
||||
|
@ -155,7 +152,7 @@ class gd_wave
|
|||
// rather than recalculating from absolute coordinates
|
||||
// What we cache into the $img_buffer contains the raised text coordinates.
|
||||
$img_pos_prev = $img_buffer[0][0] = array($box['upper_left']['x'], $box['upper_left']['y']);
|
||||
$cur_height = $prev_height = $this->wave_height(0, 0, $subdivision_factor);
|
||||
$prev_height = $this->wave_height(0, 0, $subdivision_factor);
|
||||
$full_x = $plane_x * $subdivision_factor;
|
||||
$full_y = $plane_y * $subdivision_factor;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ abstract class captcha_abstract
|
|||
|
||||
function init($type)
|
||||
{
|
||||
global $config, $db, $user, $request;
|
||||
global $config, $request;
|
||||
|
||||
// read input
|
||||
$this->confirm_id = $request->variable('confirm_id', '');
|
||||
|
@ -56,8 +56,6 @@ abstract class captcha_abstract
|
|||
|
||||
function execute_demo()
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
|
||||
$this->seed = hexdec(substr(unique_id(), 4, 10));
|
||||
|
||||
|
@ -117,7 +115,7 @@ abstract class captcha_abstract
|
|||
|
||||
function get_demo_template($id)
|
||||
{
|
||||
global $config, $user, $template, $request, $phpbb_admin_path, $phpEx;
|
||||
global $config, $template, $request, $phpbb_admin_path, $phpEx;
|
||||
|
||||
$variables = '';
|
||||
|
||||
|
@ -153,7 +151,7 @@ abstract class captcha_abstract
|
|||
|
||||
function garbage_collect($type)
|
||||
{
|
||||
global $db, $config;
|
||||
global $db;
|
||||
|
||||
$sql = 'SELECT DISTINCT c.session_id
|
||||
FROM ' . CONFIRM_TABLE . ' c
|
||||
|
@ -193,7 +191,7 @@ abstract class captcha_abstract
|
|||
|
||||
function validate()
|
||||
{
|
||||
global $config, $db, $user;
|
||||
global $user;
|
||||
|
||||
if (!$user->is_setup())
|
||||
{
|
||||
|
|
|
@ -53,18 +53,11 @@ class gd extends captcha_abstract
|
|||
|
||||
function acp_page($id, &$module)
|
||||
{
|
||||
global $db, $user, $auth, $template, $phpbb_log, $request;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
global $user, $template, $phpbb_log, $request;
|
||||
global $config;
|
||||
|
||||
$user->add_lang('acp/board');
|
||||
|
||||
$config_vars = array(
|
||||
'enable_confirm' => 'REG_ENABLE',
|
||||
'enable_post_confirm' => 'POST_ENABLE',
|
||||
'confirm_refresh' => 'CONFIRM_REFRESH',
|
||||
'captcha_gd' => 'CAPTCHA_GD',
|
||||
);
|
||||
|
||||
$module->tpl_name = 'captcha_gd_acp';
|
||||
$module->page_title = 'ACP_VC_SETTINGS';
|
||||
$form_key = 'acp_captcha';
|
||||
|
|
|
@ -35,7 +35,7 @@ class gd_wave extends captcha_abstract
|
|||
|
||||
function acp_page($id, &$module)
|
||||
{
|
||||
global $config, $db, $template, $user;
|
||||
global $user;
|
||||
|
||||
trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action));
|
||||
}
|
||||
|
|
|
@ -1012,7 +1012,7 @@ abstract class driver implements driver_interface
|
|||
*/
|
||||
function sql_report($mode, $query = '')
|
||||
{
|
||||
global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper, $user;
|
||||
global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper;
|
||||
global $request;
|
||||
|
||||
if (is_object($request) && !$request->variable('explain', false))
|
||||
|
|
|
@ -84,8 +84,6 @@ class oracle extends \phpbb\db\driver\driver
|
|||
* but I assume its because the Oracle extension provides a direct method to access it
|
||||
* without a query.
|
||||
*/
|
||||
|
||||
$use_cache = false;
|
||||
/*
|
||||
global $cache;
|
||||
|
||||
|
|
|
@ -192,8 +192,6 @@ class oracle_extractor extends base_extractor
|
|||
$ary_name[$i] = ocicolumnname($result, $i + 1);
|
||||
}
|
||||
|
||||
$sql_data = '';
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$schema_vals = $schema_fields = array();
|
||||
|
|
|
@ -118,7 +118,7 @@ class release_3_0_5_rc1 extends container_aware_migration
|
|||
$result = $this->db->sql_query($sql);
|
||||
|
||||
// Skip first row, this is our original auth option we want to preserve
|
||||
$row = $this->db->sql_fetchrow($result);
|
||||
$this->db->sql_fetchrow($result);
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
|
|
|
@ -45,7 +45,6 @@ class update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration
|
|||
$sql_ary = array();
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$data = array();
|
||||
if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match']))
|
||||
{
|
||||
$data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']);
|
||||
|
|
|
@ -535,7 +535,7 @@ class migrator
|
|||
}
|
||||
|
||||
// Reverse the step that was run
|
||||
$result = $this->run_step($reverse_step, false, !$revert);
|
||||
$this->run_step($reverse_step, false, !$revert);
|
||||
}
|
||||
|
||||
// rethrow the exception
|
||||
|
|
|
@ -1116,7 +1116,7 @@ class tools implements tools_interface
|
|||
}
|
||||
|
||||
// Get type
|
||||
list($column_type, $orig_column_type) = $this->get_column_type($column_data[0]);
|
||||
list($column_type) = $this->get_column_type($column_data[0]);
|
||||
|
||||
// Adjust default value if db-dependent specified
|
||||
if (is_array($column_data[1]))
|
||||
|
|
|
@ -97,7 +97,6 @@ class remote extends base
|
|||
|
||||
$url['path'] = implode('', $url['path']);
|
||||
$upload_ary['name'] = utf8_basename($url['path']) . (($ext) ? '.' . $ext : '');
|
||||
$filename = $url['path'];
|
||||
$filesize = 0;
|
||||
|
||||
$remote_max_filesize = $this->get_max_file_size();
|
||||
|
|
|
@ -117,7 +117,7 @@ class validate extends \phpbb\console\command\command
|
|||
|
||||
try
|
||||
{
|
||||
$config = $processor->processConfiguration($configuration, $config);
|
||||
$processor->processConfiguration($configuration, $config);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
|
|
|
@ -19,7 +19,6 @@ use phpbb\install\helper\navigation\navigation_provider;
|
|||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use phpbb\install\helper\iohandler\factory;
|
||||
use phpbb\install\controller\helper;
|
||||
use phpbb\template\template;
|
||||
use phpbb\request\request_interface;
|
||||
use phpbb\install\installer;
|
||||
|
|
|
@ -420,7 +420,7 @@ class log implements \phpbb\log\log_interface
|
|||
$this->entry_count = 0;
|
||||
$this->last_page_offset = $offset;
|
||||
|
||||
$post_id_list = $topic_id_list = $reportee_id_list = array();
|
||||
$topic_id_list = $reportee_id_list = array();
|
||||
|
||||
$profile_url = ($this->get_is_admin() && $this->phpbb_admin_path) ? append_sid("{$this->phpbb_admin_path}index.{$this->php_ext}", 'i=users&mode=overview') : append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=viewprofile');
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ class report_handler_post extends report_handler
|
|||
'reported_post_enable_magic_url' => $this->report_data['enable_magic_url'],
|
||||
);
|
||||
|
||||
$report_id = $this->create_report($report_data);
|
||||
$this->create_report($report_data);
|
||||
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET post_reported = 1
|
||||
|
|
|
@ -172,7 +172,6 @@ class type_cast_helper implements \phpbb\request\type_cast_helper_interface
|
|||
}
|
||||
|
||||
list($default_key, $default_value) = each($default);
|
||||
$value_type = gettype($default_value);
|
||||
$key_type = gettype($default_key);
|
||||
|
||||
$_var = $var;
|
||||
|
|
|
@ -352,9 +352,6 @@ class fulltext_native extends \phpbb\search\base
|
|||
$this->must_not_contain_ids = array();
|
||||
$this->must_exclude_one_ids = array();
|
||||
|
||||
$mode = '';
|
||||
$ignore_no_id = true;
|
||||
|
||||
foreach ($query as $word)
|
||||
{
|
||||
if (empty($word))
|
||||
|
@ -597,7 +594,6 @@ class fulltext_native extends \phpbb\search\base
|
|||
$id_ary = array();
|
||||
|
||||
$sql_where = array();
|
||||
$group_by = false;
|
||||
$m_num = 0;
|
||||
$w_num = 0;
|
||||
|
||||
|
@ -1328,7 +1324,6 @@ class fulltext_native extends \phpbb\search\base
|
|||
$match[] = '#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?[0-9a-z]{5,})\]#';
|
||||
|
||||
$min = $this->word_length['min'];
|
||||
$max = $this->word_length['max'];
|
||||
|
||||
$isset_min = $min - 1;
|
||||
|
||||
|
@ -1737,7 +1732,7 @@ class fulltext_native extends \phpbb\search\base
|
|||
protected function cleanup($text, $allowed_chars = null, $encoding = 'utf-8')
|
||||
{
|
||||
static $conv = array(), $conv_loaded = array();
|
||||
$words = $allow = array();
|
||||
$allow = array();
|
||||
|
||||
// Convert the text to UTF-8
|
||||
$encoding = strtolower($encoding);
|
||||
|
|
|
@ -501,7 +501,6 @@ class fulltext_postgres extends \phpbb\search\base
|
|||
$sql_select = ($type == 'posts') ? 'p.post_id' : 'DISTINCT t.topic_id';
|
||||
$sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : '';
|
||||
$field = ($type == 'posts') ? 'post_id' : 'topic_id';
|
||||
$sql_author = (sizeof($author_ary) == 1) ? ' = ' . $author_ary[0] : 'IN (' . implode(', ', $author_ary) . ')';
|
||||
|
||||
if (sizeof($author_ary) && $author_name)
|
||||
{
|
||||
|
@ -526,7 +525,6 @@ class fulltext_postgres extends \phpbb\search\base
|
|||
$sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
|
||||
$sql_where_options .= $sql_match_where;
|
||||
|
||||
$tmp_sql_match = array();
|
||||
$sql_match = str_replace(',', " || ' ' ||", $sql_match);
|
||||
$tmp_sql_match = "to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', " . $sql_match . ") @@ to_tsquery ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', '" . $this->db->sql_escape($this->tsearch_query) . "')";
|
||||
|
||||
|
@ -838,7 +836,7 @@ class fulltext_postgres extends \phpbb\search\base
|
|||
GROUP BY t.topic_id, $sort_by_sql[$sort_key]";
|
||||
}
|
||||
|
||||
$result = $this->db->sql_query($sql_count);
|
||||
$this->db->sql_query($sql_count);
|
||||
$result_count = (int) $this->db->sql_fetchfield('result_count');
|
||||
|
||||
if (!$result_count)
|
||||
|
|
|
@ -404,7 +404,7 @@ class fulltext_sphinx
|
|||
$variable = $section->get_variable_by_name($key);
|
||||
if (!$variable)
|
||||
{
|
||||
$variable = $section->create_variable($key, $value);
|
||||
$section->create_variable($key, $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -413,7 +413,7 @@ class fulltext_sphinx
|
|||
}
|
||||
else
|
||||
{
|
||||
$variable = $section->create_variable($key, $value);
|
||||
$section->create_variable($key, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -437,7 +437,6 @@ class fulltext_sphinx
|
|||
$match = array('#\sand\s#i', '#\sor\s#i', '#\snot\s#i', '#\+#', '#-#', '#\|#', '#@#');
|
||||
$replace = array(' & ', ' | ', ' - ', ' +', ' -', ' |', '');
|
||||
|
||||
$replacements = 0;
|
||||
$keywords = preg_replace($match, $replace, $keywords);
|
||||
$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED);
|
||||
}
|
||||
|
@ -490,8 +489,6 @@ class fulltext_sphinx
|
|||
|
||||
$id_ary = array();
|
||||
|
||||
$join_topic = ($type != 'posts');
|
||||
|
||||
// Sorting
|
||||
|
||||
if ($type == 'topics')
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue