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.

ip_tracker_history.php 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. /************************************************************************
  3. ||------------|| User IP history page ||---------------------------||
  4. This page lists previous IPs a user has connected to the site with. It
  5. gets called if $_GET['action'] == 'ips'.
  6. It also requires $_GET['userid'] in order to get the data for the correct
  7. user.
  8. ************************************************************************/
  9. define('IPS_PER_PAGE', 25);
  10. if (!check_perms('users_mod')) {
  11. error(403);
  12. }
  13. $UserID = $_GET['userid'];
  14. if (!is_number($UserID)) {
  15. error(404);
  16. }
  17. $DB->query("
  18. SELECT um.Username,
  19. p.Level AS Class
  20. FROM users_main AS um
  21. LEFT JOIN permissions AS p ON p.ID = um.PermissionID
  22. WHERE um.ID = $UserID");
  23. list($Username, $Class) = $DB->next_record();
  24. if (!check_perms('users_view_ips', $Class)) {
  25. error(403);
  26. }
  27. $UsersOnly = $_GET['usersonly'];
  28. View::show_header("Tracker IP address history for $Username");
  29. ?>
  30. <script type="text/javascript">
  31. function ShowIPs(rowname) {
  32. $('tr[name="'+rowname+'"]').gtoggle();
  33. }
  34. </script>
  35. <?
  36. list($Page, $Limit) = Format::page_limit(IPS_PER_PAGE);
  37. $Perms = get_permissions_for_user($UserID);
  38. if ($Perms['site_disable_ip_history']) $Limit = 0;
  39. $TrackerIps = $DB->query("
  40. SELECT IP, fid, tstamp
  41. FROM xbt_snatched
  42. WHERE uid = $UserID
  43. AND IP != ''
  44. ORDER BY tstamp DESC
  45. LIMIT $Limit");
  46. $DB->query('SELECT FOUND_ROWS()');
  47. list($NumResults) = $DB->next_record();
  48. $DB->set_query_id($TrackerIps);
  49. $Pages = Format::get_pages($Page, $NumResults, IPS_PER_PAGE, 9);
  50. ?>
  51. <div class="thin">
  52. <div class="header">
  53. <h2>Tracker IP address history for <a href="user.php?id=<?=$UserID?>"><?=$Username?></a></h2>
  54. </div>
  55. <div class="linkbox"><?=$Pages?></div>
  56. <table>
  57. <tr class="colhead">
  58. <td>IP address</td>
  59. <td>Torrent</td>
  60. <td>Time</td>
  61. </tr>
  62. <?
  63. $Results = $DB->to_array();
  64. foreach ($Results as $Index => $Result) {
  65. list($IP, $TorrentID, $Time) = $Result;
  66. ?>
  67. <tr class="row">
  68. <td>
  69. <?=$IP?> (<?=Tools::get_country_code_by_ajax($IP)?>)<br /><?=Tools::get_host_by_ajax($IP)?>
  70. <a href="http://whatismyipaddress.com/ip/<?=display_str($IP)?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
  71. </td>
  72. <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a></td>
  73. <td><?=date('Y-m-d g:i:s', $Time)?></td>
  74. </tr>
  75. <?
  76. }
  77. ?>
  78. </table>
  79. <div class="linkbox">
  80. <?=$Pages?>
  81. </div>
  82. </div>
  83. <?
  84. View::show_footer();
  85. ?>