mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
feat(torrent): Bring back old torrent file naming (#1783)
* feat(torrent): Bring back old torrent file naming * Update displaying_torrent.php * Update Torrent.php
This commit is contained in:
parent
d461b39e18
commit
314c592aff
3 changed files with 13 additions and 4 deletions
|
@ -79,7 +79,7 @@ $tor_auth_del = ($tor_auth && $tor_reged);
|
|||
$tracker_link = ($tor_reged) ? $lang['BT_REG_YES'] : $lang['BT_REG_NO'];
|
||||
|
||||
$download_link = DL_URL . $attach_id;
|
||||
$description = ($comment) ?: preg_replace("#.torrent$#i", '', $display_name);
|
||||
$description = ($comment) ?: preg_replace("#" . "." . TORRENT_EXT . "$#i", '', $display_name);
|
||||
|
||||
if ($tor_auth_reg || $tor_auth_del) {
|
||||
$reg_tor_url = '<a class="txtb" href="#" onclick="ajax.exec({ action: \'change_torrent\', attach_id : ' . $attach_id . ', type: \'reg\'}); return false;">' . $lang['BT_REG_ON_TRACKER'] . '</a>';
|
||||
|
@ -88,7 +88,11 @@ if ($tor_auth_reg || $tor_auth_del) {
|
|||
$tracker_link = ($tor_reged) ? $unreg_tor_url : $reg_tor_url;
|
||||
}
|
||||
|
||||
$display_name = $t_data['topic_title'] . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT;
|
||||
if ($bb_cfg['tracker']['use_old_torrent_name_format']) {
|
||||
$display_name = '[' . $bb_cfg['server_name'] . '].t' . $bt_topic_id . '.' . TORRENT_EXT;
|
||||
} else {
|
||||
$display_name = $t_data['topic_title'] . ' [' . $bb_cfg['server_name'] . '-' . $bt_topic_id . ']' . '.' . TORRENT_EXT;
|
||||
}
|
||||
|
||||
if (!$tor_reged) {
|
||||
$template->assign_block_vars('postrow.attach.tor_not_reged', [
|
||||
|
|
|
@ -736,7 +736,8 @@ $bb_cfg['tracker'] = [
|
|||
'gold_silver_enabled' => true, // golden / silver days mode (If enabled, then disable "freeleech")
|
||||
'hybrid_stat_protocol' => 1, // For hybrid torrents there are two identical requests sent by clients, for counting stats we gotta choose one, you can change this to '2' in future, when v1 protocol is outdated
|
||||
'disabled_v1_torrents' => false, // disallow registration of v1-only torrents, for future implementations where client will use v2 only and there won't be need for v1, thus relieving tracker
|
||||
'disabled_v2_torrents' => false // disallow registration of v2-only torrents
|
||||
'disabled_v2_torrents' => false, // disallow registration of v2-only torrents
|
||||
'use_old_torrent_name_format' => false, // when enabled, the names of torrent files will have the classic format: [yoursite.com].txxx.torrent
|
||||
];
|
||||
|
||||
// Ratio settings
|
||||
|
|
|
@ -644,7 +644,11 @@ class Torrent
|
|||
// Send torrent
|
||||
$output = Bencode::encode($tor);
|
||||
|
||||
$dl_fname = html_ent_decode($topic_title) . ' [' . $bb_cfg['server_name'] . '-' . $topic_id . ']' . '.' . TORRENT_EXT;
|
||||
if ($bb_cfg['tracker']['use_old_torrent_name_format']) {
|
||||
$dl_fname = '[' . $bb_cfg['server_name'] . '].t' . $topic_id . '.' . TORRENT_EXT;
|
||||
} else {
|
||||
$dl_fname = html_ent_decode($topic_title) . ' [' . $bb_cfg['server_name'] . '-' . $topic_id . ']' . '.' . TORRENT_EXT;
|
||||
}
|
||||
|
||||
if (!empty($_COOKIE['explain'])) {
|
||||
$out = "attach path: $filename<br /><br />";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue