Yoursite - BitTorrent $c_name) { echo '' . $c_name . ' · '; } ?> Upload
' . $torrent[3] . ''; echo '
'; echo 'Name:
' . $torrent[3] . '
'; echo 'Size:
' . number_format($torrent[2]/1024/1024) . 'Mb
'; echo 'Hash:
' . $torrent[0] . '
'; echo 'Added:
' . ago(filemtime('data/' . $infohash . '.torrent')) . '
'; //if(isset($t["creation date"])) not working ?? // { //echo 'Created: ' . ago($t["creation date"]) . '
'; // } echo 'Category:
' . $c[intval($torrent[1])] . '
'; $bencode = new BEncodeLib(); $t = $bencode->bdecode($torrent_binary); echo ''; if(file_exists('data/scrape_' . $infohash)) { echo 'Tracker - Seeders : Leechers Updated
    '; $stats = file('data/scrape_' . $infohash); echo '
  • ' . $t['announce'] . ' - UL: ' . number_format(trim($stats[0])) . ' DL: ' . number_format(trim($stats[1])) . ' updated ' . ago(filemtime('data/scrape_' . $infohash)) . '
'; } else { echo 'Tracker:
  • ' . $t['announce'] . '
'; } if(isset($t['announce-list'])) { echo 'Backup Trackers:
    '; foreach($t['announce-list'] as $a1) { foreach($a1 as $a2) { echo '
  • ' . $a2; } } echo '
'; } if(isset($t['comment'])) { echo 'Comment:
' . htmlspecialchars($t['comment']) . '
'; } echo 'Files:
    '; if(isset($t['info']['files']) && count($t['info']['files'])) { foreach($t['info']['files'] as $file) { echo '
  • ' . htmlspecialchars($file['path'][intval(count($file['path']) - 1)]) . ' · ' . number_format($file['length']/1024/1024) . ' Mb'; } } else { echo '
  • ' . htmlspecialchars($t['info']['name']) . ' · ' . number_format($t['info']['length']/1024/1024) . ' Mb'; } echo '
'; echo '
'; //print_r($t); } } else { if(isset($_GET['category']) && intval($_GET['category'])) { $cat = intval($_GET['category']); } else { $cat = false; } $no_torrents = 0; if($cat) echo '
' . $c[$cat] . ' Torrents
'; else echo '
New additions
'; echo '
'; $torrents = file('data/meta.txt'); $torrents = array_reverse(array_slice($torrents, -50)); foreach($torrents as $torrent) { $torrent = explode('`', $torrent); $hash = $torrent[0]; $name = $torrent[3]; $category = intval($torrent[1]); if($cat && $category != $cat) { continue; } $size = intval($torrent[2]); $stats = @file('data/scrape_' . $hash); if($stats != false) { $ul = intval(trim($stats[0])); $dl = intval(trim($stats[1])); } echo ''; if(isset($ul) && isset($dl)) { echo ''; } else { echo ''; } echo ''; unset($torrent, $hash, $name, $size, $stats, $ul, $dl, $category); $no_torrents++; } if($no_torrents == 0) { echo ''; } echo '
NameSizeSeedsLeechers
' . $name . ' '; if($cat == false) echo '(' . $c[$category] . ') '; echo '[DL]' . number_format($size/1024/1024) . ' Mb' . number_format($ul) . '' . number_format($dl) . 'No Stats
No torrents
'; } ?>
Powered by Defiant Torrent Directory