mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -07:00
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:
parent
ccb122f9cb
commit
f5d65b8911
6 changed files with 39 additions and 22 deletions
40
composer.lock
generated
40
composer.lock
generated
|
@ -3145,16 +3145,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/mailer",
|
"name": "symfony/mailer",
|
||||||
"version": "v6.4.18",
|
"version": "v6.4.21",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/mailer.git",
|
"url": "https://github.com/symfony/mailer.git",
|
||||||
"reference": "e93a6ae2767d7f7578c2b7961d9d8e27580b2b11"
|
"reference": "ada2809ccd4ec27aba9fc344e3efdaec624c6438"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/mailer/zipball/e93a6ae2767d7f7578c2b7961d9d8e27580b2b11",
|
"url": "https://api.github.com/repos/symfony/mailer/zipball/ada2809ccd4ec27aba9fc344e3efdaec624c6438",
|
||||||
"reference": "e93a6ae2767d7f7578c2b7961d9d8e27580b2b11",
|
"reference": "ada2809ccd4ec27aba9fc344e3efdaec624c6438",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3205,7 +3205,7 @@
|
||||||
"description": "Helps sending emails",
|
"description": "Helps sending emails",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/mailer/tree/v6.4.18"
|
"source": "https://github.com/symfony/mailer/tree/v6.4.21"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -3221,20 +3221,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-01-24T15:27:15+00:00"
|
"time": "2025-04-26T23:47:35+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/mime",
|
"name": "symfony/mime",
|
||||||
"version": "v6.4.19",
|
"version": "v6.4.21",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/mime.git",
|
"url": "https://github.com/symfony/mime.git",
|
||||||
"reference": "ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3"
|
"reference": "fec8aa5231f3904754955fad33c2db50594d22d1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/mime/zipball/ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3",
|
"url": "https://api.github.com/repos/symfony/mime/zipball/fec8aa5231f3904754955fad33c2db50594d22d1",
|
||||||
"reference": "ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3",
|
"reference": "fec8aa5231f3904754955fad33c2db50594d22d1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3290,7 +3290,7 @@
|
||||||
"mime-type"
|
"mime-type"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/mime/tree/v6.4.19"
|
"source": "https://github.com/symfony/mime/tree/v6.4.21"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -3306,7 +3306,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-02-17T21:23:52+00:00"
|
"time": "2025-04-27T13:27:38+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -3648,16 +3648,16 @@
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "symfony/var-dumper",
|
"name": "symfony/var-dumper",
|
||||||
"version": "v6.4.18",
|
"version": "v6.4.21",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/var-dumper.git",
|
"url": "https://github.com/symfony/var-dumper.git",
|
||||||
"reference": "4ad10cf8b020e77ba665305bb7804389884b4837"
|
"reference": "22560f80c0c5cd58cc0bcaf73455ffd81eb380d5"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/4ad10cf8b020e77ba665305bb7804389884b4837",
|
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/22560f80c0c5cd58cc0bcaf73455ffd81eb380d5",
|
||||||
"reference": "4ad10cf8b020e77ba665305bb7804389884b4837",
|
"reference": "22560f80c0c5cd58cc0bcaf73455ffd81eb380d5",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3713,7 +3713,7 @@
|
||||||
"dump"
|
"dump"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/var-dumper/tree/v6.4.18"
|
"source": "https://github.com/symfony/var-dumper/tree/v6.4.21"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -3729,7 +3729,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-01-17T11:26:11+00:00"
|
"time": "2025-04-09T07:34:50+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
|
@ -3743,6 +3743,6 @@
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": ">=8.1"
|
"php": ">=8.1"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": {},
|
||||||
"plugin-api-version": "2.3.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,7 @@ if ($tor_reged && $tor_info) {
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
tr.user_id, tr.ip, tr.ipv6, tr.port, tr.peer_id, tr.uploaded, tr.downloaded, tr.remain,
|
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.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
|
FROM " . BB_BT_TRACKER . " tr
|
||||||
LEFT JOIN " . BB_USERS . " u ON u.user_id = tr.user_id
|
LEFT JOIN " . BB_USERS . " u ON u.user_id = tr.user_id
|
||||||
WHERE tr.topic_id = $tor_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';\"" : '';
|
$row_bgr = ($change_peers_bgr_over) ? " class=\"$bgr_class\" onmouseover=\"this.className='$bgr_class_over';\" onmouseout=\"this.className='$bgr_class';\"" : '';
|
||||||
$tr[$x]++;
|
$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", [
|
$template->assign_block_vars("$x_full.$x_row", [
|
||||||
'ROW_BGR' => $row_bgr,
|
'ROW_BGR' => $row_bgr,
|
||||||
'NAME' => ($peer['update_time']) ? $name : "<s>$name</s>",
|
'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),
|
'COUNTRY' => render_flag(infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])['countryCode'], false),
|
||||||
'COMPL_PRC' => $compl_perc,
|
'COMPL_PRC' => $compl_perc,
|
||||||
'UP_TOTAL' => ($max_up_id[$x] == $pid) ? "<b>$up_tot</b>" : $up_tot,
|
'UP_TOTAL' => ($max_up_id[$x] == $pid) ? "<b>$up_tot</b>" : $up_tot,
|
||||||
|
|
|
@ -197,6 +197,7 @@ $bf['user_opt'] = [
|
||||||
'dis_post_edit' => 13, // [PROHIBITIONS] Block editing own posts / topics
|
'dis_post_edit' => 13, // [PROHIBITIONS] Block editing own posts / topics
|
||||||
'user_dls' => 14, // [SETTINGS] Hide list of "Current downloads" in my profile
|
'user_dls' => 14, // [SETTINGS] Hide list of "Current downloads" in my profile
|
||||||
'user_retracker' => 15, // [SETTINGS] Add my retracker into downloaded torrent files
|
'user_retracker' => 15, // [SETTINGS] Add my retracker into downloaded torrent files
|
||||||
|
'user_hide_torrent_client' => 16 // [SETTINGS] Option to hide user's torrent client in peer list
|
||||||
];
|
];
|
||||||
|
|
||||||
function bit2dec($bit_num)
|
function bit2dec($bit_num)
|
||||||
|
|
|
@ -365,6 +365,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
'user_dls' => $reg_mode ? false : true,
|
'user_dls' => $reg_mode ? false : true,
|
||||||
'user_callseed' => $reg_mode ? true : true,
|
'user_callseed' => $reg_mode ? true : true,
|
||||||
'user_retracker' => $reg_mode ? true : true,
|
'user_retracker' => $reg_mode ? true : true,
|
||||||
|
'user_hide_torrent_client' => $reg_mode ? true : true,
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($update_user_opt as $opt => $can_change_opt) {
|
foreach ($update_user_opt as $opt => $can_change_opt) {
|
||||||
|
|
|
@ -1879,6 +1879,7 @@ $lang['DL_ULR'] = 'ULR';
|
||||||
$lang['DL_STOPPED'] = 'stopped';
|
$lang['DL_STOPPED'] = 'stopped';
|
||||||
$lang['DL_UPD'] = 'upd: ';
|
$lang['DL_UPD'] = 'upd: ';
|
||||||
$lang['DL_INFO'] = 'shows data <i><b>only for the current session</b></i>';
|
$lang['DL_INFO'] = 'shows data <i><b>only for the current session</b></i>';
|
||||||
|
$lang['HIDE_PEER_TORRENT_CLIENT'] = 'Hide my BitTorrent client name in peer list';
|
||||||
|
|
||||||
// Post PIN
|
// Post PIN
|
||||||
$lang['POST_PIN'] = 'Pin first post';
|
$lang['POST_PIN'] = 'Pin first post';
|
||||||
|
|
|
@ -319,6 +319,13 @@
|
||||||
<label><input type="radio" name="user_callseed" value="0" <!-- IF not USER_CALLSEED -->checked<!-- ENDIF --> />{L_NO}</label>
|
<label><input type="radio" name="user_callseed" value="0" <!-- IF not USER_CALLSEED -->checked<!-- ENDIF --> />{L_NO}</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="prof-title">{L_HIDE_PEER_TORRENT_CLIENT}:</td>
|
||||||
|
<td>
|
||||||
|
<label><input type="radio" name="user_hide_torrent_client" value="1" <!-- IF USER_HIDE_TORRENT_CLIENT -->checked<!-- ENDIF --> />{L_YES}</label>
|
||||||
|
<label><input type="radio" name="user_hide_torrent_client" value="0" <!-- IF not USER_HIDE_TORRENT_CLIENT -->checked<!-- ENDIF --> />{L_NO}</label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2">{L_AVATAR_PANEL}</th>
|
<th colspan="2">{L_AVATAR_PANEL}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue