|
@@ -596,21 +596,26 @@ $ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGr
|
596
|
596
|
|
597
|
597
|
$SnatchedTorrentClass = $Data['IsSnatched'] ? ' snatched_torrent' : '';
|
598
|
598
|
$TorrentDL = "torrents.php?action=download&id=".$TorrentID."&authkey=".$LoggedUser['AuthKey']."&torrent_pass=".$LoggedUser['torrent_pass'];
|
599
|
|
- if (!($TorrentFileName = $Cache->get_value('torrent_file_name_'.$TorrentID))) {
|
600
|
|
- $TorrentFile = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
|
601
|
|
- $Tor = new BencodeTorrent($TorrentFile);
|
602
|
|
- $TorrentFileName = $Tor->Dec['info']['name'];
|
603
|
|
- $Cache->cache_value('torrent_file_name_'.$TorrentID, $TorrentFileName);
|
|
599
|
+
|
|
600
|
+ if (!empty(G::$LoggedUser) && (G::$LoggedUser['ShowMagnets'] ?? false)) {
|
|
601
|
+ if (!($TorrentFileName = $Cache->get_value('torrent_file_name_'.$TorrentID))) {
|
|
602
|
+ $TorrentFile = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
|
|
603
|
+ $Tor = new BencodeTorrent($TorrentFile);
|
|
604
|
+ $TorrentFileName = $Tor->Dec['info']['name'];
|
|
605
|
+ $Cache->cache_value('torrent_file_name_'.$TorrentID, $TorrentFileName);
|
|
606
|
+ }
|
|
607
|
+ $TorrentMG = "magnet:?dn=".rawurlencode($TorrentFileName)."&xt=urn:btih:".$Data['info_hash']."&as=https://".SITE_DOMAIN."/".str_replace('&','%26',$TorrentDL)."&tr=".implode("/".$LoggedUser['torrent_pass']."/announce&tr=",ANNOUNCE_URLS[0])."/".$LoggedUser['torrent_pass']."/announce&xl=".$Data['Size'];
|
604
|
608
|
}
|
605
|
|
- $TorrentMG = "magnet:?dn=".rawurlencode($TorrentFileName)."&xt=urn:btih:".$Data['info_hash']."&as=https://".SITE_DOMAIN."/".str_replace('&','%26',$TorrentDL)."&tr=".implode("/".$LoggedUser['torrent_pass']."/announce&tr=",ANNOUNCE_URLS[0])."/".$LoggedUser['torrent_pass']."/announce&xl=".$Data['Size'];
|
606
|
609
|
|
607
|
610
|
?>
|
608
|
611
|
<tr class="group_torrent groupid_<?=$GroupID?> <?=$SnatchedTorrentClass . $SnatchedGroupClass . (!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1 ? ' hidden' : '')?>">
|
609
|
612
|
<td colspan="3">
|
610
|
613
|
<span>
|
611
|
614
|
[ <a href="<?=$TorrentDL?>" class="tooltip" title="Download"><?=$Data['HasFile'] ? 'DL' : 'Missing'?></a>
|
|
615
|
+<? if (isset($TorrentMG)) { ?>
|
612
|
616
|
| <a href="<?=$TorrentMG?>" class="tooltip" title="Magnet Link">MG</a>
|
613
|
|
-<? if (Torrents::can_use_token($Data)) { ?>
|
|
617
|
+<? }
|
|
618
|
+ if (Torrents::can_use_token($Data)) { ?>
|
614
|
619
|
| <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" class="tooltip" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
615
|
620
|
<? } ?>
|
616
|
621
|
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" class="tooltip" title="Report">RP</a> ]
|
|
@@ -668,13 +673,16 @@ $ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGr
|
668
|
673
|
}
|
669
|
674
|
$SnatchedTorrentClass = $Data['IsSnatched'] ? ' snatched_torrent' : '';
|
670
|
675
|
$TorrentDL = "torrents.php?action=download&id=".$TorrentID."&authkey=".$LoggedUser['AuthKey']."&torrent_pass=".$LoggedUser['torrent_pass'];
|
671
|
|
- if (!($TorrentFileName = $Cache->get_value('torrent_file_name_'.$TorrentID))) {
|
672
|
|
- $TorrentFile = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
|
673
|
|
- $Tor = new BencodeTorrent($TorrentFile);
|
674
|
|
- $TorrentFileName = $Tor->Dec['info']['name'];
|
675
|
|
- $Cache->cache_value('torrent_file_name_'.$TorrentID, $TorrentFileName);
|
|
676
|
+
|
|
677
|
+ if (!empty(G::$LoggedUser) && (G::$LoggedUser['ShowMagnets'] ?? false)) {
|
|
678
|
+ if (!($TorrentFileName = $Cache->get_value('torrent_file_name_'.$TorrentID))) {
|
|
679
|
+ $TorrentFile = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
|
|
680
|
+ $Tor = new BencodeTorrent($TorrentFile);
|
|
681
|
+ $TorrentFileName = $Tor->Dec['info']['name'];
|
|
682
|
+ $Cache->cache_value('torrent_file_name_'.$TorrentID, $TorrentFileName);
|
|
683
|
+ }
|
|
684
|
+ $TorrentMG = "magnet:?dn=".rawurlencode($TorrentFileName)."&xt=urn:btih:".$Data['info_hash']."&as=https://".SITE_DOMAIN."/".str_replace('&','%26',$TorrentDL)."&tr=".implode("/".$LoggedUser['torrent_pass']."/announce&tr=",ANNOUNCE_URLS[0])."/".$LoggedUser['torrent_pass']."/announce&xl=".$Data['Size'];
|
676
|
685
|
}
|
677
|
|
- $TorrentMG = "magnet:?dn=".rawurlencode($TorrentFileName)."&xt=urn:btih:".$Data['info_hash']."&as=https://".SITE_DOMAIN."/".str_replace('&','%26',$TorrentDL)."&tr=".implode("/".$LoggedUser['torrent_pass']."/announce&tr=",ANNOUNCE_URLS[0])."/".$LoggedUser['torrent_pass']."/announce&xl=".$Data['Size'];
|
678
|
686
|
?>
|
679
|
687
|
<tr class="torrent<?=$SnatchedTorrentClass . $SnatchedGroupClass?>">
|
680
|
688
|
<? if ($GroupResults) { ?>
|
|
@@ -688,8 +696,10 @@ $ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGr
|
688
|
696
|
<div class="float_right">
|
689
|
697
|
<span>
|
690
|
698
|
[ <a href="<?=$TorrentDL?>" class="tooltip" title="Download">DL</a>
|
|
699
|
+<? if (isset($TorrentMG)) { ?>
|
691
|
700
|
| <a href="<?=$TorrentMG?>" class="tooltip" title="Magnet Link">MG</a>
|
692
|
|
-<? if (Torrents::can_use_token($Data)) { ?>
|
|
701
|
+<? }
|
|
702
|
+ if (Torrents::can_use_token($Data)) { ?>
|
693
|
703
|
| <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" class="tooltip" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
694
|
704
|
<? } ?>
|
695
|
705
|
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" class="tooltip" title="Report">RP</a> ]
|