mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Added check $bb_cfg['magnet_links_enabled'] in create_magnet() (#996)
This commit is contained in:
parent
4180543576
commit
5316a9a61e
3 changed files with 8 additions and 4 deletions
|
@ -1849,7 +1849,11 @@ function decode_text_match($txt)
|
|||
*/
|
||||
function create_magnet(string $infohash, string $infohash_v2, string $auth_key, string $name): string
|
||||
{
|
||||
global $bb_cfg, $images;
|
||||
global $bb_cfg, $images, $lang;
|
||||
|
||||
if (!$bb_cfg['magnet_links_enabled']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only for registered users
|
||||
if (IS_GUEST && $bb_cfg['bt_tor_browse_only_reg']) {
|
||||
|
@ -1869,7 +1873,7 @@ function create_magnet(string $infohash, string $infohash_v2, string $auth_key,
|
|||
$magnet .= 'xt=urn:btmh:1220' . bin2hex($infohash_v2);
|
||||
}
|
||||
|
||||
return '<a href="' . $magnet . '&tr=' . urlencode($bb_cfg['bt_announce_url'] . "?{$bb_cfg['passkey_key']}=$auth_key") . '&dn=' . urlencode($name) . '"><img src="' . $images['icon_magnet'] . '" width="12" height="12" border="0" /></a>';
|
||||
return '<a title="' . $lang['MAGNET'] . '" href="' . $magnet . '&tr=' . urlencode($bb_cfg['bt_announce_url'] . "?{$bb_cfg['passkey_key']}=$auth_key") . '&dn=' . urlencode($name) . '"><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)
|
||||
|
|
|
@ -1083,7 +1083,7 @@ $lang['RELEASING'] = 'Self';
|
|||
$lang['SEEDING'] = 'Seed';
|
||||
$lang['LEECHING'] = 'Leech';
|
||||
$lang['IS_REGISTERED'] = 'Registered';
|
||||
$lang['MAGNET'] = 'Magnet';
|
||||
$lang['MAGNET'] = 'Magnet-link';
|
||||
|
||||
//torrent status mod
|
||||
$lang['TOR_STATUS'] = 'Status';
|
||||
|
|
|
@ -417,7 +417,7 @@ $(function(){
|
|||
<!-- ENDIF -->
|
||||
<td class="row4 small nowrap">
|
||||
<u>{tor.TOR_SIZE_RAW}</u>
|
||||
<!-- IF not tor.TOR_FROZEN --><a class="small tr-dl" title="{L_DOWNLOAD}" href="{DOWNLOAD_URL}{tor.ATTACH_ID}">{tor.TOR_SIZE}</a> <!-- IF MAGNET_LINKS --><span title="{L_MAGNET}">{tor.MAGNET}</span><!-- ENDIF --><!-- ELSE -->
|
||||
<!-- IF not tor.TOR_FROZEN --><a class="small tr-dl" title="{L_DOWNLOAD}" href="{DOWNLOAD_URL}{tor.ATTACH_ID}">{tor.TOR_SIZE}</a> <!-- IF MAGNET_LINKS -->{tor.MAGNET}<!-- ENDIF --><!-- ELSE -->
|
||||
{tor.TOR_SIZE}<!-- ENDIF -->
|
||||
</td>
|
||||
<td class="row4 seedmed" title="{tor.SEEDS_TITLE}"><b>{tor.SEEDS}</b></td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue