From 5e3fba174b450eae53ca04965f415c9fc9ad1763 Mon Sep 17 00:00:00 2001 From: glix08 Date: Fri, 2 Aug 2013 19:45:32 +0000 Subject: [PATCH] r531 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Фикс нотиса "Undefined variable: topic_id". Спасибо Lange за тестирование. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@531 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/config.php | 2 +- upload/includes/functions_torrent.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/upload/config.php b/upload/config.php index e1886bfa4..70b390d4b 100644 --- a/upload/config.php +++ b/upload/config.php @@ -57,7 +57,7 @@ $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'] = '02-08-2013'; -$bb_cfg['tp_release_state'] = 'R530'; +$bb_cfg['tp_release_state'] = 'R531'; // Database $charset = 'utf8'; diff --git a/upload/includes/functions_torrent.php b/upload/includes/functions_torrent.php index e3e986e33..79e874458 100644 --- a/upload/includes/functions_torrent.php +++ b/upload/includes/functions_torrent.php @@ -448,6 +448,15 @@ function send_torrent_with_passkey ($filename) } } + // Get $topic_id + $topic_id_sql = 'SELECT topic_id FROM ' . BB_POSTS . ' WHERE post_id = ' . (int) $post_id; + if (!($topic_id_result = DB()->sql_query($topic_id_sql))) + { + message_die(GENERAL_ERROR, 'Could not query post information', '', __LINE__, __FILE__, $topic_id_sql); + } + $topic_id_row = DB()->sql_fetchrow($topic_id_result); + $topic_id = $topic_id_row['topic_id']; + if (!$attachment['tracker_status']) { message_die(GENERAL_ERROR, $lang['PASSKEY_ERR_TOR_NOT_REG']);