From d9ec26016702caba02a17e13267eb3aca522bd66 Mon Sep 17 00:00:00 2001 From: glix08 Date: Wed, 7 Aug 2013 21:12:38 +0000 Subject: [PATCH] r540 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправление ошибки SEED_COUNT (благодарность Phoenix за предложенный способ решения). Переименование пользователя-гостя. Упрощение логики файла подключения модулей профиля. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@540 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- install/sql/mysql.sql | 4 +-- upload/attach_mod/displaying_torrent.php | 1 + upload/callseed.php | 4 +-- upload/config.php | 4 +-- upload/profile.php | 25 +++++++------------ .../templates/default/viewtopic_torrent.tpl | 4 +-- 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index 073378174..4a164a58d 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -1469,7 +1469,7 @@ CREATE TABLE IF NOT EXISTS `bb_users` ( -- Дамп данных таблицы `bb_users` -- -INSERT INTO `bb_users` VALUES (-1, 0, 'Anonymous', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 5, 0.00, '', 0, 0, 0, 0, 0, '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); +INSERT INTO `bb_users` VALUES (-1, 0, 'Guest', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 5, 0.00, '', 0, 0, 0, 0, 0, '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); INSERT INTO `bb_users` VALUES (2, 1, 'admin', 'c3284d0f94606de1fd2af172aba15bf3', 0, 0, '0', 0, '0', 1, 1, 4.00, '', 0, 0, 0, 304, 1, '', 1, 0, 0, 0, 'admin@admin.com', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); INSERT INTO `bb_users` VALUES (-746, 0, 'bot', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 144, 0, 'bot.gif', 1, 0, 0, 0, 'bot@bot.bot', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); @@ -1660,4 +1660,4 @@ CREATE TABLE IF NOT EXISTS `xbt_scrape_log` ( `uid` int(11) NOT NULL DEFAULT '0', `mtime` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/upload/attach_mod/displaying_torrent.php b/upload/attach_mod/displaying_torrent.php index be643bad5..7c6f9ff92 100644 --- a/upload/attach_mod/displaying_torrent.php +++ b/upload/attach_mod/displaying_torrent.php @@ -602,4 +602,5 @@ $template->assign_vars(array( 'SEED_EXIST' => ($seeders || defined('SEEDER_EXIST')), 'LEECH_EXIST' => ($leechers || defined('LEECHER_EXIST')), 'TOR_HELP_LINKS' => $bb_cfg['tor_help_links'], + 'CALL_SEED' => ($bb_cfg['callseed'] && $tor_reged && !isset($bb_cfg['tor_no_tor_act'][$tor_info['tor_status']])), )); \ No newline at end of file diff --git a/upload/callseed.php b/upload/callseed.php index 87cfec2b4..197c985e9 100644 --- a/upload/callseed.php +++ b/upload/callseed.php @@ -100,8 +100,8 @@ function call_seed($topic_id, $t_info, $to_user_id) if ($msg_error == "OK") { $sql = "SELECT seeders, leechers FROM ". BB_BT_TRACKER_SNAP ." WHERE topic_id = $topic_id LIMIT 1"; - $row = DB()->fetch_row($sql); - if ($row['seeders'] <= 2) + $row = DB()->fetch_row($sql); + if ($row['seeders'] <= 2) { $sql = "SELECT user_id FROM ". BB_BT_DLSTATUS ." WHERE topic_id = $topic_id AND user_id != {$userdata['user_id']}"; diff --git a/upload/config.php b/upload/config.php index 771ab9559..3630e20f9 100644 --- a/upload/config.php +++ b/upload/config.php @@ -55,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 (unstable)'; -$bb_cfg['tp_release_date'] = '07-08-2013'; -$bb_cfg['tp_release_state'] = 'R539'; +$bb_cfg['tp_release_date'] = '08-08-2013'; +$bb_cfg['tp_release_state'] = 'R540'; // Database $charset = 'utf8'; diff --git a/upload/profile.php b/upload/profile.php index 1931741d6..f493f02bb 100644 --- a/upload/profile.php +++ b/upload/profile.php @@ -1,18 +1,14 @@ session_start(); -// session id check -$sid = request_var('sid', ''); -$mode = request_var('mode', ''); -$mode = htmlspecialchars($mode); +$mode = (string) @$_REQUEST['mode']; switch ($mode) { @@ -22,10 +18,7 @@ switch ($mode) case 'register': case 'editprofile': - if (IS_GUEST && $mode == 'editprofile' ) - { - login_redirect(); - } + if (IS_GUEST && $mode == 'editprofile') login_redirect(); require(INC_DIR . 'ucp/usercp_register.php'); break; @@ -41,23 +34,23 @@ switch ($mode) case 'email': require(INC_DIR .'ucp/usercp_email.php'); break; - + case 'bonus': if (IS_GUEST) login_redirect(); require(INC_DIR . 'ucp/usercp_bonus.php'); break; - + case 'watch': if (IS_GUEST) login_redirect(); require(INC_DIR . 'ucp/usercp_topic_watch.php'); break; - + case 'viewdraft': require(INC_DIR . 'ucp/usercp_viewdraft.php'); - break; - + break; + default: bb_die('Invalid mode'); -} +} \ No newline at end of file diff --git a/upload/templates/default/viewtopic_torrent.tpl b/upload/templates/default/viewtopic_torrent.tpl index d5f638b8f..6c41b71f4 100644 --- a/upload/templates/default/viewtopic_torrent.tpl +++ b/upload/templates/default/viewtopic_torrent.tpl @@ -79,7 +79,7 @@ $(document).ready(function(){ {L_SPMODE_FULL} - + @@ -237,7 +237,7 @@ $(document).ready(function(){ -
 
+