mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Fixed formatting
This commit is contained in:
parent
8e68611823
commit
b87739eb6e
@ -305,21 +305,21 @@ if ($mode == 'submit' || $mode == 'refresh')
|
||||
// calculate the percent
|
||||
if ($session_posts_processing > 0)
|
||||
{
|
||||
$session_percent = ($session_posts_processed / $session_posts_processing) * 100;
|
||||
}
|
||||
$session_percent = ($session_posts_processed / $session_posts_processing) * 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
$session_percent = 100;
|
||||
}
|
||||
$session_percent = 100;
|
||||
}
|
||||
|
||||
if ($total_posts > 0)
|
||||
if ($total_posts > 0)
|
||||
{
|
||||
$total_percent = ($total_posts_processed / $total_posts) * 100;
|
||||
}
|
||||
$total_percent = ($total_posts_processed / $total_posts) * 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
$total_percent = 100;
|
||||
}
|
||||
$total_percent = 100;
|
||||
}
|
||||
|
||||
// get the db sizes
|
||||
list($search_data_size, $search_index_size, $search_tables_size) = get_db_sizes();
|
||||
@ -337,12 +337,12 @@ if ($mode == 'submit' || $mode == 'refresh')
|
||||
$session_time = $last_session_data['session_time'];
|
||||
if ($last_session_data['session_cycles'] > 0)
|
||||
{
|
||||
$session_average_cycle_time = round($session_time / $last_session_data['session_cycles']);
|
||||
}
|
||||
$session_average_cycle_time = round($session_time / $last_session_data['session_cycles']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$session_average_cycle_time = 0;
|
||||
}
|
||||
$session_average_cycle_time = 0;
|
||||
}
|
||||
$session_estimated_time = round($session_time * (100 / $session_percent)) - $session_time;
|
||||
|
||||
// create the percent boxes
|
||||
@ -575,8 +575,8 @@ function get_total_posts ($mode = 'after', $post_id = 0)
|
||||
|
||||
if ($totalPosts < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $totalPosts;
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ if ($tr_cfg['gold_silver_enabled'] && $down_add)
|
||||
// Freeleech
|
||||
if ($tr_cfg['freeleech'] && $down_add)
|
||||
{
|
||||
$down_add = 0;
|
||||
$down_add = 0;
|
||||
}
|
||||
|
||||
// Insert/update peer info
|
||||
|
@ -136,7 +136,7 @@ $tr_cfg = array(
|
||||
'gold_silver_enabled' => true, // при включенном gold_silver_enabled нужно отключить freeleech.
|
||||
'retracker' => true,
|
||||
'retracker_host' => 'http://retracker.local/announce',
|
||||
'freeleech' => false, // при включенном freeleech нужно отключить gold_silver_enabled.
|
||||
'freeleech' => false, // при включенном freeleech нужно отключить gold_silver_enabled.
|
||||
);
|
||||
|
||||
$bb_cfg['show_dl_status_in_search'] = true;
|
||||
|
@ -2567,27 +2567,27 @@ function pad_with_space ($str)
|
||||
|
||||
function create_magnet ($infohash, $auth_key)
|
||||
{
|
||||
global $bb_cfg, $images, $lang, $userdata;
|
||||
global $bb_cfg, $images, $lang, $userdata;
|
||||
|
||||
if (IS_GUEST && $bb_cfg['bt_tor_browse_only_reg'])
|
||||
{
|
||||
$passkey = '';
|
||||
}
|
||||
elseif (empty($auth_key))
|
||||
{
|
||||
require(INC_DIR .'functions_torrent.php');
|
||||
if (!$passkey = generate_passkey($userdata['user_id'], true))
|
||||
{
|
||||
bb_die($lang['PASSKEY_ERR_EMPTY']);
|
||||
}
|
||||
$auth_key = $passkey;
|
||||
}
|
||||
else
|
||||
{
|
||||
$passkey = $auth_key;
|
||||
}
|
||||
if (IS_GUEST && $bb_cfg['bt_tor_browse_only_reg'])
|
||||
{
|
||||
$passkey = '';
|
||||
}
|
||||
elseif (empty($auth_key))
|
||||
{
|
||||
require(INC_DIR .'functions_torrent.php');
|
||||
if (!$passkey = generate_passkey($userdata['user_id'], true))
|
||||
{
|
||||
bb_die($lang['PASSKEY_ERR_EMPTY']);
|
||||
}
|
||||
$auth_key = $passkey;
|
||||
}
|
||||
else
|
||||
{
|
||||
$passkey = $auth_key;
|
||||
}
|
||||
|
||||
$passkey_url = $passkey ? "?{$bb_cfg['passkey_key']}=$auth_key" : '';
|
||||
$passkey_url = $passkey ? "?{$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>';
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ if (!defined('BB_ROOT')) die(basename(__FILE__));
|
||||
|
||||
function update_forum_feed ($forum_id, $forum_data)
|
||||
{
|
||||
global $bb_cfg, $lang;
|
||||
global $bb_cfg, $lang;
|
||||
$file_path = $bb_cfg['atom']['path'] .'/f/'. $forum_id .'.atom';
|
||||
$select_tor_sql = $join_tor_sql = '';
|
||||
if ($forum_id == 0) $forum_data['forum_name'] = (isset($lang['ATOM_GLOBAL_FEED']) ? $lang['ATOM_GLOBAL_FEED'] : $bb_cfg['server_name']);
|
||||
@ -121,7 +121,7 @@ function update_user_feed ($user_id, $username)
|
||||
|
||||
function create_atom ($file_path, $mode, $id, $title, $topics)
|
||||
{
|
||||
global $lang;
|
||||
global $lang;
|
||||
$dir = dirname($file_path);
|
||||
if (!file_exists($dir))
|
||||
{
|
||||
@ -137,11 +137,11 @@ function create_atom ($file_path, $mode, $id, $title, $topics)
|
||||
}
|
||||
$atom = "";
|
||||
$atom .= "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
|
||||
$atom .= "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:base=\"" . FULL_URL . "\">\n";
|
||||
$atom .= "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:base=\"" . FULL_URL . "\">\n";
|
||||
$atom .= "<title>$title</title>\n";
|
||||
$atom .= "<updated>". $date ."T$time+00:00</updated>\n";
|
||||
$atom .= "<id>tag:rto.feed,2000:/$mode/$id</id>\n";
|
||||
$atom .= "<link href=\"" . FULL_URL . "\" />\n";
|
||||
$atom .= "<link href=\"" . FULL_URL . "\" />\n";
|
||||
foreach ($topics as $topic)
|
||||
{
|
||||
$topic_id = $topic['topic_id'];
|
||||
|
@ -595,17 +595,17 @@ class user_common
|
||||
|
||||
if (!defined('LANG_DIR')) define('LANG_DIR', DEFAULT_LANG_DIR);
|
||||
|
||||
/** Temporary place source language to the global */
|
||||
$lang = array();
|
||||
require(ENGLISH_LANG_DIR .'main.php');
|
||||
$source_lang = $lang;
|
||||
unset($lang);
|
||||
/** Temporary place source language to the global */
|
||||
$lang = array();
|
||||
require(ENGLISH_LANG_DIR .'main.php');
|
||||
$source_lang = $lang;
|
||||
unset($lang);
|
||||
|
||||
/** Place user language to the global */
|
||||
global $lang;
|
||||
/** Place user language to the global */
|
||||
global $lang;
|
||||
require(LANG_DIR .'main.php');
|
||||
setlocale(LC_ALL, isset($bb_cfg['lang'][$this->data['user_lang']]['locale']) ? $bb_cfg['lang'][$this->data['user_lang']]['locale'] : 'en_US.UTF-8');
|
||||
$lang += $source_lang;
|
||||
$lang += $source_lang;
|
||||
|
||||
$theme = setup_style();
|
||||
$DeltaTime = new Date_Delta();
|
||||
|
@ -255,7 +255,7 @@ class Template
|
||||
|
||||
$L =& $lang;
|
||||
$V =& $this->vars;
|
||||
$SL =& $source_lang;
|
||||
$SL =& $source_lang;
|
||||
|
||||
if ($filename)
|
||||
{
|
||||
@ -938,7 +938,7 @@ class Template
|
||||
$code = str_replace($search, $replace, $code);
|
||||
}
|
||||
// This will handle the remaining root-level varrefs
|
||||
$code = preg_replace('#\{(L_([a-z0-9\-_]+?))\}#i', '<?php echo isset($L[\'$2\']) ? $L[\'$2\'] : (isset($SL[\'$2\']) ? $SL[\'$2\'] : $V[\'$1\']); ?>', $code);
|
||||
$code = preg_replace('#\{(L_([a-z0-9\-_]+?))\}#i', '<?php echo isset($L[\'$2\']) ? $L[\'$2\'] : (isset($SL[\'$2\']) ? $SL[\'$2\'] : $V[\'$1\']); ?>', $code);
|
||||
$code = preg_replace('#\{(\$[a-z_][a-z0-9_$\->\'\"\.\[\]]*?)\}#i', '<?php echo isset($1) ? $1 : \'\'; ?>', $code);
|
||||
$code = preg_replace('#\{(\#([a-z_][a-z0-9_]*?))\}#i', '<?php echo defined(\'$2\') ? $2 : \'\'; ?>', $code);
|
||||
$code = preg_replace('#\{([a-z0-9\-_]+?)\}#i', '<?php echo isset($V[\'$1\']) ? $V[\'$1\'] : \'\'; ?>', $code);
|
||||
|
Loading…
Reference in New Issue
Block a user