Error: config.php file is not available. Did you forget to upload it?" . " If you haven't run the installer yet, please do so here."; exit(); } require_once ("config.php"); require_once ("funcsv2.php"); //Check session only if hiddentracker is TRUE if ($hiddentracker == true) { session_start(); if (!$_SESSION['admin_logged_in'] && !$_SESSION['upload_logged_in']) { //check fails header("Location: authenticate.php?status=indexlogin"); exit(); } } ?> <?php if ($GLOBALS["title"] != "") echo $GLOBALS["title"]; else echo "Tracker Statistics";?> "; ?> "); else $db = mysql_connect($dbhost, $dbuser, $dbpass) or die(errorMessage() . "Tracker error: can't connect to database - " . mysql_error() . "

"); mysql_select_db($database) or die(errorMessage() . "Tracker error: can't open database $database - " . mysql_error() . "

"); $query = "SELECT SUM(".$prefix."namemap.size), SUM(".$prefix."summary.seeds), SUM(".$prefix."summary.leechers), SUM(".$prefix."summary.finished), SUM(".$prefix."summary.dlbytes), SUM(".$prefix."summary.speed) FROM ".$prefix."summary LEFT JOIN ".$prefix."namemap ON ".$prefix."summary.info_hash = ".$prefix."namemap.info_hash"; $results = mysql_query($query) or die(errorMessage() . "Can't do SQL query - " . mysql_error() . "

"); $data = mysql_fetch_row($results); ?>
" . bytesToString($data[0]) . "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($GLOBALS["countbytes"]) //stop count bytes OFF, OK to do speed calculation { if ($data[5] > 2097152) echo "\n"; else echo "\n"; } else echo "\n"; } ?>
Total Space Used Seeders Leechers Completed D/Ls Bytes Transferred Speed (rough estimate)
" . $data[1] . "" . $data[2] . "" . $data[3] . "" . bytesToString($data[4]) . "" . round($data[5] / 1048576, 2) . " MB/sec" . round($data[5] / 1024, 2) . " KB/secNo Info Available

" . $_SESSION["username"] . "
"; echo "\"Logout\"Logout"; } ?>
Add TorrentAdd Torrent to Tracker Database Admin PageAdmin Page RSS 2.0 FeedRSS 2.0 Feed"; } ?>
Show all torrents\n"; else echo "\n"; $scriptname = $_SERVER["PHP_SELF"] . "?"; if (!isset($_GET["seededonly"])) $scriptname = $scriptname . "seededonly=yes&"; if (isset($_GET["activeonly"]) && !isset($_GET["seededonly"])) { $scriptname = $scriptname . "activeonly=yes&"; $_GET["page_number"] = 1; } if (isset($_GET["page_number"])) $scriptname = $scriptname . "page_number=" . $_GET["page_number"] . "&"; if (isset($_GET["seededonly"])) echo "\n"; else echo "\n"; $scriptname = $_SERVER["PHP_SELF"] . "?"; ?>
Show only active torrentsShow all torrentsShow only seeded torrents
"); else $db = mysql_connect($dbhost, $dbuser, $dbpass) or die(errorMessage() . "Tracker error: can't connect to database - " . mysql_error() . "

"); mysql_select_db($database) or die(errorMessage() . "Tracker error: can't open database $database - " . mysql_error() . "

"); if (isset($_GET["seededonly"])) $where = " WHERE seeds > 0"; else if (isset($_GET["activeonly"])) $where = " WHERE leechers+seeds > 0"; else $where = " "; $query = "SELECT COUNT(*) FROM ".$prefix."summary $where"; $results = mysql_query($query); $res = mysql_result($results,0,0); if (isset($_GET["activeonly"])) $scriptname = $scriptname . "activeonly=yes&"; if (isset($_GET["seededonly"])) $scriptname = $scriptname . "seededonly=yes&"; echo "

Page: \n"; $count = 0; $page = 1; while($count < $res) { if (isset($_GET["page_number"]) && $page == $_GET["page_number"]) echo "($page)-\n"; else if (!isset($_GET["page_number"]) && $page == 1) echo "($page)-\n"; else echo "$page-\n"; $page++; $count = $count + 10; } echo "

\n"; ?> Use Policy and Terms of Service"; ?>
Bytes Transferred'; ?> "); $i = 0; while ($data = mysql_fetch_row($results)) { // NULLs are such a pain at times. isset($nullvar) == false if (is_null($data[5])) $data[5] = $data[0]; if (is_null($data[6])) $data[6] = ""; if (is_null($data[7])) $data[7] = ""; if (strlen($data[5]) == 0) $data[5] = $data[0]; $myhash = $data[0]; $writeout = "row" . $i % 2; echo "\n"; echo "\t\n"; for ($j=1; $j < 4; $j++) //show seeders, leechers, and completed downloads { echo "\t\n"; if ($j == 1) //add to total seeders $total_seeders = $total_seeders + $data[1]; if ($j == 2) //add to total leechers $total_leechers = $total_leechers + $data[2]; if ($j == 3) //add to completed downloads $total_downloads = $total_downloads + $data[3]; } if ($GLOBALS["countbytes"]) { echo "\t\n"; $total_bytes_transferred = $total_bytes_transferred + $data[4]; //add to total GB transferred // The SPEED column calculations. if ($data[8] <= 0) { $speed = "0"; $total_speed = $total_speed - $data[8]; //for total speed column } else if ($data[8] > 2097152) $speed = round($data[8] / 1048576, 2) . " MB/sec"; else $speed = round($data[8] / 1024, 2) . " KB/sec"; echo "\t\n"; $total_speed = $total_speed + $data[8]; //add to total speed, in bytes } echo "\n"; $i++; } if ($i == 0) echo ""; //show totals in last row echo ""; echo ""; echo ""; echo ""; echo ""; if ($GLOBALS["countbytes"]) //stop count bytes variable { echo ""; if ($total_speed > 2097152) echo ""; else echo ""; } ?>
Name/Info Hash Seeders Leechers Completed D/Ls Speed (rough estimate)
"; echo "\t"; else //just display ordinary direct link echo " (Download Torrent)"; if (strlen($data[7]) > 0) //show file size { echo ""; $total_disk_usage = $total_disk_usage + $data[7]; //total up file sizes } echo "
\n"; echo "\t
\n"; echo "\t\n"; echo "\t
\n"; echo "\t
\n"; if (strlen($data[6]) > 0) echo "${data[5]} - "; else echo $data[5] . " - "; if ($hiddentracker == true) //obscure direct link to torrent, use dltorrent.php script echo " (Download Torrent)
 " . bytesToString($data[7]) . "
$data[$j]" . bytestoString($data[4]) . "$speed
No torrents
Space Used: " . bytesToString($total_disk_usage) . "" . $total_seeders . "" . $total_leechers . "" . $total_downloads . "" . bytestoString($total_bytes_transferred) . "" . round($total_speed / 1048576, 2) . " MB/sec" . round($total_speed / 1024, 2) . " KB/sec
RivetTracker Version: 1.0
HelpHelp

Notes

  • This tracker does NAT checking when users connect. If you receive a probe to port 6881, it's probably this tracker.
  • \n"; else echo "\n"; echo "\n"; if (rand(1, 10) == 1) { //10% of the time, run sanity_no_output.php to prune database and keep users fresh include("sanity_no_output.php"); } ?>