From 946364f59d7cd01472877108ab27ec78fb28307a Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 6 Nov 2025 12:01:33 +0100 Subject: [PATCH] New Setting: Account Countries Most Popular --- system/pages/account/create.php | 2 +- system/settings.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/system/pages/account/create.php b/system/pages/account/create.php index 9ffdf6f7..731771b7 100644 --- a/system/pages/account/create.php +++ b/system/pages/account/create.php @@ -367,7 +367,7 @@ if(!empty($errors)) if (setting('core.account_country')) { $countries = array(); - foreach (array('pl', 'se', 'br', 'us', 'gb') as $c) + foreach (setting('core.account_countries_most_popular') ?? [] as $c) $countries[$c] = $config['countries'][$c]; $countries['--'] = '----------'; diff --git a/system/settings.php b/system/settings.php index 73605530..96f24a8c 100644 --- a/system/settings.php +++ b/system/settings.php @@ -737,6 +737,18 @@ Sent by MyAAC,
'desc' => 'should country of user be automatically recognized by his IP? This makes an external API call to http://ipinfo.io', 'default' => true, ], + 'account_countries_most_popular' => [ + 'name' => 'Account Countries Most Popular', + 'type' => 'text', + 'desc' => 'Those countries will be display at the top of the list on the create account page. The short codes of countries can be found in file system/countries.conf.php', + 'default' => 'pl,se,br,us,gb', + 'callbacks' => [ + 'get' => function ($value) { + $tmp = array_map('trim', explode(',', $value)); + return array_filter($tmp, function ($v) {return !empty($v); }); + }, + ], + ], 'characters_per_account' => [ 'name' => 'Characters per Account', 'type' => 'number',