mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
Update functions.php
This commit is contained in:
parent
e708ec2031
commit
93106f6a62
1 changed files with 12 additions and 12 deletions
|
@ -601,30 +601,30 @@ function bt_show_ip($ip, $port = '')
|
||||||
{
|
{
|
||||||
global $bb_cfg;
|
global $bb_cfg;
|
||||||
|
|
||||||
|
if (IS_AM) {
|
||||||
$ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($ip);
|
$ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($ip);
|
||||||
|
|
||||||
// Wrap IPv6 address in square brackets
|
// Wrap IPv6 address in square brackets
|
||||||
$port = bt_show_port($port);
|
if ($port && str_contains($ip, ':')) {
|
||||||
if (!empty($port) && str_contains($ip, ':')) {
|
$ip = "[$ip]";
|
||||||
$ip = "[$ip]:$port";
|
|
||||||
}
|
}
|
||||||
|
$ip .= $port ? ":$port" : '';
|
||||||
|
|
||||||
if (!$bb_cfg['bt_show_ip_only_moder'] || IS_AM) {
|
|
||||||
return $ip;
|
return $ip;
|
||||||
} else {
|
|
||||||
return \TorrentPier\Helpers\IPHelper::anonymizeIP($ip);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function bt_show_port($port): string
|
return $bb_cfg['bt_show_ip_only_moder'] ? false : \TorrentPier\Helpers\IPHelper::anonymizeIP($ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
function bt_show_port($port)
|
||||||
{
|
{
|
||||||
global $bb_cfg;
|
global $bb_cfg;
|
||||||
|
|
||||||
if (!$bb_cfg['bt_show_port_only_moder'] || IS_AM) {
|
if (IS_AM) {
|
||||||
return $port;
|
return $port;
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return $bb_cfg['bt_show_port_only_moder'] ? false : $port;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkbox_get_val(&$key, &$val, $default = 1, $on = 1, $off = 0)
|
function checkbox_get_val(&$key, &$val, $default = 1, $on = 1, $off = 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue