diff --git a/CHANGELOG.md b/CHANGELOG.md index 5372853f1..e156c19e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ **Merged pull requests:** - Release 2.4.5 🍧️ ([belomaxorka](https://github.com/belomaxorka)) +- Show torrent's announcers list in `filelist.php` page [\#1708](https://github.com/torrentpier/torrentpier/pull/1708) ([belomaxorka](https://github.com/belomaxorka)) - [Configurable] Show magnet-links for guests [\#1712](https://github.com/torrentpier/torrentpier/pull/1712) ([belomaxorka](https://github.com/belomaxorka)) - Set `cursor: pointer;` for buttons, inputs (buttons) [\#1710](https://github.com/torrentpier/torrentpier/pull/1710), [\#1711](https://github.com/torrentpier/torrentpier/pull/1711) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#1705](https://github.com/torrentpier/torrentpier/pull/1705) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/filelist.php b/filelist.php index 1baa76c2a..b93d6566b 100644 --- a/filelist.php +++ b/filelist.php @@ -74,6 +74,7 @@ if (IS_GUEST && $torrent->isPrivate()) { bb_die($lang['BT_PRIVATE_TORRENT'], 403); } +// Get torrent files $files = $torrent->$t_version_field()->$t_files_field(); if ($meta_v1 && $meta_v2) { $files = new \RecursiveIteratorIterator($files); // Flatten the list @@ -95,11 +96,26 @@ foreach ($files as $file) { $torrent_name = !empty($t_name = $torrent->getName()) ? str_short(htmlCHR($t_name), 200) : $lang['UNKNOWN']; $torrent_size = humn_size($row['size'], 2); +// Get announcers list +$announcers_list = $torrent->getAnnounceList()->toArray(); +$announcers_count = 0; +foreach ($announcers_list as $announcer) { + $announcers_count++; + $row_class = ($announcers_count % 2) ? 'row1' : 'row2'; + $template->assign_block_vars('announcers', [ + 'ROW_NUMBER' => $announcers_count, + 'ROW_CLASS' => $row_class, + 'ANNOUNCER' => $announcer[0] + ]); +} + +// Output page $template->assign_vars([ 'PAGE_TITLE' => "$torrent_name (" . $torrent_size . ")", 'FILES_COUNT' => sprintf($lang['BT_FLIST_FILE_PATH'], declension(iterator_count($files), 'files')), 'TORRENT_CREATION_DATE' => (!empty($dt = $torrent->getCreationDate()) && is_numeric($creation_date = $dt->getTimestamp())) ? date('d-M-Y H:i (e)', $creation_date) : $lang['UNKNOWN'], 'TORRENT_CLIENT' => !empty($creator = $torrent->getCreatedBy()) ? htmlCHR($creator) : $lang['UNKNOWN'], + 'TORRENT_PRIVATE' => $torrent->isPrivate() ? $lang['YES'] : $lang['NO'], 'BTMR_NOTICE' => sprintf($lang['BT_FLIST_BTMR_NOTICE'], 'https://github.com/kovalensky/tmrr'), 'U_TOPIC' => TOPIC_URL . $topic_id, diff --git a/library/language/source/main.php b/library/language/source/main.php index 4fb6d622d..4aab2bcea 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -1370,12 +1370,17 @@ $lang['BT_REG_FAIL'] = 'Could not register torrent on tracker'; $lang['BT_REG_FAIL_SAME_HASH'] = 'Another torrent with same info_hash already registered'; $lang['BT_V1_ONLY_DISALLOWED'] = 'v1-only torrents have been disabled by the administrator at the moment, allowed: v2 and hybrids'; $lang['BT_V2_ONLY_DISALLOWED'] = 'v2-only torrents have been disabled by the administrator at the moment, allowed: v1 and hybrids'; +$lang['BT_FLIST'] = 'Files list'; $lang['BT_FLIST_LIMIT'] = 'Tracker settings do not allow to process lists with more than %d files. Current number is: %d'; $lang['BT_FLIST_BTMR_HASH'] = 'BTMR Hash'; $lang['BT_FLIST_BTMR_NOTICE'] = 'BitTorrent Merkle Root is a hash of a file embedded in torrents with BitTorrent v2 support, tracker users can extract, calculate them, also download deduplicated torrents using desktop tools such as Torrent Merkle Root Reader'; $lang['BT_FLIST_CREATION_DATE'] = 'Creation date'; +$lang['BT_IS_PRIVATE'] = 'Private torrent'; $lang['BT_FLIST_FILE_PATH'] = 'Path (%s)'; $lang['BT_FLIST_LINK_TITLE'] = 'File hashes | .torrent meta-info'; +$lang['BT_FLIST_ANNOUNCERS_LIST'] = 'Announcers list'; +$lang['BT_FLIST_ANNOUNCERS'] = 'Announcers'; +$lang['BT_FLIST_ANNOUNCERS_NOTICE'] = 'This list contains announcers of torrent file'; $lang['BT_UNREG_FROM_TRACKER'] = 'Remove from tracker'; $lang['BT_UNREGISTERED'] = 'Torrent unregistered'; $lang['BT_UNREGISTERED_ALREADY'] = 'Torrent already unregistered'; @@ -1720,7 +1725,6 @@ $lang['NOTICE'] = '!ATTENTION!'; $lang['COPY'] = 'The site does not give electronic versions of products, and is engaged only in a collecting and cataloguing of the references sent and published at a forum by our readers. If you are the legal owner of any submitted material and do not wish that the reference to it was in our catalogue, contact us and we shall immediately remove her. Files for an exchange on tracker are given by users of a site, and the administration does not bear the responsibility for their maintenance. The request to not fill in the files protected by copyrights, and also files of the illegal maintenance!'; // FILELIST -$lang['FILELIST'] = 'Filelist'; $lang['COLLAPSE'] = 'Collapse directory'; $lang['EXPAND'] = 'Expand'; $lang['SWITCH'] = 'Switch'; diff --git a/styles/templates/default/filelist.tpl b/styles/templates/default/filelist.tpl index 25f9a9cc1..4d0fe5a55 100644 --- a/styles/templates/default/filelist.tpl +++ b/styles/templates/default/filelist.tpl @@ -2,9 +2,35 @@ -
+
+

{L_BT_FLIST_ANNOUNCERS_LIST}

+ + + + + + + + + + + + + + + + + + + + +
#{L_BT_FLIST_ANNOUNCERS}
{announcers.ROW_NUMBER}{announcers.ANNOUNCER}
{L_BT_FLIST_ANNOUNCERS_NOTICE}
+
+ +

{L_BT_FLIST}

diff --git a/styles/templates/default/viewtopic_attach.tpl b/styles/templates/default/viewtopic_attach.tpl index 9590cd02f..707522011 100644 --- a/styles/templates/default/viewtopic_attach.tpl +++ b/styles/templates/default/viewtopic_attach.tpl @@ -172,7 +172,7 @@

{postrow.attach.tor_reged.S_UPLOAD_IMAGE}

{L_DOWNLOAD}

{postrow.attach.tor_reged.FILESIZE}

-

+