Merge pull request #41 from warezzz/master

Исправления в поддержке Ocelot.
This commit is contained in:
Exile 2015-01-22 01:28:49 +03:00
commit 0e23f4702e
2 changed files with 29 additions and 17 deletions

View file

@ -93,6 +93,9 @@ if ($tr_cfg['update_dlstat'])
"); ");
// Update TOTAL user's dlstat // Update TOTAL user's dlstat
// This is not needed if Ocelot enabled. It's important.
if (!$bb_cfg['ocelot']['enabled'])
{
DB()->query(" DB()->query("
UPDATE UPDATE
". BB_BT_USERS ." u, ". BB_BT_USERS ." u,
@ -108,6 +111,7 @@ if ($tr_cfg['update_dlstat'])
u.up_bonus_today = u.up_bonus_today + ub.bonus_add u.up_bonus_today = u.up_bonus_today + ub.bonus_add
WHERE u.user_id = ub.user_id WHERE u.user_id = ub.user_id
"); ");
}
// Delete from dl_list what exists in BUF but not exsits in NEW // Delete from dl_list what exists in BUF but not exsits in NEW
DB()->query(" DB()->query("

View file

@ -2341,10 +2341,18 @@ function pad_with_space ($str)
function create_magnet ($infohash, $auth_key, $logged_in) function create_magnet ($infohash, $auth_key, $logged_in)
{ {
global $bb_cfg, $_GET, $userdata, $images; global $bb_cfg, $_GET, $images;
$passkey_url = ((!$logged_in || isset($_GET['no_passkey'])) && $bb_cfg['bt_tor_browse_only_reg']) ? '' : "?{$bb_cfg['passkey_key']}=$auth_key"; $passkey_url = ((!$logged_in || isset($_GET['no_passkey'])) && $bb_cfg['bt_tor_browse_only_reg']) ? '' : "?{$bb_cfg['passkey_key']}=$auth_key";
if ($bb_cfg['ocelot']['enabled'])
{
return '<a href="magnet:?xt=urn:btih:'. bin2hex($infohash) .'&tr='. urlencode($bb_cfg['ocelot']['url'] .$auth_key. "/announce") .'"><img src="'. $images['icon_magnet'] .'" width="12" height="12" border="0" /></a>';
}
else
{
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>'; 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 set_die_append_msg ($forum_id = null, $topic_id = null, $group_id = null) function set_die_append_msg ($forum_id = null, $topic_id = null, $group_id = null)