Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 4th January 2009, 18:02
adrian21's Avatar
adrian21 adrian21 is offline
Senior Member
 
Join Date: Oct 2008
P2P
Posts: 55
Smile List of all peers on tracker
Make a file called viewpeers.php and upload to your root

PHP Code:
<?
require "include/bittorrent.php";
dbconn();
stdhead("Peerlist");

if (get_user_class() < UC_MODERATOR) {
stdmsg("Sorry", "No permissions.");
stdfoot();
exit;
}

$count1 = number_format(get_row_count("peers"));
print("<h2 align=center>Peerlist</h2>");
print("<center><font class=small>We have $count1 peers</font></center><br>");
print("<table width=80% border=1 cellspacing=0 cellpadding=10><tr><td class=text align=center>\n");
$res4 = mysql_query("SELECT COUNT(*) FROM peers $limit") or sqlerr();
$row4 = mysql_fetch_array($res4);
$count = $row4[0];
$peersperpage = 15;
list($pagertop, $pagerbottom, $limit) = pager($peersperpage, $count, "viewpeers.php?");
print("$pagertop");
$sql = "SELECT * FROM peers ORDER BY started DESC $limit";
$result = mysql_query($sql);
if( mysql_num_rows($result) != 0 ) {
print'<table width=100% border=1 cellspacing=0 cellpadding=5 align=center>';
print'<tr>';
print'<td class=colhead align=center>User</td>';
print'<td class=colhead align=center>Torrent</td>';
print'<td class=colhead align=center>IP</td>';
print'<td class=colhead align=center>Port</td>';
print'<td class=colhead align=center>Upl.</td>';
print'<td class=colhead align=center>Downl.</td>';
print'<td class=colhead align=center>Peer-ID</td>';
print'<td class=colhead align=center>Conn.</td>';
print'<td class=colhead align=center>Seeding</td>';
print'<td class=colhead align=center>Started</td>';
print'<td class=colhead align=center>Last<br>Action</td>';
print'<td class=colhead align=center>Prev.<br>Action</td>';
print'<td class=colhead align=center>Upload<br>Offset</td>';
print'<td class=colhead align=center>Download<br>Offset</td>';
print'<td class=colhead align=center>To<br>Go</td>';
print'</tr>';
while($row = mysql_fetch_assoc($result)) {
$sql1 = "SELECT * FROM users WHERE id = $row[userid]";
$result1 = mysql_query($sql1);
while ($row1 = mysql_fetch_assoc($result1)) {
print'<tr>';
print'<td><a href="userdetails.php?id=' . $row['userid'] . '">' . $row1['username'] . '</a></td>';
$sql2 = "SELECT * FROM torrents WHERE id = $row[torrent]";
$result2 = mysql_query($sql2);
while ($row2 = mysql_fetch_assoc($result2)) {
$smallname =substr(htmlspecialchars($row2["name"]) , 0, 40);
if ($smallname != htmlspecialchars($row2["name"])) {
$smallname .= '...';
}
#$smallname = htmlspecialchars($row2["name"]);
print'<td><a href="details.php?id=' . $row['torrent'] . '">' . $smallname . '</td>';
print'<td align=center>' . $row['ip'] . '</td>';
print'<td align=center>' . $row['port'] . '</td>';
if ($row['uploaded'] < $row['downloaded'])
print'<td align=center><font color=red>' . mksize($row['uploaded']) . '</font></td>';
else
if ($row['uploaded'] == '0')
print'<td align=center>' . mksize($row['uploaded']) . '</td>';
else
print'<td align=center><font color=green>' . mksize($row['uploaded']) . '</font></td>';
print'<td align=center>' . mksize($row['downloaded']) . '</td>';
print'<td align=center>' . $row['peer_id'] . '</td>';
if ($row['connectable'] == 'yes')
print'<td align=center><font color=green>' . $row['connectable'] . '</font></td>';
else
print'<td align=center><font color=red>' . $row['connectable'] . '</font></td>';
if ($row['seeder'] == 'yes')
print'<td align=center><font color=green>' . $row['seeder'] . '</font></td>';
else
print'<td align=center><font color=red>' . $row['seeder'] . '</font></td>';
print'<td align=center>' . $row['started'] . '</td>';
print'<td align=center>' . $row['last_action'] . '</td>';
print'<td align=center>' . $row['prev_action'] . '</td>';
print'<td align=center>' . mksize($row['uploadoffset']) . '</td>';
print'<td align=center>' . mksize($row['downloadoffset']) . '</td>';
print'<td align=center>' . mksize($row['to_go']) . '</td>';
print'</tr>';
}
}
}
print'</table>';
print("$pagerbottom");
}
else {
print'Nothing here :(';
}
print("</td></tr></table>\n");

stdfoot();
?>
Enjoy

Last edited by adrian21; 4th January 2009 at 18:04. Reason: Missing from data
Reply With Quote
The Following 4 Users Say Thank You to adrian21 For This Useful Post:
meredis (12th January 2009), phazer (10th October 2009), Storm6699 (9th February 2010), vedroboy (3rd March 2009)
Reply

Tags
list , peers , tracker

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
See Tracker PM`s Fynnon Mods & Themes 3 3rd March 2013 11:54
peers apocalips TBDev 1 22nd September 2009 07:23
Speed stats in peers Fynnon Mods & Themes 2 15th April 2009 17:38
Issues 5.1 Peers hhc Template Shares 3 31st March 2009 23:47
Problem with peers FAZ Template Shares 1 14th November 2008 06:01



All times are GMT +2. The time now is 11:26. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2020, vBulletin Solutions Inc.