5000, 101 => 10000, 102 => 25000, 103 => 50000, 104 => 100000, 105 => 250000, 106 => 500000, 107 => 1000000]; if (!$BadgeID) { $Err = 'No badge specified.'; } elseif (!in_array($BadgeID, $ShopBadgeIDs)) { $Err = 'Invalid badge ID.'; } elseif (Badges::has_badge($UserID, $BadgeID)) { $Err = 'You already have this badge.'; } elseif ($BadgeID != $ShopBadgeIDs[0] && !Badges::has_badge($UserID, $ShopBadgeIDs[array_search($BadgeID, $ShopBadgeIDs)-1])) { $Err = 'You haven\'t purchased the badges before this one!'; } if (isset($_GET['confirm']) && $_GET['confirm'] == 1) { if (!isset($Err)) { $DB->query(" SELECT BonusPoints FROM users_main WHERE ID = $UserID"); if ($DB->has_results()) { list($BP) = $DB->next_record(); $BP = (int)$BP; if ($BP >= $Prices[$BadgeID]) { if (!Badges::award_badge($UserID, $BadgeID)) { $Err = 'Could not award badge, unknown error occurred.'; } else { $DB->query(" UPDATE users_main SET BonusPoints = BonusPoints - " . $Prices[$BadgeID] ." WHERE ID = $UserID"); $DB->query(" UPDATE users_info SET AdminComment = CONCAT('".sqltime()." - Purchased badge $BadgeID from store\n\n', AdminComment) WHERE UserID = $UserID"); $Cache->delete_value("user_info_heavy_$UserID"); } } else { $Err = 'Not enough '.BONUS_POINTS.'.'; } } } View::show_header('Store'); ?>

Purchase

Back to Store

Purchase Badge?

Badge cost:

Error:

Back to Store