mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
r543
Фикс неработоспособности magnet-ссылок при выбранном типе анонсера xbt. Спасибо Matt Brown. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@543 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
d16afb456d
commit
0fa08eb2e6
2 changed files with 34 additions and 24 deletions
|
@ -56,7 +56,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'] = '09-08-2013';
|
||||
$bb_cfg['tp_release_state'] = 'R542';
|
||||
$bb_cfg['tp_release_state'] = 'R543';
|
||||
|
||||
// Database
|
||||
$charset = 'utf8';
|
||||
|
|
|
@ -2670,9 +2670,19 @@ function pad_with_space ($str)
|
|||
|
||||
function create_magnet($infohash, $auth_key, $logged_in)
|
||||
{
|
||||
global $bb_cfg, $_GET, $images;
|
||||
global $bb_cfg, $_GET, $userdata, $images;
|
||||
|
||||
if ($bb_cfg['announce_type'] == 'xbt')
|
||||
{
|
||||
$passkey = substr('00000000'. dechex($userdata['user_id']), -8) . substr(sha1($bb_cfg['torrent_pass_private_key'] .' '. $auth_key .' '. $userdata['user_id'] .' '. $infohash), 0, 24);
|
||||
$announce = $bb_cfg['announce_xbt'] .'/'. $passkey .'/announce';
|
||||
return '<a href="magnet:?xt=urn:btih:'. bin2hex($infohash) .'&tr='. urlencode($announce) .'"><img src="'. $images['icon_magnet'] .'" width="12" height="12" border="0" /></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$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>';
|
||||
}
|
||||
}
|
||||
|
||||
function get_avatar ($avatar, $type, $allow_avatar = true, $height = '', $width = '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue