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']);