Minor improvements (#868)

* Minor improvements

* Update viewforum.php

* Updated
This commit is contained in:
Roman Kelesidis 2023-08-27 20:05:27 +07:00 committed by GitHub
commit 9b43d144a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 20 additions and 90 deletions

View file

@ -799,10 +799,6 @@ function generate_user_info($row, bool $group_mod = false): array
function get_bt_userdata($user_id)
{
if (!\TorrentPier\Legacy\Torrent::getPasskey($user_id)) {
return false;
}
if (!$btu = CACHE('bb_cache')->get('btu_' . $user_id)) {
$btu = DB()->fetch_row("
SELECT bt.*, SUM(tr.speed_up) AS speed_up, SUM(tr.speed_down) AS speed_down
@ -1761,11 +1757,11 @@ function decode_text_match($txt)
*
* @param string $infohash
* @param string $infohash_v2
* @param string|bool $auth_key
* @param string $auth_key
*
* @return string
*/
function create_magnet(string $infohash, string $infohash_v2, $auth_key): string
function create_magnet(string $infohash, string $infohash_v2, string $auth_key): string
{
global $bb_cfg, $images;
@ -1774,11 +1770,6 @@ function create_magnet(string $infohash, string $infohash_v2, $auth_key): string
return false;
}
// Hasn't passkey
if (!$auth_key) {
return false;
}
return '<a href="magnet:?xt=urn:btih:' . bin2hex($infohash) . (!empty($infohash_v2) ? '&xt=urn:btmh:1220' . bin2hex($infohash_v2) : '') . '&tr=' . urlencode($bb_cfg['bt_announce_url'] . "?{$bb_cfg['passkey_key']}=$auth_key") . '"><img src="' . $images['icon_magnet'] . '" width="12" height="12" border="0" /></a>';
}