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.

hit_n_runs.php 913B

123456789101112131415161718192021222324252627282930313233
  1. <?
  2. //------------- Update Hit 'n Runs --------------------------------------//
  3. // This will never work until we start keeping track of upload/download stats
  4. // past the end of a session
  5. /*
  6. $DB->query("
  7. SELECT
  8. xs.uid AS uid,
  9. COUNT(xs.fid) AS hnrs
  10. FROM xbt_snatched AS xs
  11. LEFT JOIN xbt_files_users AS xfu ON xfu.uid=xs.uid AND xfu.fid=xs.fid
  12. LEFT JOIN torrents AS t ON xs.fid=t.ID
  13. WHERE xs.seedtime < 48
  14. AND (xfu.active IS NULL OR xfu.active=0)
  15. AND t.ID IS NOT NULL GROUP BY uid");
  16. $HnRs = $DB->to_array("uid", MYSQLI_ASSOC);
  17. $DB->query("SELECT ID,HnR FROM users_main");
  18. while(list($UserID, $HnR) = $DB->next_record()) {
  19. $NewHnR = isset($HnRs[$UserID]) ? $HnRs[$UserID]['hnrs'] : 0;
  20. if ($HnR != $NewHnR) {
  21. $DB->query("
  22. UPDATE users_main
  23. SET HnR = $NewHnR
  24. WHERE ID = $UserID");
  25. $Cache->delete_value('user_info_heavy_'.$UserID);
  26. $DB->set_query_id($getUsers);
  27. }
  28. } */
  29. ?>