Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

title.php 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?
  2. if (isset($_POST['title'])) {
  3. $Title = htmlspecialchars($_POST['title'], ENT_QUOTES);
  4. $UserID = $LoggedUser['ID'];
  5. $DB->query("
  6. SELECT BonusPoints
  7. FROM users_main
  8. WHERE ID = $UserID");
  9. if ($DB->has_results()) {
  10. list($Points) = $DB->next_record();
  11. if ($Points >= 50000) {
  12. $DB->query("
  13. UPDATE users_main
  14. SET BonusPoints = BonusPoints - 50000,
  15. Title = '$Title'
  16. WHERE ID = $UserID");
  17. $DB->query("
  18. UPDATE users_info
  19. SET AdminComment = CONCAT('".sqltime()." - Changed title to $Title via the store\n\n', AdminComment)
  20. WHERE UserID = $UserID");
  21. $Cache->delete_value('user_info_'.$UserID);
  22. $Cache->delete_value('user_info_heavy_'.$UserID);
  23. } else {
  24. error("Not enough points");
  25. }
  26. }
  27. View::show_header('Store'); ?>
  28. <div class="thin">
  29. <h2 id="general">Purchase Successful</h2>
  30. <div class="box pad" style="padding: 10px 10px 10px 20px;">
  31. <p>You purchased the title "<? print $Title ?>"</p>
  32. <p><a href="/store.php">Back to Store</a></p>
  33. </div>
  34. </div>
  35. <? View::show_footer();
  36. } else {
  37. View::show_header('Store'); ?>
  38. <div class="thin">
  39. <div class="box pad" style="padding: 10px 10px 10px 20px; text-align: center;">
  40. <form action="store.php" method="POST">
  41. <input type="hidden" name="item" value="title">
  42. <strong>
  43. Enter the title you want
  44. </strong>
  45. <br>
  46. <input type="text" name="title" value="">
  47. <input type="submit">
  48. </form>
  49. <p><a href="/store.php">Back to Store</a></p>
  50. </div>
  51. </div>
  52. <? View::show_footer();
  53. }
  54. ?>