mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
feat: Added ability to hide peer country in peer list (#1891)
* feat: Added ability to hide peer country in peer list * Update displaying_torrent.php * Update displaying_torrent.php * Updated * Update usercp_register.tpl * Update main.php * Update functions.php
This commit is contained in:
parent
f5d65b8911
commit
2555ebce47
5 changed files with 30 additions and 3 deletions
|
@ -462,11 +462,22 @@ if ($tor_reged && $tor_info) {
|
|||
}
|
||||
}
|
||||
|
||||
$peerCountry = $lang['UNKNOWN'];
|
||||
if (IS_AM || $peer['user_id'] == $userdata['user_id'] || !bf($peer['user_opt'], 'user_opt', 'user_hide_peer_country')) {
|
||||
if ($port !== false && $ip !== false) {
|
||||
if ($infoByIP = infoByIP($ip, $port)) {
|
||||
if (isset($infoByIP['countryCode'])) {
|
||||
$peerCountry = render_flag($infoByIP['countryCode']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_block_vars("$x_full.$x_row", [
|
||||
'ROW_BGR' => $row_bgr,
|
||||
'NAME' => ($peer['update_time']) ? $name : "<s>$name</s>",
|
||||
'PEER_ID' => $peerTorrentClient,
|
||||
'COUNTRY' => render_flag(infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])['countryCode'], false),
|
||||
'COUNTRY' => $peerCountry,
|
||||
'COMPL_PRC' => $compl_perc,
|
||||
'UP_TOTAL' => ($max_up_id[$x] == $pid) ? "<b>$up_tot</b>" : $up_tot,
|
||||
'DOWN_TOTAL' => ($max_down_id[$x] == $pid) ? "<b>$down_tot</b>" : $down_tot,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue