Contributing back some bug fixes
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.

class_demotions.php 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?
  2. //------------- Demote users --------------------------------------------//
  3. // Disabled in favor of store-based promotions
  4. /*
  5. $Query = $DB->query('
  6. SELECT ID
  7. FROM users_main
  8. WHERE PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.')
  9. AND Uploaded / Downloaded < 0.95
  10. OR PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.')
  11. AND Uploaded < 25 * 1024 * 1024 * 1024');
  12. echo "demoted 1\n";
  13. $DB->query('
  14. UPDATE users_main
  15. SET PermissionID = '.MEMBER.'
  16. WHERE PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.')
  17. AND Uploaded / Downloaded < 0.95
  18. OR PermissionID IN('.POWER.', '.ELITE.', '.TORRENT_MASTER.')
  19. AND Uploaded < 25 * 1024 * 1024 * 1024');
  20. $DB->set_query_id($Query);
  21. while (list($UserID) = $DB->next_record()) {*/
  22. /*$Cache->begin_transaction("user_info_$UserID");
  23. $Cache->update_row(false, array('PermissionID' => MEMBER));
  24. $Cache->commit_transaction(2592000);*/
  25. /*$Cache->delete_value("user_info_$UserID");
  26. $Cache->delete_value("user_info_heavy_$UserID");
  27. Misc::send_pm($UserID, 0, 'You have been demoted to '.Users::make_class_string(MEMBER), "You now only meet the requirements for the \"".Users::make_class_string(MEMBER)."\" user class.\n\nTo read more about ".SITE_NAME."'s user classes, read [url=".site_url()."wiki.php?action=article&amp;name=userclasses]this wiki article[/url].");
  28. }
  29. echo "demoted 2\n";
  30. $Query = $DB->query('
  31. SELECT ID
  32. FROM users_main
  33. WHERE PermissionID IN('.MEMBER.', '.POWER.', '.ELITE.', '.TORRENT_MASTER.')
  34. AND Uploaded / Downloaded < 0.65');
  35. echo "demoted 3\n";
  36. $DB->query('
  37. UPDATE users_main
  38. SET PermissionID = '.USER.'
  39. WHERE PermissionID IN('.MEMBER.', '.POWER.', '.ELITE.', '.TORRENT_MASTER.')
  40. AND Uploaded / Downloaded < 0.65');
  41. $DB->set_query_id($Query);
  42. while (list($UserID) = $DB->next_record()) {*/
  43. /*$Cache->begin_transaction("user_info_$UserID");
  44. $Cache->update_row(false, array('PermissionID' => USER));
  45. $Cache->commit_transaction(2592000);*/
  46. /*$Cache->delete_value("user_info_$UserID");
  47. $Cache->delete_value("user_info_heavy_$UserID");
  48. Misc::send_pm($UserID, 0, 'You have been demoted to '.Users::make_class_string(USER), "You now only meet the requirements for the \"".Users::make_class_string(USER)."\" user class.\n\nTo read more about ".SITE_NAME."'s user classes, read [url=".site_url()."wiki.php?action=article&amp;name=userclasses]this wiki article[/url].");
  49. }
  50. echo "demoted 4\n";
  51. */
  52. ?>