mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-19 10:03:17 -04:00
Squashed commit of the following: Author: Spine <[email protected]> schema additions for bonus points we do not hand out invitations any more move Bonus code from classes/ to app/ BP items are now stored in the database, purchase history is recorded, add invites as an item to purchase Fix some stupid bugs switch reversed title labels Author: itismadness <[email protected]> Fix coding standards and some slight bugs Fix join I broke by renaming SQL columns Remove double charge on purchasing titles Update user page to properly reflect capitalization change in arrays Check that user meets MinClass for purchasing invites change price for invite to 20,000 BP
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php
|
|
if (!check_perms('users_mod')) {
|
|
error(403);
|
|
}
|
|
$Message = "";
|
|
if (isset($_REQUEST['add_points'])) {
|
|
authorize();
|
|
$Points = floatval($_REQUEST['num_points']);
|
|
|
|
if ($Points < 0) {
|
|
error('Please enter a valid number of points.');
|
|
}
|
|
|
|
$sql = "
|
|
UPDATE users_main
|
|
SET BonusPoints = BonusPoints + {$Points}
|
|
WHERE Enabled = '1'";
|
|
$DB->query($sql);
|
|
$sql = "
|
|
SELECT ID
|
|
FROM users_main
|
|
WHERE Enabled = '1'";
|
|
$DB->query($sql);
|
|
while (list($UserID) = $DB->next_record()) {
|
|
$Cache->delete_value("user_stats_{$UserID}");
|
|
}
|
|
$Message = '<strong>' . number_format($Points) . ' bonus points added to all enabled users.</strong><br /><br />';
|
|
}
|
|
|
|
View::show_header('Add tokens sitewide');
|
|
|
|
?>
|
|
<div class="header">
|
|
<h2>Add bonus points tokens to all enabled users</h2>
|
|
</div>
|
|
<div class="box pad" style="margin-left: auto; margin-right: auto; text-align: center; max-width: 40%;">
|
|
<?=$Message?>
|
|
<form class="add_form" name="fltokens" action="" method="post">
|
|
<input type="hidden" name="action" value="bonus_points" />
|
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
|
Points to add: <input type="text" name="num_points" size="10" style="text-align: right;" /><br /><br />
|
|
<input type="submit" name="add_points" value="Add points" />
|
|
</form>
|
|
</div>
|
|
<br />
|
|
<?
|
|
|
|
View::show_footer();
|
|
?>
|