Рудименты и прочий мусор git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@534 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
GTDarkNightmare@gmail.com 2013-08-03 06:42:04 +00:00
commit 40a0142396
18 changed files with 22 additions and 102 deletions

View file

@ -224,7 +224,7 @@ function attach_init_ftp($mode = false)
*/ */
function unlink_attach($filename, $mode = false) function unlink_attach($filename, $mode = false)
{ {
global $upload_dir, $attach_config, $lang; global $upload_dir, $attach_config;
$filename = basename($filename); $filename = basename($filename);

View file

@ -6,7 +6,7 @@
*/ */
function attach_faq_include($lang_file) function attach_faq_include($lang_file)
{ {
global $bb_cfg, $faq, $attach_config; global $attach_config;
if (intval($attach_config['disable_mod'])) 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) 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'])) if (intval($attach_config['disable_mod']))
{ {

View file

@ -210,7 +210,7 @@ class attach_parent
*/ */
function handle_attachments($mode) 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 ;) // ok, what shall we do ;)
@ -741,7 +741,7 @@ class attach_parent
*/ */
function display_attachment_bodies() 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 // Choose what to display
$value_add = $value_posted = 0; $value_add = $value_posted = 0;
@ -1315,7 +1315,7 @@ class attach_posting extends attach_parent
*/ */
function insert_attachment($post_id) function insert_attachment($post_id)
{ {
global $is_auth, $mode, $userdata, $error, $error_msg; global $is_auth, $mode;
// Insert Attachment ? // Insert Attachment ?
if (!empty($post_id) && ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') && $is_auth['auth_attachments']) if (!empty($post_id) && ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') && $is_auth['auth_attachments'])

View file

@ -1305,8 +1305,6 @@ class datastore_memcache extends datastore_common
function datastore_memcache ($cfg, $prefix = null) function datastore_memcache ($cfg, $prefix = null)
{ {
global $bb_cfg;
if (!$this->is_installed()) if (!$this->is_installed())
{ {
die('Error: Memcached extension not installed'); die('Error: Memcached extension not installed');
@ -1470,8 +1468,6 @@ class datastore_redis extends datastore_common
function datastore_redis ($cfg, $prefix = null) function datastore_redis ($cfg, $prefix = null)
{ {
global $bb_cfg;
if (!$this->is_installed()) if (!$this->is_installed())
{ {
die('Error: Redis extension not installed'); die('Error: Redis extension not installed');
@ -1565,8 +1561,6 @@ class datastore_eaccelerator extends datastore_common
function datastore_eaccelerator ($prefix = null) function datastore_eaccelerator ($prefix = null)
{ {
global $bb_cfg;
if (!$this->is_installed()) if (!$this->is_installed())
{ {
die('Error: eAccelerator extension not installed'); die('Error: eAccelerator extension not installed');
@ -1635,8 +1629,6 @@ class datastore_xcache extends datastore_common
function datastore_xcache ($prefix = null) function datastore_xcache ($prefix = null)
{ {
global $bb_cfg;
if (!$this->is_installed()) if (!$this->is_installed())
{ {
die('Error: XCache extension not installed'); die('Error: XCache extension not installed');
@ -1706,8 +1698,6 @@ class datastore_apc extends datastore_common
function datastore_apc ($prefix = null) function datastore_apc ($prefix = null)
{ {
global $bb_cfg;
if (!$this->is_installed()) if (!$this->is_installed())
{ {
die('Error: APC extension not installed'); die('Error: APC extension not installed');
@ -1777,8 +1767,6 @@ class datastore_file extends datastore_common
function datastore_file ($dir, $prefix = null) function datastore_file ($dir, $prefix = null)
{ {
global $bb_cfg;
$this->prefix = $prefix; $this->prefix = $prefix;
$this->dir = $dir; $this->dir = $dir;
$this->dbg_enabled = sql_dbg_enabled(); $this->dbg_enabled = sql_dbg_enabled();

View file

@ -1,51 +1,5 @@
<?php <?php
/**
* Database
* Cache
- Tracker Cache
- Forum Cache
- Session Cache
- Datastore
* Tracker
* Torrents
- Ratio limits
- Seeding torrents limit
- DL-Status (days to keep)
- Tor-Stats (days to keep)
- Tor-Help
* Path
* Language
* Templates
* Cookie
* Server
- Server load
- Backup
- GZip
* Sessions
* Registration
* Email
* AJAX
* Debug
* Special users (dbg_users, unlimited_users, super_admins)
* LOG
* Error reporting
* Subforums
* Forums
* Topics
* Posts
* Search
* Actions log
* Users
* GroupCP
* Ads
* Misc
* Captcha
**/
if (!defined('BB_ROOT')) die(basename(__FILE__)); if (!defined('BB_ROOT')) die(basename(__FILE__));
$bb_cfg = $tr_cfg = $page_cfg = array(); $bb_cfg = $tr_cfg = $page_cfg = array();
@ -57,7 +11,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.5 (unstable)'; $bb_cfg['tp_version'] = '2.5 (unstable)';
$bb_cfg['tp_release_date'] = '03-08-2013'; $bb_cfg['tp_release_date'] = '03-08-2013';
$bb_cfg['tp_release_state'] = 'R533'; $bb_cfg['tp_release_state'] = 'R534';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';

View file

@ -93,8 +93,6 @@ function send_file_to_browser($attachment, $upload_dir)
} }
//bt //bt
global $userdata;
if (!(isset($_GET['original']) && !IS_USER)) if (!(isset($_GET['original']) && !IS_USER))
{ {
include(INC_DIR .'functions_torrent.php'); include(INC_DIR .'functions_torrent.php');

View file

@ -13,7 +13,6 @@ $page_cfg['include_bbcode_js'] = true;
// //
function get_bbcode_tpl () function get_bbcode_tpl ()
{ {
global $lang;
$bbcode_tpl = array(); $bbcode_tpl = array();
// Quote // Quote
@ -97,7 +96,7 @@ function prepare_message ($message)
// Either in a window or inline // Either in a window or inline
function generate_smilies($mode) function generate_smilies($mode)
{ {
global $bb_cfg, $template, $lang, $images, $user, $datastore; global $bb_cfg, $template, $lang, $user, $datastore;
$inline_columns = 4; $inline_columns = 4;
$inline_rows = 7; $inline_rows = 7;
@ -711,8 +710,6 @@ class bbcode
*/ */
function make_clickable ($text) function make_clickable ($text)
{ {
global $bb_cfg;
$url_regexp = "# $url_regexp = "#
(?<![\"'=]) (?<![\"'=])
\b \b

View file

@ -662,7 +662,6 @@ function delta_time ($timestamp_1, $timestamp_2 = TIMENOW, $granularity = 'auto'
function get_select ($select, $selected = null, $return_as = 'html', $first_opt = '&raquo;&raquo; Выбрать ') function get_select ($select, $selected = null, $return_as = 'html', $first_opt = '&raquo;&raquo; Выбрать ')
{ {
global $lang;
$select_ary = array(); $select_ary = array();
switch ($select) switch ($select)
@ -1905,7 +1904,7 @@ function bb_die ($msg_text)
function message_die ($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '') function message_die ($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
{ {
global $DBS, $template, $bb_cfg, $theme, $lang, $nav_links, $gen_simple_header, $images, $userdata; global $DBS, $template, $bb_cfg, $theme, $lang, $userdata;
if (defined('HAS_DIED')) if (defined('HAS_DIED'))
{ {
@ -2373,7 +2372,7 @@ class log_action
function get_topic_icon ($topic, $is_unread = null) function get_topic_icon ($topic, $is_unread = null)
{ {
global $bb_cfg, $lang, $images; global $bb_cfg, $images;
$t_hot = ($topic['topic_replies'] >= $bb_cfg['hot_threshold']); $t_hot = ($topic['topic_replies'] >= $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; $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) 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"; $passkey_url = ((!$logged_in || isset($_GET['no_passkey'])) && $bb_cfg['bt_tor_browse_only_reg']) ? '' : "?{$bb_cfg['passkey_key']}=$auth_key";
return '<a href="magnet:?xt=urn:btih:'. bin2hex($infohash) .'&tr='. urlencode($bb_cfg['bt_announce_url'] . $passkey_url) .'"><img src="'. $images['icon_magnet'] .'" width="12" height="12" border="0" /></a>'; return '<a href="magnet:?xt=urn:btih:'. bin2hex($infohash) .'&tr='. urlencode($bb_cfg['bt_announce_url'] . $passkey_url) .'"><img src="'. $images['icon_magnet'] .'" width="12" height="12" border="0" /></a>';
} }
function get_avatar ($avatar, $type, $allow_avatar = true, $height = '', $width = '') function get_avatar ($avatar, $type, $allow_avatar = true, $height = '', $width = '')
{ {
global $bb_cfg, $lang; global $bb_cfg;
$height = ($height != '') ? 'height="'. $height .'"' : ''; $height = ($height != '') ? 'height="'. $height .'"' : '';
$width = ($width != '') ? 'width="'. $width .'"' : ''; $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) function set_die_append_msg ($forum_id = null, $topic_id = null)
{ {
global $userdata, $lang, $template; global $lang, $template;
$msg = ''; $msg = '';
$msg .= ($topic_id) ? '<p class="mrg_10"><a href="viewtopic.php?t='. $topic_id .'">'. $lang['TOPIC_RETURN'] .'</a></p>' : ''; $msg .= ($topic_id) ? '<p class="mrg_10"><a href="viewtopic.php?t='. $topic_id .'">'. $lang['TOPIC_RETURN'] .'</a></p>' : '';

View file

@ -4,8 +4,6 @@ if (!defined('BB_ROOT')) die(basename(__FILE__));
function update_table_bool ($table_name, $key, $field_name, $field_def_val) function update_table_bool ($table_name, $key, $field_name, $field_def_val)
{ {
global $db;
// Clear current status // Clear current status
$sql = "UPDATE $table_name $sql = "UPDATE $table_name
SET $field_name = $field_def_val 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) function update_config_table ($table_name, $default_cfg, $cfg, $type)
{ {
global $db;
foreach ($default_cfg as $config_name => $config_value) foreach ($default_cfg as $config_name => $config_value)
{ {
if (isset($_POST[$config_name]) && $_POST[$config_name] != $cfg[$config_name]) if (isset($_POST[$config_name]) && $_POST[$config_name] != $cfg[$config_name])

View file

@ -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 = '') 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'); 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) function topic_review ($topic_id)
{ {
global $bb_cfg, $lang, $template; global $bb_cfg, $template;
// Fetch posts data // Fetch posts data
$review_posts = DB()->fetch_rowset(" $review_posts = DB()->fetch_rowset("

View file

@ -840,7 +840,7 @@ function reports_deleted_obtain($auth_check = true)
// //
function report_obtain($report_id, $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, $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 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) function report_statistics($mode)
{ {
global $bb_cfg, $lang; global $bb_cfg;
switch ($mode) switch ($mode)
{ {

View file

@ -457,8 +457,6 @@ function report_reason_edit($reason_id, $module_id, $reason_desc)
// //
function report_reason_move($mode, $reason_id, $steps = 1) function report_reason_move($mode, $reason_id, $steps = 1)
{ {
global $bb_cfg;
// //
// Obtain report reason information // Obtain report reason information
// //

View file

@ -156,7 +156,7 @@ function tracker_unregister ($attach_id, $mode = '')
function delete_torrent ($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); $attach_id = intval($attach_id);
$reg_mode = $mode; $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) 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); $attach_id = intval($attach_id);
$reg_mode = $mode; $reg_mode = $mode;
@ -712,7 +712,7 @@ function get_registered_torrents ($id, $mode)
function exit_redirect ($message, $post_id, $forum_id) function exit_redirect ($message, $post_id, $forum_id)
{ {
global $template, $lang; global $lang;
$exit_message = $message .'<br /><br />'. sprintf($lang['CLICK_RETURN_TOPIC'], '<a href="viewtopic.php?'. POST_POST_URL .'='. $post_id .'#'. $post_id .'">', '</a>') .'<br /><br />'. sprintf($lang['CLICK_RETURN_FORUM'], '<a href="viewforum.php?'. POST_FORUM_URL .'='. $forum_id .'">', '</a>'); $exit_message = $message .'<br /><br />'. sprintf($lang['CLICK_RETURN_TOPIC'], '<a href="viewtopic.php?'. POST_POST_URL .'='. $post_id .'#'. $post_id .'">', '</a>') .'<br /><br />'. sprintf($lang['CLICK_RETURN_FORUM'], '<a href="viewforum.php?'. POST_FORUM_URL .'='. $forum_id .'">', '</a>');
message_die(GENERAL_MESSAGE, $exit_message); message_die(GENERAL_MESSAGE, $exit_message);

View file

@ -231,8 +231,6 @@ class report_privmsg extends report_module
// //
function _subject_details_prepare(&$message, &$subject, $row) function _subject_details_prepare(&$message, &$subject, $row)
{ {
global $bb_cfg, $userdata, $datastore;
require_once(INC_DIR . "bbcode.php"); require_once(INC_DIR . "bbcode.php");
$message = bbcode2html($message); $message = bbcode2html($message);

View file

@ -29,8 +29,6 @@ class report_user extends report_module
// //
function subject_obtain($report_subject) function subject_obtain($report_subject)
{ {
global $db;
$sql = 'SELECT username $sql = 'SELECT username
FROM ' . BB_USERS . ' FROM ' . BB_USERS . '
WHERE user_id = ' . (int) $report_subject; WHERE user_id = ' . (int) $report_subject;

View file

@ -391,8 +391,6 @@ class user_common
*/ */
function login ($args, $mod_admin_login = false) function login ($args, $mod_admin_login = false)
{ {
global $bb_cfg;
$username = !empty($args['login_username']) ? clean_username($args['login_username']) : ''; $username = !empty($args['login_username']) ? clean_username($args['login_username']) : '';
$password = !empty($args['login_password']) ? $args['login_password'] : ''; $password = !empty($args['login_password']) ? $args['login_password'] : '';
@ -664,8 +662,6 @@ class user_common
*/ */
function mark_read ($type) function mark_read ($type)
{ {
global $template, $lang;
if ($type === 'all_forums') if ($type === 'all_forums')
{ {
// Update session time // Update session time

View file

@ -317,7 +317,6 @@ class Template {
*/ */
function pparse($handle) function pparse($handle)
{ {
global $bb_cfg;
// parsing header if there is one // parsing header if there is one
if($this->preparse || $this->postparse) if($this->preparse || $this->postparse)
{ {
@ -384,7 +383,7 @@ class Template {
*/ */
function precompile($template, $filename) function precompile($template, $filename)
{ {
global $precompile_num, $bb_cfg; global $precompile_num;
if(empty($precompile_num)) if(empty($precompile_num))
{ {
$precompile_num = 0; $precompile_num = 0;
@ -524,7 +523,6 @@ class Template {
*/ */
function loadfile($handle) function loadfile($handle)
{ {
global $bb_cfg;
// If cached file exists do nothing - it will be included via include() // If cached file exists do nothing - it will be included via include()
if(!empty($this->files_cache[$handle])) if(!empty($this->files_cache[$handle]))
{ {

View file

@ -34,7 +34,7 @@ function check_image_type(&$type, &$errors)
function user_avatar_delete($avatar_type, $avatar_file) function user_avatar_delete($avatar_type, $avatar_file)
{ {
global $bb_cfg, $userdata; global $bb_cfg;
$avatar_file = basename($avatar_file); $avatar_file = basename($avatar_file);
if ( $avatar_type == USER_AVATAR_UPLOAD && $avatar_file != '' ) if ( $avatar_type == USER_AVATAR_UPLOAD && $avatar_file != '' )