mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
Merge pull request #41 from warezzz/master
Исправления в поддержке Ocelot.
This commit is contained in:
parent
f84571f43b
commit
0e23f4702e
2 changed files with 29 additions and 17 deletions
|
@ -93,21 +93,25 @@ if ($tr_cfg['update_dlstat'])
|
||||||
");
|
");
|
||||||
|
|
||||||
// Update TOTAL user's dlstat
|
// Update TOTAL user's dlstat
|
||||||
DB()->query("
|
// This is not needed if Ocelot enabled. It's important.
|
||||||
UPDATE
|
if (!$bb_cfg['ocelot']['enabled'])
|
||||||
". BB_BT_USERS ." u,
|
{
|
||||||
". NEW_BB_BT_LAST_USERSTAT ." ub
|
DB()->query("
|
||||||
SET
|
UPDATE
|
||||||
u.u_up_total = u.u_up_total + ub.up_add,
|
". BB_BT_USERS ." u,
|
||||||
u.u_down_total = u.u_down_total + ub.down_add,
|
". NEW_BB_BT_LAST_USERSTAT ." ub
|
||||||
u.u_up_release = u.u_up_release + ub.release_add,
|
SET
|
||||||
u.u_up_bonus = u.u_up_bonus + ub.bonus_add,
|
u.u_up_total = u.u_up_total + ub.up_add,
|
||||||
u.up_today = u.up_today + ub.up_add,
|
u.u_down_total = u.u_down_total + ub.down_add,
|
||||||
u.down_today = u.down_today + ub.down_add,
|
u.u_up_release = u.u_up_release + ub.release_add,
|
||||||
u.up_release_today = u.up_release_today + ub.release_add,
|
u.u_up_bonus = u.u_up_bonus + ub.bonus_add,
|
||||||
u.up_bonus_today = u.up_bonus_today + ub.bonus_add
|
u.up_today = u.up_today + ub.up_add,
|
||||||
WHERE u.user_id = ub.user_id
|
u.down_today = u.down_today + ub.down_add,
|
||||||
");
|
u.up_release_today = u.up_release_today + ub.release_add,
|
||||||
|
u.up_bonus_today = u.up_bonus_today + ub.bonus_add
|
||||||
|
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("
|
||||||
|
|
|
@ -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";
|
||||||
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>';
|
|
||||||
|
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>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue