BioTorrents.de’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 857B

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