Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config to display CashPoints instead of Credits #389

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions modules/account/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
?>
Loading