Skip to content

Commit cd96819

Browse files
authored
Config to display CashPoints instead of Credits (#389)
1 parent 4936530 commit cd96819

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

config/application.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
'BackwardYears' => 60, // (Visual) The number of years to display behind the current year in date inputs.
9191
'ColumnSortAscending' => '', // (Visual) Text displayed for ascending sorted column names.
9292
'ColumnSortDescending' => '', // (Visual) Text displayed for descending sorted column names.
93+
'DisplayCashPoints' => false, // Whether or not to display "Cash Points" instead of the player's "Credits" in the control panel.
9394
'CreditExchangeRate' => 1.0, // The rate at which credits are exchanged for dollars.
9495
'MinDonationAmount' => 2.0, // Minimum donation amount. (NOTE: Actual donations made that are less than this account won't be exchanged)
9596
'DonationCurrency' => 'USD', // Preferred donation currency. Only donations made in this currency will be processed for credit deposits.

modules/account/view.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,14 @@
240240

241241
$itemAttributes = Flux::config('Attributes')->toArray();
242242
$type_list = Flux::config('ItemTypes')->toArray();
243+
244+
if(Flux::config('DisplayCashPoints')) {
245+
$regTable = 'acc_reg_num';
246+
$sql = "SELECT * FROM {$server->loginDatabase}.{$regTable} WHERE `key` = '#CASHPOINTS' AND account_id = ?";
247+
$sth = $server->connection->getStatement($sql);
248+
$sth->execute(array($accountID));
249+
$account->balance = $sth->fetch()->value;
250+
}
251+
243252
}
244253
?>

0 commit comments

Comments
 (0)