From 4c09c62b49aa7985cb97a9c8d75fbd8cfbb43ba5 Mon Sep 17 00:00:00 2001 From: Akkarinage Date: Sat, 16 Mar 2024 12:40:08 +0000 Subject: [PATCH] Config to display CashPoints instead of Credits --- config/application.php | 1 + modules/account/view.php | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/config/application.php b/config/application.php index b3f73085..865ee761 100644 --- a/config/application.php +++ b/config/application.php @@ -90,6 +90,7 @@ 'BackwardYears' => 60, // (Visual) The number of years to display behind the current year in date inputs. 'ColumnSortAscending' => ' ▲', // (Visual) Text displayed for ascending sorted column names. 'ColumnSortDescending' => ' ▼', // (Visual) Text displayed for descending sorted column names. + 'DisplayCashPoints' => false, // Whether or not to display "Cash Points" instead of the player's "Credits" in the control panel. 'CreditExchangeRate' => 1.0, // The rate at which credits are exchanged for dollars. 'MinDonationAmount' => 2.0, // Minimum donation amount. (NOTE: Actual donations made that are less than this account won't be exchanged) 'DonationCurrency' => 'USD', // Preferred donation currency. Only donations made in this currency will be processed for credit deposits. diff --git a/modules/account/view.php b/modules/account/view.php index 22d0f6fd..760746a2 100644 --- a/modules/account/view.php +++ b/modules/account/view.php @@ -240,5 +240,14 @@ $itemAttributes = Flux::config('Attributes')->toArray(); $type_list = Flux::config('ItemTypes')->toArray(); + + if(Flux::config('DisplayCashPoints')) { + $regTable = 'acc_reg_num'; + $sql = "SELECT * FROM {$server->loginDatabase}.{$regTable} WHERE `key` = '#CASHPOINTS' AND account_id = ?"; + $sth = $server->connection->getStatement($sql); + $sth->execute(array($accountID)); + $account->balance = $sth->fetch()->value; + } + } ?>