Some enhancements for flags (#1470)

* Some enhancements for flags

* Update main.php

* Upload

* Update functions.php

* Update functions.php

* Update main.php

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-05-05 23:48:00 +07:00 committed by GitHub
commit b80fa8857d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

View file

@ -13,6 +13,7 @@
- Some enhancements [\#1445](https://github.com/torrentpier/torrentpier/pull/1445) ([belomaxorka](https://github.com/belomaxorka))
- Guests can view polls [\#1464](https://github.com/torrentpier/torrentpier/pull/1464) ([belomaxorka](https://github.com/belomaxorka))
- Improved app debug [\#1438](https://github.com/torrentpier/torrentpier/pull/1438) ([belomaxorka](https://github.com/belomaxorka))
- Some enhancements for flags [\#1470](https://github.com/torrentpier/torrentpier/pull/1470) ([belomaxorka](https://github.com/belomaxorka))
- Fixed quote selection for smiles [\#1457](https://github.com/torrentpier/torrentpier/pull/1457) ([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))
- Temp: Removed showing forum description in `viewforum.php` [\#1465](https://github.com/torrentpier/torrentpier/pull/1465) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -1193,9 +1193,15 @@ function render_flag(string $code): string
global $lang;
static $iconExtension = '.svg';
$flagIconPath = BB_ROOT . 'styles/images/flags/' . $code . $iconExtension;
if (isset($lang['COUNTRIES'][$code]) && is_file($flagIconPath)) {
return '<img src="' . $flagIconPath . '" class="poster-flag" alt="' . $code . '" title="' . $lang['COUNTRIES'][$code] . '">';
if (isset($lang['COUNTRIES'][$code])) {
if ($code === '0') {
return ''; // No selected
} else {
$flagIconPath = BB_ROOT . 'styles/images/flags/' . $code . $iconExtension;
if (is_file($flagIconPath)) {
return '<img src="' . $flagIconPath . '" class="poster-flag" alt="' . $code . '" title="' . $lang['COUNTRIES'][$code] . '">';
}
}
}
return $code;

View file

@ -979,6 +979,7 @@ $lang['DATETIME']['DEC'] = 'Dec';
// Country selector
$lang['COUNTRIES'] = [
0 => 'No select',
'AD' => 'Andorra',
'AE' => 'United Arab Emirates',
'AF' => 'Afghanistan',