mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 05:13:54 -07:00
Some enhancements for flags (#1471)
* Some enhancements for flags * Update CHANGELOG.md
This commit is contained in:
parent
b80fa8857d
commit
08fb1e3f7c
3 changed files with 6 additions and 4 deletions
|
@ -13,7 +13,7 @@
|
||||||
- Some enhancements [\#1445](https://github.com/torrentpier/torrentpier/pull/1445) ([belomaxorka](https://github.com/belomaxorka))
|
- 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))
|
- 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))
|
- 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))
|
- Some enhancements for flags [\#1470](https://github.com/torrentpier/torrentpier/pull/1470), [\#1471](https://github.com/torrentpier/torrentpier/pull/1471) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Fixed quote selection for smiles [\#1457](https://github.com/torrentpier/torrentpier/pull/1457) ([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))
|
- 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))
|
- Temp: Removed showing forum description in `viewforum.php` [\#1465](https://github.com/torrentpier/torrentpier/pull/1465) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
|
|
|
@ -1186,9 +1186,10 @@ function get_user_torrent_client(string $peer_id): string
|
||||||
* Returns country flag by country code
|
* Returns country flag by country code
|
||||||
*
|
*
|
||||||
* @param string $code
|
* @param string $code
|
||||||
|
* @param bool $showName
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function render_flag(string $code): string
|
function render_flag(string $code, bool $showName = true): string
|
||||||
{
|
{
|
||||||
global $lang;
|
global $lang;
|
||||||
static $iconExtension = '.svg';
|
static $iconExtension = '.svg';
|
||||||
|
@ -1199,7 +1200,8 @@ function render_flag(string $code): string
|
||||||
} else {
|
} else {
|
||||||
$flagIconPath = BB_ROOT . 'styles/images/flags/' . $code . $iconExtension;
|
$flagIconPath = BB_ROOT . 'styles/images/flags/' . $code . $iconExtension;
|
||||||
if (is_file($flagIconPath)) {
|
if (is_file($flagIconPath)) {
|
||||||
return '<img src="' . $flagIconPath . '" class="poster-flag" alt="' . $code . '" title="' . $lang['COUNTRIES'][$code] . '">';
|
$countryName = $showName ? str_short($lang['COUNTRIES'][$code], 20) : '';
|
||||||
|
return '<img src="' . $flagIconPath . '" class="poster-flag" alt="' . $code . '" title="' . $lang['COUNTRIES'][$code] . '">' . $countryName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -673,7 +673,7 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
|
|
||||||
'POSTER_JOINED_DATE' => $poster_joined,
|
'POSTER_JOINED_DATE' => $poster_joined,
|
||||||
'POSTER_POSTS' => ($bb_cfg['show_poster_posts'] && $poster_posts) ? '<a href="search.php?search_author=1&uid=' . $poster_id . '" target="_blank">' . $poster_posts . '</a>' : '',
|
'POSTER_POSTS' => ($bb_cfg['show_poster_posts'] && $poster_posts) ? '<a href="search.php?search_author=1&uid=' . $poster_id . '" target="_blank">' . $poster_posts . '</a>' : '',
|
||||||
'POSTER_FROM' => $bb_cfg['show_poster_from'] ? render_flag($poster_from) : '',
|
'POSTER_FROM' => $bb_cfg['show_poster_from'] ? render_flag($poster_from, false) : '',
|
||||||
'POSTER_BOT' => $poster_bot,
|
'POSTER_BOT' => $poster_bot,
|
||||||
'POSTER_GUEST' => $poster_guest,
|
'POSTER_GUEST' => $poster_guest,
|
||||||
'POSTER_ID' => $poster_id,
|
'POSTER_ID' => $poster_id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue