diff --git a/upload/attach_mod/includes/functions_attach.php b/upload/attach_mod/includes/functions_attach.php
index 6e88babe1..f677278be 100644
--- a/upload/attach_mod/includes/functions_attach.php
+++ b/upload/attach_mod/includes/functions_attach.php
@@ -224,7 +224,7 @@ function attach_init_ftp($mode = false)
*/
function unlink_attach($filename, $mode = false)
{
- global $upload_dir, $attach_config, $lang;
+ global $upload_dir, $attach_config;
$filename = basename($filename);
diff --git a/upload/attach_mod/includes/functions_includes.php b/upload/attach_mod/includes/functions_includes.php
index 0c3268e56..528d484d8 100644
--- a/upload/attach_mod/includes/functions_includes.php
+++ b/upload/attach_mod/includes/functions_includes.php
@@ -6,7 +6,7 @@
*/
function attach_faq_include($lang_file)
{
- global $bb_cfg, $faq, $attach_config;
+ global $attach_config;
if (intval($attach_config['disable_mod']))
{
@@ -41,7 +41,7 @@ function attach_faq_include($lang_file)
*/
function attach_build_auth_levels($is_auth, &$s_auth_can)
{
- global $lang, $attach_config, $forum_id;
+ global $lang, $attach_config;
if (intval($attach_config['disable_mod']))
{
diff --git a/upload/attach_mod/posting_attachments.php b/upload/attach_mod/posting_attachments.php
index 1a0f69a2c..ae76b419d 100644
--- a/upload/attach_mod/posting_attachments.php
+++ b/upload/attach_mod/posting_attachments.php
@@ -210,7 +210,7 @@ class attach_parent
*/
function handle_attachments($mode)
{
- global $is_auth, $attach_config, $refresh, $post_id, $submit, $preview, $error, $error_msg, $lang, $template, $userdata;
+ global $is_auth, $attach_config, $refresh, $post_id, $submit, $preview, $error, $error_msg, $lang;
//
// ok, what shall we do ;)
@@ -741,7 +741,7 @@ class attach_parent
*/
function display_attachment_bodies()
{
- global $attach_config, $is_auth, $lang, $mode, $template, $upload_dir, $userdata, $forum_id;
+ global $attach_config, $is_auth, $lang, $template, $upload_dir, $forum_id;
// Choose what to display
$value_add = $value_posted = 0;
@@ -1315,7 +1315,7 @@ class attach_posting extends attach_parent
*/
function insert_attachment($post_id)
{
- global $is_auth, $mode, $userdata, $error, $error_msg;
+ global $is_auth, $mode;
// Insert Attachment ?
if (!empty($post_id) && ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') && $is_auth['auth_attachments'])
diff --git a/upload/common.php b/upload/common.php
index 98d06dd92..7819b326b 100644
--- a/upload/common.php
+++ b/upload/common.php
@@ -1305,8 +1305,6 @@ class datastore_memcache extends datastore_common
function datastore_memcache ($cfg, $prefix = null)
{
- global $bb_cfg;
-
if (!$this->is_installed())
{
die('Error: Memcached extension not installed');
@@ -1470,8 +1468,6 @@ class datastore_redis extends datastore_common
function datastore_redis ($cfg, $prefix = null)
{
- global $bb_cfg;
-
if (!$this->is_installed())
{
die('Error: Redis extension not installed');
@@ -1565,8 +1561,6 @@ class datastore_eaccelerator extends datastore_common
function datastore_eaccelerator ($prefix = null)
{
- global $bb_cfg;
-
if (!$this->is_installed())
{
die('Error: eAccelerator extension not installed');
@@ -1635,8 +1629,6 @@ class datastore_xcache extends datastore_common
function datastore_xcache ($prefix = null)
{
- global $bb_cfg;
-
if (!$this->is_installed())
{
die('Error: XCache extension not installed');
@@ -1706,8 +1698,6 @@ class datastore_apc extends datastore_common
function datastore_apc ($prefix = null)
{
- global $bb_cfg;
-
if (!$this->is_installed())
{
die('Error: APC extension not installed');
@@ -1777,8 +1767,6 @@ class datastore_file extends datastore_common
function datastore_file ($dir, $prefix = null)
{
- global $bb_cfg;
-
$this->prefix = $prefix;
$this->dir = $dir;
$this->dbg_enabled = sql_dbg_enabled();
diff --git a/upload/config.php b/upload/config.php
index b79909743..36f033fca 100644
--- a/upload/config.php
+++ b/upload/config.php
@@ -1,51 +1,5 @@
= $bb_cfg['hot_threshold']);
$is_unread = is_null($is_unread) ? is_unread($topic['topic_last_post_time'], $topic['topic_id'], $topic['forum_id']) : $is_unread;
@@ -2732,14 +2731,14 @@ function pad_with_space ($str)
function create_magnet($infohash, $auth_key, $logged_in)
{
- global $bb_cfg, $userdata, $_GET, $images;
+ global $bb_cfg, $_GET, $images;
$passkey_url = ((!$logged_in || isset($_GET['no_passkey'])) && $bb_cfg['bt_tor_browse_only_reg']) ? '' : "?{$bb_cfg['passkey_key']}=$auth_key";
return '
';
}
function get_avatar ($avatar, $type, $allow_avatar = true, $height = '', $width = '')
{
- global $bb_cfg, $lang;
+ global $bb_cfg;
$height = ($height != '') ? 'height="'. $height .'"' : '';
$width = ($width != '') ? 'width="'. $width .'"' : '';
@@ -2766,7 +2765,7 @@ function get_avatar ($avatar, $type, $allow_avatar = true, $height = '', $width
function set_die_append_msg ($forum_id = null, $topic_id = null)
{
- global $userdata, $lang, $template;
+ global $lang, $template;
$msg = '';
$msg .= ($topic_id) ? '
'. $lang['TOPIC_RETURN'] .'
' : '';
diff --git a/upload/includes/functions_admin_torrent.php b/upload/includes/functions_admin_torrent.php
index a6ac181fd..5485facc5 100644
--- a/upload/includes/functions_admin_torrent.php
+++ b/upload/includes/functions_admin_torrent.php
@@ -4,8 +4,6 @@ if (!defined('BB_ROOT')) die(basename(__FILE__));
function update_table_bool ($table_name, $key, $field_name, $field_def_val)
{
- global $db;
-
// Clear current status
$sql = "UPDATE $table_name
SET $field_name = $field_def_val
@@ -88,8 +86,6 @@ function set_tpl_vars_lang ($default_cfg)
function update_config_table ($table_name, $default_cfg, $cfg, $type)
{
- global $db;
-
foreach ($default_cfg as $config_name => $config_value)
{
if (isset($_POST[$config_name]) && $_POST[$config_name] != $cfg[$config_name])
diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php
index ae7b00111..c8c2b5b8b 100644
--- a/upload/includes/functions_post.php
+++ b/upload/includes/functions_post.php
@@ -723,7 +723,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi
function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new_topic_id = '', $new_topic_title = '', $old_topic_id = '', $message = '', $poster_id = '')
{
- global $userdata, $is_auth, $bb_cfg, $lang;
+ global $userdata, $lang;
require(DEFAULT_LANG_DIR .'lang_bot.php');
@@ -802,7 +802,7 @@ function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new
function topic_review ($topic_id)
{
- global $bb_cfg, $lang, $template;
+ global $bb_cfg, $template;
// Fetch posts data
$review_posts = DB()->fetch_rowset("
diff --git a/upload/includes/functions_report.php b/upload/includes/functions_report.php
index 718328573..bad0a6261 100644
--- a/upload/includes/functions_report.php
+++ b/upload/includes/functions_report.php
@@ -840,7 +840,7 @@ function reports_deleted_obtain($auth_check = true)
//
function report_obtain($report_id, $auth_check = true)
{
- global $bb_cfg, $lang;
+ global $lang;
$sql = 'SELECT r.report_id, r.user_id, r.report_time, r.report_module_id, r.report_status, r.report_subject,
r.report_subject_data, r.report_title, r.report_desc, rr.report_reason_desc, u.username, u.user_rank
@@ -1242,7 +1242,7 @@ function reports_delete($report_ids, $auth_check = true, $module_action = true)
//
function report_statistics($mode)
{
- global $bb_cfg, $lang;
+ global $bb_cfg;
switch ($mode)
{
diff --git a/upload/includes/functions_report_admin.php b/upload/includes/functions_report_admin.php
index 001e457ba..db978f88d 100644
--- a/upload/includes/functions_report_admin.php
+++ b/upload/includes/functions_report_admin.php
@@ -457,8 +457,6 @@ function report_reason_edit($reason_id, $module_id, $reason_desc)
//
function report_reason_move($mode, $reason_id, $steps = 1)
{
- global $bb_cfg;
-
//
// Obtain report reason information
//
diff --git a/upload/includes/functions_torrent.php b/upload/includes/functions_torrent.php
index 79e874458..82ff12989 100644
--- a/upload/includes/functions_torrent.php
+++ b/upload/includes/functions_torrent.php
@@ -156,7 +156,7 @@ function tracker_unregister ($attach_id, $mode = '')
function delete_torrent ($attach_id, $mode = '')
{
- global $lang, $userdata, $reg_mode, $topic_id;
+ global $lang, $reg_mode, $topic_id;
$attach_id = intval($attach_id);
$reg_mode = $mode;
@@ -242,7 +242,7 @@ function change_tor_type ($attach_id, $tor_status_gold)
function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED)
{
- global $template, $attach_config, $bb_cfg, $lang, $return_message, $reg_mode, $tr_cfg;
+ global $bb_cfg, $lang, $reg_mode, $tr_cfg;
$attach_id = intval($attach_id);
$reg_mode = $mode;
@@ -712,7 +712,7 @@ function get_registered_torrents ($id, $mode)
function exit_redirect ($message, $post_id, $forum_id)
{
- global $template, $lang;
+ global $lang;
$exit_message = $message .'
'. sprintf($lang['CLICK_RETURN_TOPIC'], '', '') .'
'. sprintf($lang['CLICK_RETURN_FORUM'], '', '');
message_die(GENERAL_MESSAGE, $exit_message);
diff --git a/upload/includes/report_hack/report_privmsg.php b/upload/includes/report_hack/report_privmsg.php
index 31b3d8955..405c1fb5d 100644
--- a/upload/includes/report_hack/report_privmsg.php
+++ b/upload/includes/report_hack/report_privmsg.php
@@ -231,8 +231,6 @@ class report_privmsg extends report_module
//
function _subject_details_prepare(&$message, &$subject, $row)
{
- global $bb_cfg, $userdata, $datastore;
-
require_once(INC_DIR . "bbcode.php");
$message = bbcode2html($message);
diff --git a/upload/includes/report_hack/report_user.php b/upload/includes/report_hack/report_user.php
index fa16d9cc4..18d7136cc 100644
--- a/upload/includes/report_hack/report_user.php
+++ b/upload/includes/report_hack/report_user.php
@@ -29,8 +29,6 @@ class report_user extends report_module
//
function subject_obtain($report_subject)
{
- global $db;
-
$sql = 'SELECT username
FROM ' . BB_USERS . '
WHERE user_id = ' . (int) $report_subject;
diff --git a/upload/includes/sessions.php b/upload/includes/sessions.php
index ad0d24787..c7b699c00 100644
--- a/upload/includes/sessions.php
+++ b/upload/includes/sessions.php
@@ -391,8 +391,6 @@ class user_common
*/
function login ($args, $mod_admin_login = false)
{
- global $bb_cfg;
-
$username = !empty($args['login_username']) ? clean_username($args['login_username']) : '';
$password = !empty($args['login_password']) ? $args['login_password'] : '';
@@ -664,8 +662,6 @@ class user_common
*/
function mark_read ($type)
{
- global $template, $lang;
-
if ($type === 'all_forums')
{
// Update session time
diff --git a/upload/includes/template.php b/upload/includes/template.php
index 29f91312e..c19761720 100644
--- a/upload/includes/template.php
+++ b/upload/includes/template.php
@@ -317,7 +317,6 @@ class Template {
*/
function pparse($handle)
{
- global $bb_cfg;
// parsing header if there is one
if($this->preparse || $this->postparse)
{
@@ -384,7 +383,7 @@ class Template {
*/
function precompile($template, $filename)
{
- global $precompile_num, $bb_cfg;
+ global $precompile_num;
if(empty($precompile_num))
{
$precompile_num = 0;
@@ -524,7 +523,6 @@ class Template {
*/
function loadfile($handle)
{
- global $bb_cfg;
// If cached file exists do nothing - it will be included via include()
if(!empty($this->files_cache[$handle]))
{
diff --git a/upload/includes/ucp/usercp_avatar.php b/upload/includes/ucp/usercp_avatar.php
index 9b2c4a3ba..e5d48713c 100644
--- a/upload/includes/ucp/usercp_avatar.php
+++ b/upload/includes/ucp/usercp_avatar.php
@@ -34,7 +34,7 @@ function check_image_type(&$type, &$errors)
function user_avatar_delete($avatar_type, $avatar_file)
{
- global $bb_cfg, $userdata;
+ global $bb_cfg;
$avatar_file = basename($avatar_file);
if ( $avatar_type == USER_AVATAR_UPLOAD && $avatar_file != '' )