diff --git a/config.dist.php b/config.dist.php index 1580ce2..25f72d8 100644 --- a/config.dist.php +++ b/config.dist.php @@ -5,5 +5,8 @@ return [ 'footer_links' => [ // Custom links to show in the footer ['text' => 'Clearnet', 'url' => 'https://calc.revuo-xmr.com'], ['text' => 'Tor', 'url' => 'http://calc.revuo75joezkbeitqmas4ab6spbrkr4vzbhjmeuv75ovrfqfp47mtjid.onion'] + ], + 'preferred_currencies' => [ // Currencies that should be displayed at the top of the lists + 'usd', 'eur', 'gbp', 'cad', 'btc', 'eth', 'ltc' ] ]; \ No newline at end of file diff --git a/index.php b/index.php index db8c146..2b8794a 100644 --- a/index.php +++ b/index.php @@ -54,6 +54,16 @@ if (file_exists('config.php')) { $display_servers_guru = isset($config['servers_guru']) && $config['servers_guru'] === true; $attribution = isset($config['attribution']) ? $config['attribution'] : ''; +$preferred_currencies = isset($config['preferred_currencies']) ? $config['preferred_currencies'] : []; + +// Order preferred currencies to the top +foreach (array_reverse($preferred_currencies) as $currency) { + $currency = strtoupper($currency); + if (($key = array_search($currency, $currencies)) !== false) { + unset($currencies[$key]); + array_unshift($currencies, $currency); + } +} ?> @@ -148,12 +158,10 @@ $attribution = isset($config['attribution']) ? $config['attribution'] : '';