feat: Added ability to hide BitTorrent client in peers list (#1890)

* feat: Added ability to hide peer torrent client

* Update displaying_torrent.php

* Update functions.php

* Update register.php

* Updated
This commit is contained in:
Roman Kelesidis 2025-05-04 10:38:38 +03:00 committed by GitHub
commit f5d65b8911
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 39 additions and 22 deletions

View file

@ -301,7 +301,7 @@ if ($tor_reged && $tor_info) {
$sql = "SELECT
tr.user_id, tr.ip, tr.ipv6, tr.port, tr.peer_id, tr.uploaded, tr.downloaded, tr.remain,
tr.seeder, tr.releaser, tr.speed_up, tr.speed_down, tr.update_time,
tr.complete_percent, u.username, u.user_rank
tr.complete_percent, u.username, u.user_rank, u.user_opt
FROM " . BB_BT_TRACKER . " tr
LEFT JOIN " . BB_USERS . " u ON u.user_id = tr.user_id
WHERE tr.topic_id = $tor_id
@ -455,10 +455,17 @@ if ($tor_reged && $tor_info) {
$row_bgr = ($change_peers_bgr_over) ? " class=\"$bgr_class\" onmouseover=\"this.className='$bgr_class_over';\" onmouseout=\"this.className='$bgr_class';\"" : '';
$tr[$x]++;
$peerTorrentClient = $lang['UNKNOWN'];
if (IS_AM || $peer['user_id'] == $userdata['user_id'] || !bf($peer['user_opt'], 'user_opt', 'user_hide_torrent_client')) {
if (isset($peer['peer_id'])) {
$peerTorrentClient = get_user_torrent_client($peer['peer_id']);
}
}
$template->assign_block_vars("$x_full.$x_row", [
'ROW_BGR' => $row_bgr,
'NAME' => ($peer['update_time']) ? $name : "<s>$name</s>",
'PEER_ID' => isset($peer['peer_id']) ? get_user_torrent_client($peer['peer_id']) : $lang['UNKNOWN'],
'PEER_ID' => $peerTorrentClient,
'COUNTRY' => render_flag(infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])['countryCode'], false),
'COMPL_PRC' => $compl_perc,
'UP_TOTAL' => ($max_up_id[$x] == $pid) ? "<b>$up_tot</b>" : $up_tot,