diff --git a/CHANGELOG.md b/CHANGELOG.md
index c48c7b5bd..19bc1111e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,10 +7,12 @@
- Release 2.4.3 🐎 ([belomaxorka](https://github.com/belomaxorka))
- Added support for APCu caching method [\#1442](https://github.com/torrentpier/torrentpier/pull/1442) ([belomaxorka](https://github.com/belomaxorka))
+- Some enhancements [\#1445](https://github.com/torrentpier/torrentpier/pull/1442) ([belomaxorka](https://github.com/belomaxorka))
- Improved app debug [\#1438](https://github.com/torrentpier/torrentpier/pull/1438) ([belomaxorka](https://github.com/belomaxorka))
- Demo mode: Allow registering torrents by default [\#1440](https://github.com/torrentpier/torrentpier/pull/1440) ([belomaxorka](https://github.com/belomaxorka))
- Code refactoring [\#1441](https://github.com/torrentpier/torrentpier/pull/1441) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1435](https://github.com/torrentpier/torrentpier/pull/1435), [\#1443](https://github.com/torrentpier/torrentpier/pull/1443) ([belomaxorka](https://github.com/belomaxorka))
+- New Crowdin updates [\#1444](https://github.com/torrentpier/torrentpier/pull/1444)
## [v2.4.2](https://github.com/torrentpier/torrentpier/tree/v2.4.2) (2024-03-30)
[Full Changelog](https://github.com/torrentpier/torrentpier/compare/v2.4.1...v2.4.2)
diff --git a/library/config.php b/library/config.php
index 1c21b0b76..9a26e20c4 100644
--- a/library/config.php
+++ b/library/config.php
@@ -761,6 +761,19 @@ $bb_cfg['tor_no_tor_act'] = [
TOR_CONSUMED => true,
];
+// PeerID's of torrent clients list
+$bb_cfg['tor_clients'] = [
+ '-AG' => 'Ares', '-AZ' => 'Vuze', '-A~' => 'Ares', '-BC' => 'BitComet',
+ '-BE' => 'BitTorrent SDK', '-BI' => 'BiglyBT', '-BL' => 'BitLord', '-BT' => 'BitTorrent',
+ '-CT' => 'CTorrent', '-DE' => 'Deluge', '-FD' => 'Free Download Manager', 'FD6' => 'Free Download Manager',
+ '-FG' => 'FlashGet', '-FL' => 'Folx', '-HL' => 'Halite', '-KG' => 'KGet',
+ '-KT' => 'KTorrent', '-LT' => 'libTorrent', '-Lr' => 'LibreTorrent',
+ '-TR' => 'Transmission', '-tT' => 'tTorrent', '-UM' => "uTorrent Mac", '-UT' => 'uTorrent',
+ '-UW' => 'uTorrent Web', '-WW' => 'WebTorrent', '-WD' => 'WebTorrent', '-XL' => 'Xunlei',
+ '-PI' => 'PicoTorrent', '-qB' => 'qBittorrent', 'M' => 'BitTorrent', 'MG' => 'MediaGet',
+ '-MG' => 'MediaGet', 'OP' => 'Opera', 'TIX' => 'Tixati', 'aria2-' => 'Aria2', 'A2' => 'Aria2',
+];
+
// Vote graphic length defines the maximum length of a vote result graphic, ie. 100% = this length
$bb_cfg['vote_graphic_length'] = 205;
$bb_cfg['privmsg_graphic_length'] = 175;
diff --git a/library/includes/functions.php b/library/includes/functions.php
index 025642a26..bfb7aaf92 100644
--- a/library/includes/functions.php
+++ b/library/includes/functions.php
@@ -1162,59 +1162,21 @@ function bb_date($gmepoch, $format = false, $friendly_date = true)
*/
function get_user_torrent_client(string $peer_id): string
{
- static $clients = [
- '-AG' => 'Ares', '-AZ' => 'Vuze', '-A~' => 'Ares', '-BC' => 'BitComet',
- '-BE' => 'BitTorrent SDK', '-BI' => 'BiglyBT', '-BL' => 'BitLord', '-BT' => 'BitTorrent',
- '-CT' => 'CTorrent', '-DE' => 'Deluge', '-FD' => 'Free Download Manager', 'FD6' => 'Free Download Manager',
- '-FG' => 'FlashGet', '-FL' => 'Folx', '-HL' => 'Halite', '-KG' => 'KGet',
- '-KT' => 'KTorrent', '-LT' => 'libTorrent', '-Lr' => 'LibreTorrent',
- '-TR' => 'Transmission', '-tT' => 'tTorrent', '-UM' => "uTorrent Mac", '-UT' => 'uTorrent',
- '-UW' => 'uTorrent Web', '-WW' => 'WebTorrent', '-WD' => 'WebTorrent', '-XL' => 'Xunlei',
- '-PI' => 'PicoTorrent', '-qB' => 'qBittorrent', 'M' => 'BitTorrent', 'MG' => 'MediaGet',
- '-MG' => 'MediaGet', 'OP' => 'Opera', 'TIX' => 'Tixati', 'aria2-' => 'Aria2', 'A2' => 'Aria2',
- /**
- * ================================ Other ================================
- * '-BB' => 'BitBuddy', '-AR' => 'Arctic', '-AT' => 'Artemis', '-AV' => 'Avicora',
- * '-AX' => 'BitPump', '-BB' => 'BitBuddy', '-AD' => 'Advanced Download Manager', '-BF' => 'BitFlu',
- * '-BG' => 'BTGetit', '-BH' => 'BitZilla', '-BM' => 'BitMagnet', '-BN' => 'Baidu Netdisk',
- * '-BOW' => 'Bits on Wheels', '-BP' => 'BitTorrent Pro (Azureus + Spyware)', '-BR' => 'BitRocket', '-BS' => 'BTSlave',
- * '-BW' => 'BitTorrent Web', '-BX' => 'BittorrentX', '-CD' => 'Enhanced CTorrent', '-DP' => 'Propagate Data Client',
- * '-EB' => 'EBit', '-ES' => 'Electric Sheep', '-FC' => 'FileCroc', '-HN' => 'Hydranode',
- * '-FT' => 'FoxTorrent/RedSwoosh', '-FW' => 'FrostWire', '-FX' => 'Freebox', '-G3' => 'G3 Torrent',
- * '-GR' => 'GetRight', '-GS' => 'GSTorrent', '-HK' => 'Hekate', '-LW' => 'LimeWire',
- * '-LC' => 'LeechCraft', '-LH' => 'LH-ABC', '-LP' => 'Lphant', '-UE' => "uTorrent Embedded",
- * '-UL' => 'uLeecher!', '-TS' => 'Torrentstorm', '-TT' => 'TuoTu', '-MK' => 'Meerkat',
- * '-ML' => 'MLDonkey', '-MO' => 'MonoTorrent', '-MP' => 'MooPolice', '-MR' => 'Miro',
- * '-MT' => 'Moonlight', '-NE' => 'BT Next Evolution', '-NX' => 'Net Transport', '-OS' => 'OneSwarm', '-OT' => 'OmegaTorrent',
- * '-PD' => 'Pando', '-PI' => 'PicoTorrent', '-QD' => 'QQDownload', '-QT' => 'QT 4 Torrent example',
- * '-RS' => 'Rufus', '-RT' => 'Retriever', '-RZ' => 'RezTorrent', '-SB' => 'Swiftbit',
- * '-SD' => 'Thunder', '-SM' => 'SoMud', '-SP' => 'BitSpirit', '-SS' => 'SwarmScope',
- * '-ST' => 'SymTorrent', '-SZ' => 'Shareaza', '-S~' => 'Shareaza', '-TB' => 'Torch Browser',
- * '-TN' => 'Torrent .NET', '-WY' => 'FireTorrent', '-XC' => 'Xtorrent', '-XF' => 'Xfplay',
- * '-VG' => 'Vagaa', '-WS' => 'HTTP Seed', '-WT' => 'BitLet', '-WT-' => 'BitLet',
- * '-XS' => 'XSwifter', '-XT' => 'XanTorrent', '-XX' => 'Xtorrent', '-ZO' => 'Zona',
- * '-ZT' => 'Zip Torrent', '-bk' => 'BitKitten (libtorrent)', '-lt' => 'libTorrent (Rakshasa)', '-pb' => 'pbTorrent', 'Mbrst' => 'burst!',
- * '-st' => 'SharkTorrent', '346-' => 'TorrentTopia', 'AZ2500BT' => 'BitTyrant (Azureus Mod)', 'BLZ' => 'Blizzard Downloader',
- * 'DNA' => 'BitTorrent DNA', 'FD6' => 'Free Download Manager 6', 'LIME' => 'Limewire', 'Pando' => 'Pando',
- * 'Plus' => 'Plus!', 'Q' => 'Queen Bee', 'QVOD' => 'QVOD', 'S3' => 'Amazon S3',
- * 'btpd' => 'BT Protocol Daemon', 'eX' => 'eXeem', 'martini' => 'Martini Man',
- * =======================================================================
- **/
- ];
+ global $bb_cfg;
static $iconExtension = '.png';
$bestMatch = null;
$bestMatchLength = 0;
-
- foreach ($clients as $key => $clientName) {
+ foreach ($bb_cfg['tor_clients'] as $key => $clientName) {
if (str_starts_with($peer_id, $key) !== false && strlen($key) > $bestMatchLength) {
$bestMatch = $clientName;
$bestMatchLength = strlen($key);
}
}
- if (!empty($bestMatch)) {
- return '';
+ $clientIconPath = BB_ROOT . 'styles/images/clients/' . $bestMatch . $iconExtension;
+ if (!empty($bestMatch) && is_file($clientIconPath)) {
+ return '
';
}
return $peer_id;
@@ -1228,273 +1190,12 @@ function get_user_torrent_client(string $peer_id): string
*/
function render_flag(string $code): string
{
+ global $lang;
static $iconExtension = '.svg';
- static $country_codes = [
- 'AD' => 'Andorra',
- 'AE' => 'United Arab Emirates',
- 'AF' => 'Afghanistan',
- 'AG' => 'Antigua and Barbuda',
- 'AI' => 'Anguilla',
- 'AL' => 'Albania',
- 'AM' => 'Armenia',
- 'AO' => 'Angola',
- 'AQ' => 'Antarctica',
- 'AR' => 'Argentina',
- 'AS' => 'American Samoa',
- 'AT' => 'Austria',
- 'AU' => 'Australia',
- 'AW' => 'Aruba',
- 'AX' => 'Aland Islands',
- 'AZ' => 'Azerbaijan',
- 'BA' => 'Bosnia and Herzegovina',
- 'BB' => 'Barbados',
- 'BD' => 'Bangladesh',
- 'BE' => 'Belgium',
- 'BF' => 'Burkina Faso',
- 'BG' => 'Bulgaria',
- 'BH' => 'Bahrain',
- 'BI' => 'Burundi',
- 'BJ' => 'Benin',
- 'BL' => 'Saint Barthélemy',
- 'BM' => 'Bermuda',
- 'BN' => 'Brunei Darussalam',
- 'BO' => 'Bolivia, Plurinational State of',
- 'BQ' => 'Caribbean Netherlands',
- 'BR' => 'Brazil',
- 'BS' => 'Bahamas',
- 'BT' => 'Bhutan',
- 'BV' => 'Bouvet Island',
- 'BW' => 'Botswana',
- 'BY' => 'Belarus',
- 'BZ' => 'Belize',
- 'CA' => 'Canada',
- 'CC' => 'Cocos (Keeling) Islands',
- 'CD' => 'Congo, the Democratic Republic of the',
- 'CF' => 'Central African Republic',
- 'CG' => 'Republic of the Congo',
- 'CH' => 'Switzerland',
- 'CI' => 'Republic of Cote d\'Ivoire',
- 'CK' => 'Cook Islands',
- 'CL' => 'Chile',
- 'CM' => 'Cameroon',
- 'CN' => 'China (People\'s Republic of China)',
- 'CO' => 'Colombia',
- 'CR' => 'Costa Rica',
- 'CU' => 'Cuba',
- 'CV' => 'Cape Verde',
- 'CW' => 'Country of Curaçao',
- 'CX' => 'Christmas Island',
- 'CY' => 'Cyprus',
- 'CZ' => 'Czech Republic',
- 'DE' => 'Germany',
- 'DJ' => 'Djibouti',
- 'DK' => 'Denmark',
- 'DM' => 'Dominica',
- 'DO' => 'Dominican Republic',
- 'DZ' => 'Algeria',
- 'EC' => 'Ecuador',
- 'EE' => 'Estonia',
- 'EG' => 'Egypt',
- 'EH' => 'Western Sahara',
- 'ER' => 'Eritrea',
- 'ES' => 'Spain',
- 'ET' => 'Ethiopia',
- 'EU' => 'Europe',
- 'FI' => 'Finland',
- 'FJ' => 'Fiji',
- 'FK' => 'Falkland Islands (Malvinas)',
- 'FM' => 'Micronesia, Federated States of',
- 'FO' => 'Faroe Islands',
- 'FR' => 'France',
- 'GA' => 'Gabon',
- 'GB-ENG' => 'England',
- 'GB-NIR' => 'Northern Ireland',
- 'GB-SCT' => 'Scotland',
- 'GB-WLS' => 'Wales',
- 'GB' => 'United Kingdom',
- 'GD' => 'Grenada',
- 'GE' => 'Georgia',
- 'GF' => 'French Guiana',
- 'GG' => 'Guernsey',
- 'GH' => 'Ghana',
- 'GI' => 'Gibraltar',
- 'GL' => 'Greenland',
- 'GM' => 'Gambia',
- 'GN' => 'Guinea',
- 'GP' => 'Guadeloupe',
- 'GQ' => 'Equatorial Guinea',
- 'GR3' => 'German Reich (3rd)',
- 'GR' => 'Greece',
- 'GS' => 'South Georgia and the South Sandwich Islands',
- 'GT' => 'Guatemala',
- 'GU' => 'Guam',
- 'GW' => 'Guinea-Bissau',
- 'GY' => 'Guyana',
- 'HK' => 'Hong Kong',
- 'HM' => 'Heard Island and McDonald Islands',
- 'HN' => 'Honduras',
- 'HR' => 'Croatia',
- 'HT' => 'Haiti',
- 'HU' => 'Hungary',
- 'ID' => 'Indonesia',
- 'IE' => 'Ireland',
- 'IL' => 'Israel',
- 'IM' => 'Isle of Man',
- 'IN' => 'India',
- 'IO' => 'British Indian Ocean Territory',
- 'IQ' => 'Iraq',
- 'IR' => 'Iran, Islamic Republic of',
- 'IS' => 'Iceland',
- 'IT' => 'Italy',
- 'JE' => 'Jersey',
- 'JM' => 'Jamaica',
- 'JO' => 'Jordan',
- 'JP' => 'Japan',
- 'KE' => 'Kenya',
- 'KG' => 'Kyrgyzstan',
- 'KH' => 'Cambodia',
- 'KI' => 'Kiribati',
- 'KM' => 'Comoros',
- 'KN' => 'Saint Kitts and Nevis',
- 'KP' => 'Korea, Democratic People\'s Republic of',
- 'KR' => 'Korea, Republic of',
- 'KW' => 'Kuwait',
- 'KY' => 'Cayman Islands',
- 'KZ' => 'Kazakhstan',
- 'LA' => 'Laos (Lao People\'s Democratic Republic)',
- 'LB' => 'Lebanon',
- 'LGBT' => 'Pride flag 🏳️🌈',
- 'LC' => 'Saint Lucia',
- 'LI' => 'Liechtenstein',
- 'LK' => 'Sri Lanka',
- 'LR' => 'Liberia',
- 'LS' => 'Lesotho',
- 'LT' => 'Lithuania',
- 'LU' => 'Luxembourg',
- 'LV' => 'Latvia',
- 'LY' => 'Libya',
- 'MA' => 'Morocco',
- 'MC' => 'Monaco',
- 'MD' => 'Moldova, Republic of',
- 'ME' => 'Montenegro',
- 'MF' => 'Saint Martin',
- 'MG' => 'Madagascar',
- 'MH' => 'Marshall Islands',
- 'MK' => 'North Macedonia',
- 'ML' => 'Mali',
- 'MM' => 'Myanmar',
- 'MN' => 'Mongolia',
- 'MO' => 'Macao',
- 'MP' => 'Northern Mariana Islands',
- 'MQ' => 'Martinique',
- 'MR' => 'Mauritania',
- 'MS' => 'Montserrat',
- 'MT' => 'Malta',
- 'MU' => 'Mauritius',
- 'MV' => 'Maldives',
- 'MW' => 'Malawi',
- 'MX' => 'Mexico',
- 'MY' => 'Malaysia',
- 'MZ' => 'Mozambique',
- 'NA' => 'Namibia',
- 'NC' => 'New Caledonia',
- 'NE' => 'Niger',
- 'NF' => 'Norfolk Island',
- 'NG' => 'Nigeria',
- 'NI' => 'Nicaragua',
- 'NL' => 'Netherlands',
- 'NO' => 'Norway',
- 'NP' => 'Nepal',
- 'NR' => 'Nauru',
- 'NU' => 'Niue',
- 'NZ' => 'New Zealand',
- 'OM' => 'Oman',
- 'PA' => 'Panama',
- 'PACE' => 'Peace flag 🕊',
- 'PE' => 'Peru',
- 'PF' => 'French Polynesia',
- 'PG' => 'Papua New Guinea',
- 'PH' => 'Philippines',
- 'PK' => 'Pakistan',
- 'PL' => 'Poland',
- 'PM' => 'Saint Pierre and Miquelon',
- 'PN' => 'Pitcairn',
- 'PR' => 'Puerto Rico',
- 'PS' => 'Palestine',
- 'PT' => 'Portugal',
- 'PW' => 'Palau',
- 'PY' => 'Paraguay',
- 'QA' => 'Qatar',
- 'RE' => 'Réunion',
- 'RO' => 'Romania',
- 'RS' => 'Serbia',
- 'RU' => 'Russian Federation',
- 'RW' => 'Rwanda',
- 'SA' => 'Saudi Arabia',
- 'SB' => 'Solomon Islands',
- 'SC' => 'Seychelles',
- 'SD' => 'Sudan',
- 'SE' => 'Sweden',
- 'SG' => 'Singapore',
- 'SH' => 'Saint Helena, Ascension and Tristan da Cunha',
- 'SI' => 'Slovenia',
- 'SJ' => 'Svalbard and Jan Mayen Islands',
- 'SK' => 'Slovakia',
- 'SL' => 'Sierra Leone',
- 'SM' => 'San Marino',
- 'SN' => 'Senegal',
- 'SO' => 'Somalia',
- 'SR' => 'Suriname',
- 'SS' => 'South Sudan',
- 'SU' => 'Soviet Union',
- 'ST' => 'Sao Tome and Principe',
- 'SV' => 'El Salvador',
- 'SX' => 'Sint Maarten (Dutch part)',
- 'SY' => 'Syrian Arab Republic',
- 'SZ' => 'Swaziland',
- 'TC' => 'Turks and Caicos Islands',
- 'TD' => 'Chad',
- 'TF' => 'French Southern Territories',
- 'TG' => 'Togo',
- 'TH' => 'Thailand',
- 'TJ' => 'Tajikistan',
- 'TK' => 'Tokelau',
- 'TL' => 'Timor-Leste',
- 'TM' => 'Turkmenistan',
- 'TN' => 'Tunisia',
- 'TO' => 'Tonga',
- 'TR' => 'Turkey',
- 'TT' => 'Trinidad and Tobago',
- 'TV' => 'Tuvalu',
- 'TW' => 'Taiwan (Republic of China)',
- 'TZ' => 'Tanzania, United Republic of',
- 'UA' => 'Ukraine',
- 'UG' => 'Uganda',
- 'UM' => 'US Minor Outlying Islands',
- 'US' => 'United States',
- 'UY' => 'Uruguay',
- 'UZ' => 'Uzbekistan',
- 'VA' => 'Holy See (Vatican City State)',
- 'VC' => 'Saint Vincent and the Grenadines',
- 'VE' => 'Venezuela, Bolivarian Republic of',
- 'VG' => 'Virgin Islands, British',
- 'VI' => 'Virgin Islands, U.S.',
- 'VN' => 'Vietnam',
- 'VU' => 'Vanuatu',
- 'WBW' => 'Wonderful Russia of the Future 🕊',
- 'WF' => 'Wallis and Futuna Islands',
- 'WS' => 'Samoa',
- 'XK' => 'Kosovo',
- 'YE' => 'Yemen',
- 'YU' => 'Yugoslavia',
- 'YT' => 'Mayotte',
- 'ZA' => 'South Africa',
- 'ZM' => 'Zambia',
- 'ZW' => 'Zimbabwe'
- ];
- if (isset($country_codes[$code])) {
- return '
';
+ $flagIconPath = BB_ROOT . 'styles/images/flags/' . $code . $iconExtension;
+ if (isset($lang['COUNTRIES'][$code]) && is_file($flagIconPath)) {
+ return '
';
}
return $code;
diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php
index 7a408db6b..133989bf0 100644
--- a/library/includes/ucp/register.php
+++ b/library/includes/ucp/register.php
@@ -433,12 +433,11 @@ foreach ($profile_fields as $field => $can_edit) {
*/
case 'user_from':
$from = isset($_POST['user_from']) ? (string)$_POST['user_from'] : $pr_data['user_from'];
- $from = htmlCHR($from);
if ($submit && $from != $pr_data['user_from']) {
$pr_data['user_from'] = $from;
$db_data['user_from'] = (string)$from;
}
- $tp_data['USER_FROM'] = $pr_data['user_from'];
+ $tp_data['COUNTRY_SELECT'] = build_select('user_from', array_flip($lang['COUNTRIES']), $pr_data['user_from']);
break;
/**
diff --git a/library/language/source/main.php b/library/language/source/main.php
index 89768ef3d..31e45a37a 100644
--- a/library/language/source/main.php
+++ b/library/language/source/main.php
@@ -516,7 +516,6 @@ $lang['AVATAR_PANEL'] = 'Avatar control panel';
$lang['WEBSITE'] = 'Website';
$lang['LOCATION'] = 'Location';
-$lang['LOCATION_FLAGS'] = 'Flag images are rendered by country codes:';
$lang['CONTACT'] = 'Contact';
$lang['EMAIL_ADDRESS'] = 'E-mail address';
$lang['SEND_PRIVATE_MESSAGE'] = 'Send private message';
@@ -978,6 +977,271 @@ $lang['DATETIME']['OCT'] = 'Oct';
$lang['DATETIME']['NOV'] = 'Nov';
$lang['DATETIME']['DEC'] = 'Dec';
+// Country selector
+$lang['COUNTRIES'] = [
+ 'AD' => 'Andorra',
+ 'AE' => 'United Arab Emirates',
+ 'AF' => 'Afghanistan',
+ 'AG' => 'Antigua and Barbuda',
+ 'AI' => 'Anguilla',
+ 'AL' => 'Albania',
+ 'AM' => 'Armenia',
+ 'AO' => 'Angola',
+ 'AQ' => 'Antarctica',
+ 'AR' => 'Argentina',
+ 'AS' => 'American Samoa',
+ 'AT' => 'Austria',
+ 'AU' => 'Australia',
+ 'AW' => 'Aruba',
+ 'AX' => 'Aland Islands',
+ 'AZ' => 'Azerbaijan',
+ 'BA' => 'Bosnia and Herzegovina',
+ 'BB' => 'Barbados',
+ 'BD' => 'Bangladesh',
+ 'BE' => 'Belgium',
+ 'BF' => 'Burkina Faso',
+ 'BG' => 'Bulgaria',
+ 'BH' => 'Bahrain',
+ 'BI' => 'Burundi',
+ 'BJ' => 'Benin',
+ 'BL' => 'Saint Barthélemy',
+ 'BM' => 'Bermuda',
+ 'BN' => 'Brunei Darussalam',
+ 'BO' => 'Bolivia, Plurinational State of',
+ 'BQ' => 'Caribbean Netherlands',
+ 'BR' => 'Brazil',
+ 'BS' => 'Bahamas',
+ 'BT' => 'Bhutan',
+ 'BV' => 'Bouvet Island',
+ 'BW' => 'Botswana',
+ 'BY' => 'Belarus',
+ 'BZ' => 'Belize',
+ 'CA' => 'Canada',
+ 'CC' => 'Cocos (Keeling) Islands',
+ 'CD' => 'Congo, the Democratic Republic of the',
+ 'CF' => 'Central African Republic',
+ 'CG' => 'Republic of the Congo',
+ 'CH' => 'Switzerland',
+ 'CI' => 'Republic of Cote d\'Ivoire',
+ 'CK' => 'Cook Islands',
+ 'CL' => 'Chile',
+ 'CM' => 'Cameroon',
+ 'CN' => 'China (People\'s Republic of China)',
+ 'CO' => 'Colombia',
+ 'CR' => 'Costa Rica',
+ 'CU' => 'Cuba',
+ 'CV' => 'Cape Verde',
+ 'CW' => 'Country of Curaçao',
+ 'CX' => 'Christmas Island',
+ 'CY' => 'Cyprus',
+ 'CZ' => 'Czech Republic',
+ 'DE' => 'Germany',
+ 'DJ' => 'Djibouti',
+ 'DK' => 'Denmark',
+ 'DM' => 'Dominica',
+ 'DO' => 'Dominican Republic',
+ 'DZ' => 'Algeria',
+ 'EC' => 'Ecuador',
+ 'EE' => 'Estonia',
+ 'EG' => 'Egypt',
+ 'EH' => 'Western Sahara',
+ 'ER' => 'Eritrea',
+ 'ES' => 'Spain',
+ 'ET' => 'Ethiopia',
+ 'EU' => 'Europe',
+ 'FI' => 'Finland',
+ 'FJ' => 'Fiji',
+ 'FK' => 'Falkland Islands (Malvinas)',
+ 'FM' => 'Micronesia, Federated States of',
+ 'FO' => 'Faroe Islands',
+ 'FR' => 'France',
+ 'GA' => 'Gabon',
+ 'GB-ENG' => 'England',
+ 'GB-NIR' => 'Northern Ireland',
+ 'GB-SCT' => 'Scotland',
+ 'GB-WLS' => 'Wales',
+ 'GB' => 'United Kingdom',
+ 'GD' => 'Grenada',
+ 'GE' => 'Georgia',
+ 'GF' => 'French Guiana',
+ 'GG' => 'Guernsey',
+ 'GH' => 'Ghana',
+ 'GI' => 'Gibraltar',
+ 'GL' => 'Greenland',
+ 'GM' => 'Gambia',
+ 'GN' => 'Guinea',
+ 'GP' => 'Guadeloupe',
+ 'GQ' => 'Equatorial Guinea',
+ 'GR3' => 'German Reich (3rd)',
+ 'GR' => 'Greece',
+ 'GS' => 'South Georgia and the South Sandwich Islands',
+ 'GT' => 'Guatemala',
+ 'GU' => 'Guam',
+ 'GW' => 'Guinea-Bissau',
+ 'GY' => 'Guyana',
+ 'HK' => 'Hong Kong',
+ 'HM' => 'Heard Island and McDonald Islands',
+ 'HN' => 'Honduras',
+ 'HR' => 'Croatia',
+ 'HT' => 'Haiti',
+ 'HU' => 'Hungary',
+ 'ID' => 'Indonesia',
+ 'IE' => 'Ireland',
+ 'IL' => 'Israel',
+ 'IM' => 'Isle of Man',
+ 'IN' => 'India',
+ 'IO' => 'British Indian Ocean Territory',
+ 'IQ' => 'Iraq',
+ 'IR' => 'Iran, Islamic Republic of',
+ 'IS' => 'Iceland',
+ 'IT' => 'Italy',
+ 'JE' => 'Jersey',
+ 'JM' => 'Jamaica',
+ 'JO' => 'Jordan',
+ 'JP' => 'Japan',
+ 'KE' => 'Kenya',
+ 'KG' => 'Kyrgyzstan',
+ 'KH' => 'Cambodia',
+ 'KI' => 'Kiribati',
+ 'KM' => 'Comoros',
+ 'KN' => 'Saint Kitts and Nevis',
+ 'KP' => 'Korea, Democratic People\'s Republic of',
+ 'KR' => 'Korea, Republic of',
+ 'KW' => 'Kuwait',
+ 'KY' => 'Cayman Islands',
+ 'KZ' => 'Kazakhstan',
+ 'LA' => 'Laos (Lao People\'s Democratic Republic)',
+ 'LB' => 'Lebanon',
+ 'LGBT' => 'Pride flag 🏳️🌈',
+ 'LC' => 'Saint Lucia',
+ 'LI' => 'Liechtenstein',
+ 'LK' => 'Sri Lanka',
+ 'LR' => 'Liberia',
+ 'LS' => 'Lesotho',
+ 'LT' => 'Lithuania',
+ 'LU' => 'Luxembourg',
+ 'LV' => 'Latvia',
+ 'LY' => 'Libya',
+ 'MA' => 'Morocco',
+ 'MC' => 'Monaco',
+ 'MD' => 'Moldova, Republic of',
+ 'ME' => 'Montenegro',
+ 'MF' => 'Saint Martin',
+ 'MG' => 'Madagascar',
+ 'MH' => 'Marshall Islands',
+ 'MK' => 'North Macedonia',
+ 'ML' => 'Mali',
+ 'MM' => 'Myanmar',
+ 'MN' => 'Mongolia',
+ 'MO' => 'Macao',
+ 'MP' => 'Northern Mariana Islands',
+ 'MQ' => 'Martinique',
+ 'MR' => 'Mauritania',
+ 'MS' => 'Montserrat',
+ 'MT' => 'Malta',
+ 'MU' => 'Mauritius',
+ 'MV' => 'Maldives',
+ 'MW' => 'Malawi',
+ 'MX' => 'Mexico',
+ 'MY' => 'Malaysia',
+ 'MZ' => 'Mozambique',
+ 'NA' => 'Namibia',
+ 'NC' => 'New Caledonia',
+ 'NE' => 'Niger',
+ 'NF' => 'Norfolk Island',
+ 'NG' => 'Nigeria',
+ 'NI' => 'Nicaragua',
+ 'NL' => 'Netherlands',
+ 'NO' => 'Norway',
+ 'NP' => 'Nepal',
+ 'NR' => 'Nauru',
+ 'NU' => 'Niue',
+ 'NZ' => 'New Zealand',
+ 'OM' => 'Oman',
+ 'PA' => 'Panama',
+ 'PACE' => 'Peace flag 🕊',
+ 'PE' => 'Peru',
+ 'PF' => 'French Polynesia',
+ 'PG' => 'Papua New Guinea',
+ 'PH' => 'Philippines',
+ 'PK' => 'Pakistan',
+ 'PL' => 'Poland',
+ 'PM' => 'Saint Pierre and Miquelon',
+ 'PN' => 'Pitcairn',
+ 'PR' => 'Puerto Rico',
+ 'PS' => 'Palestine',
+ 'PT' => 'Portugal',
+ 'PW' => 'Palau',
+ 'PY' => 'Paraguay',
+ 'QA' => 'Qatar',
+ 'RE' => 'Réunion',
+ 'RO' => 'Romania',
+ 'RS' => 'Serbia',
+ 'RU' => 'Russian Federation',
+ 'RW' => 'Rwanda',
+ 'SA' => 'Saudi Arabia',
+ 'SB' => 'Solomon Islands',
+ 'SC' => 'Seychelles',
+ 'SD' => 'Sudan',
+ 'SE' => 'Sweden',
+ 'SG' => 'Singapore',
+ 'SH' => 'Saint Helena, Ascension and Tristan da Cunha',
+ 'SI' => 'Slovenia',
+ 'SJ' => 'Svalbard and Jan Mayen Islands',
+ 'SK' => 'Slovakia',
+ 'SL' => 'Sierra Leone',
+ 'SM' => 'San Marino',
+ 'SN' => 'Senegal',
+ 'SO' => 'Somalia',
+ 'SR' => 'Suriname',
+ 'SS' => 'South Sudan',
+ 'SU' => 'Soviet Union',
+ 'ST' => 'Sao Tome and Principe',
+ 'SV' => 'El Salvador',
+ 'SX' => 'Sint Maarten (Dutch part)',
+ 'SY' => 'Syrian Arab Republic',
+ 'SZ' => 'Swaziland',
+ 'TC' => 'Turks and Caicos Islands',
+ 'TD' => 'Chad',
+ 'TF' => 'French Southern Territories',
+ 'TG' => 'Togo',
+ 'TH' => 'Thailand',
+ 'TJ' => 'Tajikistan',
+ 'TK' => 'Tokelau',
+ 'TL' => 'Timor-Leste',
+ 'TM' => 'Turkmenistan',
+ 'TN' => 'Tunisia',
+ 'TO' => 'Tonga',
+ 'TR' => 'Turkey',
+ 'TT' => 'Trinidad and Tobago',
+ 'TV' => 'Tuvalu',
+ 'TW' => 'Taiwan (Republic of China)',
+ 'TZ' => 'Tanzania, United Republic of',
+ 'UA' => 'Ukraine',
+ 'UG' => 'Uganda',
+ 'UM' => 'US Minor Outlying Islands',
+ 'US' => 'United States',
+ 'UY' => 'Uruguay',
+ 'UZ' => 'Uzbekistan',
+ 'VA' => 'Holy See (Vatican City State)',
+ 'VC' => 'Saint Vincent and the Grenadines',
+ 'VE' => 'Venezuela, Bolivarian Republic of',
+ 'VG' => 'Virgin Islands, British',
+ 'VI' => 'Virgin Islands, U.S.',
+ 'VN' => 'Vietnam',
+ 'VU' => 'Vanuatu',
+ 'WBW' => 'Wonderful Russia of the Future 🕊',
+ 'WF' => 'Wallis and Futuna Islands',
+ 'WS' => 'Samoa',
+ 'XK' => 'Kosovo',
+ 'YE' => 'Yemen',
+ 'YU' => 'Yugoslavia',
+ 'YT' => 'Mayotte',
+ 'ZA' => 'South Africa',
+ 'ZM' => 'Zambia',
+ 'ZW' => 'Zimbabwe'
+];
+
// Errors
$lang['INFORMATION'] = 'Information';
$lang['ADMIN_REAUTHENTICATE'] = 'To administer/moderate the board you must re-authenticate yourself.';
@@ -1568,7 +1832,7 @@ $lang['DL_DL_SPEED'] = 'DL speed';
$lang['DL_PORT'] = 'Port';
$lang['DL_CLIENT'] = 'Client';
$lang['DL_FORMULA'] = 'Formula: Uploaded/TorrentSize';
-$lang['DL_ULR'] = 'URL';
+$lang['DL_ULR'] = 'ULR';
$lang['DL_STOPPED'] = 'stopped';
$lang['DL_UPD'] = 'upd: ';
$lang['DL_INFO'] = 'shows data only for the current session';
diff --git a/memberlist.php b/memberlist.php
index c2544fc1a..a81ae189f 100644
--- a/memberlist.php
+++ b/memberlist.php
@@ -17,6 +17,7 @@ $start = abs((int)request_var('start', 0));
$mode = (string)request_var('mode', 'joined');
$sort_order = (request_var('order', 'ASC') == 'ASC') ? 'ASC' : 'DESC';
$username = request_var('username', '');
+$role = (string)request_var('role', 'all');
// Memberlist sorting
$mode_types_text = [$lang['SORT_JOINED'], $lang['SORT_USERNAME'], $lang['SORT_LOCATION'], $lang['SORT_POSTS'], $lang['SORT_EMAIL'], $lang['SORT_WEBSITE'], $lang['SORT_TOP_TEN']];
@@ -37,6 +38,20 @@ if ($sort_order == 'ASC') {
}
$select_sort_order .= '';
+// Role selector
+$role_select = [
+ 'all' => $lang['ALL'],
+ 'user' => $lang['USERS'],
+ 'admin' => $lang['ADMINISTRATORS'],
+ 'moderator' => $lang['MODERATORS']
+];
+$select_sort_role = '';
+
switch ($mode) {
case 'username':
$order_by = "username $sort_order LIMIT $start, " . $bb_cfg['topics_per_page'];
@@ -62,8 +77,21 @@ switch ($mode) {
break;
}
+$where_sql = '';
+switch ($role) {
+ case 'user':
+ $where_sql = ' AND user_level = ' . USER;
+ break;
+ case 'admin':
+ $where_sql = ' AND user_level = ' . ADMIN;
+ break;
+ case 'moderator':
+ $where_sql = ' AND user_level = ' . MOD;
+ break;
+}
+
// Generate user information
-$sql = "SELECT username, user_id, user_rank, user_opt, user_posts, user_regdate, user_from, user_website, user_email, avatar_ext_id FROM " . BB_USERS . " WHERE user_id NOT IN(" . EXCLUDED_USERS . ") ORDER BY $order_by";
+$sql = "SELECT username, user_id, user_rank, user_opt, user_posts, user_regdate, user_from, user_website, user_email, avatar_ext_id FROM " . BB_USERS . " WHERE user_id NOT IN(" . EXCLUDED_USERS . ") $where_sql ORDER BY $order_by";
if ($result = DB()->fetch_rowset($sql)) {
foreach ($result as $i => $row) {
$user_id = $row['user_id'];
@@ -89,7 +117,7 @@ if ($result = DB()->fetch_rowset($sql)) {
}
// Pagination
-$paginationurl = "memberlist.php?mode=$mode&order=$sort_order";
+$paginationurl = "memberlist.php?mode=$mode&order=$sort_order&role=$role";
$paginationurl .= $username ? "&username=$username" : '';
if ($mode != 'topten' || $bb_cfg['topics_per_page'] < 10) {
@@ -109,7 +137,8 @@ $template->assign_vars([
'PAGE_TITLE' => $lang['MEMBERLIST'],
'S_MODE_SELECT' => $select_sort_mode,
'S_ORDER_SELECT' => $select_sort_order,
- 'S_MODE_ACTION' => "memberlist.php?mode=$mode&order=$sort_order",
+ 'S_ROLE_SELECT' => $select_sort_role,
+ 'S_MODE_ACTION' => "memberlist.php?mode=$mode&order=$sort_order&role=$role",
'S_USERNAME' => $username,
]);
diff --git a/styles/templates/default/css/main_content.css b/styles/templates/default/css/main_content.css
index 6cc1a9eb8..9191becac 100644
--- a/styles/templates/default/css/main_content.css
+++ b/styles/templates/default/css/main_content.css
@@ -502,7 +502,7 @@ a.postLink:visited {
text-align: center
}
-.poster-flag {
+img.poster-flag {
width: 32px;
height: 20px;
vertical-align: middle;
@@ -610,7 +610,7 @@ table.peers td {
border: 1px #A5AFB4 solid;
}
-.clients {
+img.client_icon {
width: auto;
height: auto;
display: inline !important;
diff --git a/styles/templates/default/memberlist.tpl b/styles/templates/default/memberlist.tpl
index a11b69d86..bf195eafd 100644
--- a/styles/templates/default/memberlist.tpl
+++ b/styles/templates/default/memberlist.tpl
@@ -3,7 +3,7 @@