Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

You have a new theme for v2.08. Puts this code after the all codes for header are finished. Or upload your header.php here.
You must have Anti Hit & Run System ([url="http://devscorner.xyz/topic/17641-anti-hit-run-system/?hl=%2Banti+%2Bsystem"]http://devscorner.xyz/topic/17641-anti-hit-run-system/?hl=%2Banti+%2Bsystem[/url][url="https://www.torrenttrader.org/topic/17641-anti-hit-run-system/"]/[/url]) and Seedbonus Manager ([url="http://devscorner.xyz/topic/2717-seeding-bonus/?hl=+seedbonus%20+manager"]http://devscorner.xyz/topic/2717-seeding-bonus/?hl=+seedbonus%20+manager[/url][url="https://www.torrenttrader.org/topic/16758-seedbonus-manager/"]/[/url]) fully installed.

Into header.php or footer.php at the each theme that you have installed, search this code:

if ($site_config["MIDDLENAV"]){
middleblocks();

and after him, copy this new code:

// Start Hit and Run Warning
$qry = SQL_Query_exec("SELECT COUNT(`hnr`) FROM `snatched` WHERE `uid` = '".$CURUSER["id"]."' AND `hnr` = 'yes'");
$res2 = mysql_fetch_row($qry);
$hnr = "<font style="background-color:#252525" color="#FEFEFE"><b>&nbsp; ".$res2[0]." &nbsp;</font>";
$hnr2 = $res2[0];

if ($res2[0] > 0) {
echo"<div style='margin-bottom:5px'>
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td style='padding: 10px; background: #AB0000' align="center">
<div style='font: bold 15px Times New Roman; color:#FFBF00'>
Hey $CURUSER[username], you have ".$hnr." recording".($hnr2 > 1 ? "s" : "")." for Hit and Run!&nbsp; View the recordings into <a href=snatched.php><font size=3 color=#CBCBCB>Your Snatch List</font></a>
</div>
<div style='font: bold 15px Times New Roman; color:#FFBF00'>
You must to keep seeding or you can <a href=required.php><font size=3 color=#CBCBCB>Trade to Delete</font></a> ".($hnr2 > 1 ? "these recordings" : "this recording")." with Seed Bonus or Upload
</div>
</td>
</tr>
</table>
</div>n";
}
// End Hit and Run Warning

Extract trade.zip archive and upload his content into your root



[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6766"]trade.zip[/url]
I have a few extra mods installed and I forgot by these, sorry...
I updated the attached archive, now it must work properly.
With this mod you can bring your favorite torrents into a personal list.
With this mod you can bring up your favorite torrents into a personal list.

Run into your database:

CREATE TABLE IF NOT EXISTS `bookmarks` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `userid` int(10) unsigned NOT NULL default '0',
 `torrentid` int(10) unsigned NOT NULL default '0',
 PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


Into backend/functions.php find and replace entire case 'name' code:

case 'name':
   $char1 = 35; //cut name length
   $smallname = htmlspecialchars(CutName($row["name"], $char1));
   $dispname = "<b>".$smallname."</b>";
             
   $last_access = $CURUSER["last_browse"];
   $time_now = gmtime();
   if ($last_access > $time_now || !is_numeric($last_access))
       $last_access = $time_now;
   if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access)
       $dispname .= "<b><font color='#ff0000'> - (".T_("NEW")."!)</font></b>";

   if ($row["freeleech"] == 1)
       $dispname .= " <img src='images/free.gif' border='0' alt='' />";
   print("<td class='ttable_col$x' nowrap='nowrap'>".(count($expandrows)?"<a href="javascript: klappe_torrent('t".$row['id']."')"><img border="0" src="".$site_config["SITEURL"]."/images/plus.gif" id="pict".$row['id']."" alt="Show/Hide" class="showthecross" /></a>":"")."&nbsp;<a title="".$row["name"]."" href="torrents-details.php?id=$id&amp;hit=1">$dispname</a></td>");
break;

         
With this new one:


case 'name':
   $char1 = 35; //cut name length
   $smallname = htmlspecialchars(CutName($row["name"], $char1));
   $dispname = "<b>".$smallname."</b>";

   $last_access = $CURUSER["last_browse"];
   $time_now = gmtime();
   if ($last_access > $time_now || !is_numeric($last_access))
       $last_access = $time_now;
   if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access) {
       $new = "<img src='images/t_new.png' border='0' title='New Torrent'>";
   } else {
       $new = "";
   }

   if ($row["freeleech"] == 1) {
       $freeleech = "<img src='images/free.gif' border='0' title='Free Leech'>";
   } else {
       $freeleech = "";
   }

   $bookt = SQL_Query_exec("SELECT torrentid FROM bookmarks WHERE torrentid = $id AND userid = $CURUSER[id]");
   if (mysql_num_rows($bookt) > 0) {
       $bookmark = "<a href='bookmark.php'><img src='images/bookmarked.png' border='0' title='Bookmarked'></a>";
   } else {
       $bookmark = "<a href='bookmarks.php?torrent=$id'><img src='images/bookmark.png' border='0' title='Bookmark this Torrent'></a>";
   }

   print("<td class='ttable_col$x' nowrap='nowrap'>".(count($expandrows)?"<a href="javascript: klappe_torrent('t".$row['id']."')"><img border="0" src="".$site_config["SITEURL"]."/images/plus.gif" id="pict".$row['id']."" alt="Show/Hide" class="showthecross" /></a>":"")."&nbsp;$bookmark <a title="".$row["name"]."" href="torrents-details.php?id=$id&amp;hit=1">$dispname</a> $freeleech $new</td>");
break;


Into torrents-details.php replace this line:

print ("<b>".T_("LAST_CHECKED").": </b>" . date("d-m-Y H:i:s", utc_to_tz_time($row["last_action"])) . "<br /></td>");


With this code:


print ("<b>".T_("LAST_CHECKED").": </b>" . date("d-M-Y H:i:s", utc_to_tz_time($row["last_action"])) . "");

   //===| Start Bookmarks
   $bookt = SQL_Query_exec("SELECT torrentid FROM bookmarks WHERE torrentid = $row[id] AND userid = $CURUSER[id]");
   if (mysql_num_rows($bookt) > 0)
       print("<div style='margin-top:3px'><font color='#0080FF'><b>Bookmark</b></font>: <font color='#FF2200'><b>This torrent is already into</b></font> <a href='bookmark.php'><b>Your Bookmarks</b></a>. &nbsp; [<a href='takedelbookmark.php?bookmarkid=".$row[id]."'><b>Delete it from the list</b></a>]</div>");
   else
       print("<div style='margin-top:3px'><font color='#0080FF'><b>Bookmark</b></font>: <a href='bookmarks.php?torrent=$row[id]'><b>Add this torrent</b></a> to <a href='bookmark.php'><b>Your Bookmarks</b></a></div>");
   //===| End Bookmarks

   print("</td>");


Into account.php after this line:

<?php print("<a href='mailbox.php'><font color="#FEFEFE"><b>".T_("YOUR_MESSAGES")."</b></font></a>");?>


Add this code:

&nbsp;|&nbsp;
<?php print("<a href=bookmark.php><font color="#FEFEFE"><b>Your Bookmarks</b></font></a>");?>

Extract the attached archive bookmark.zip and upload the content into your root.


[ATTACH]2171[/ATTACH][ATTACH]2172[/ATTACH][ATTACH]2173[/ATTACH]

[url='http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6718']bookmark.zip[/url]
For example change: $a[username] with: ".class_user($a[username])." and so far...
Run into your database:

CREATE TABLE IF NOT EXISTS `blocked` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `userid` int(10) unsigned NOT NULL default '0',
 `blockid` int(10) unsigned NOT NULL default '0',
 PRIMARY KEY  (`id`),
 UNIQUE KEY `userfriend` (`userid`,`blockid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `friends` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `userid` int(10) unsigned NOT NULL default '0',
 `friendid` int(10) unsigned NOT NULL default '0',
 PRIMARY KEY  (`id`),
 UNIQUE KEY `userfriend` (`userid`,`friendid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Into mailbox.php, before the line that begin with:
SQL_Query_exec("INSERT INTO `messages`

Copy this code:
//===| Start Blocked Users
$blocked = SQL_Query_exec("SELECT id FROM blocked WHERE userid=$sendto AND blockid=$CURUSER[id]");
$show = mysql_num_rows($blocked);
if ($show != 0 && $CURUSER["control_panel"] != "yes")
   show_error_msg("Error", "<div style='margin-top:10px; margin-bottom:10px' align='center'><font size=2 color=#FF2000><b>You're blocked by this member and you can not send messages to him!</b></font></div>", 1);
//===| End Blocked Users

Into account-details.php, before the line that begin with:
<?php echo T_("AGE"); ?>

Copy this code:
<!--| Start Friends |-->
<div style="margin-bottom:10px">
<?php
If ($CURUSER["id"] != $user["id"])
{
   $r = mysql_query("SELECT id FROM friends WHERE userid=$CURUSER[id] AND friendid=$id");
   $friend = mysql_num_rows($r);
   $r = mysql_query("SELECT id FROM blocked WHERE userid=$CURUSER[id] AND blockid=$id");
   $block = mysql_num_rows($r);

   if ($friend)
       print("[<a href=friends.php?action=delete&type=friend&targetid=$id>Remove from Friends</a>]n");
   elseif($block)
       print("&nbsp;[<a href=friends.php?action=delete&type=block&targetid=$id>Remove from Blocked</a>]n");
   else
   {
       print("[<a href=friends.php?action=add&type=friend&targetid=$id><b>Add to Friends</b></a>]&nbsp;");
       print("&nbsp;[<a href=friends.php?action=add&type=block&targetid=$id><b>Add to Blocked</b></a>]n");
   }
}
?>
</div>
<!--| End Friends |-->

And after this line:
show_error_msg(T_("ERROR"), T_("NO_ACCESS_ACCOUNT_DISABLED"), 1);

Copy this code:
//===| Start Blocked Users
$blocked = SQL_Query_exec("SELECT id FROM blocked WHERE userid=$user[id] AND blockid=$CURUSER[id]");
$show = mysql_num_rows($blocked);
if ($show != 0 && $CURUSER["control_panel"] != "yes")
   show_error_msg("Error", "<div style='margin-top:10px; margin-bottom:10px' align='center'><font size=2 color=#FF2000><b>You're blocked by this member and you can not see his profile!</b></font></div>", 1);
//===| End Blocked Users

Into account.php, after this line:
<?php print("<a href='mailbox.php'><b>".T_("YOUR_MESSAGES")."</b></a>");?>

Copy this code:
&nbsp;|&nbsp;
       <?php print("<a href='friends.php'><b>Your Friends</b></a>");?>

And finally, upload in your root the contents of friend.zip archive



[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6684"]friends.zip[/url]
I converted the short php tags to long ones and I updated the first post.

Now is truly a mod for v2.08   :)
You need to have installed class_color function: [url="https://www.torrenttrader.org/index.php/topic/17452-class-colors-function-for-208"]https://www.torrenttrader.org/index.php/topic/17452-class-colors-function-for-208[/url] or you need to remove all class_color codes.

Run in your database:

CREATE TABLE IF NOT EXISTS `bitbucket` (
 `id` int(11) NOT NULL auto_increment,
 `user` int(11) NOT NULL default '0',
 `filename` varchar(40) character set latin1 collate latin1_general_ci NOT NULL default '',
 `size` int(11) NOT NULL default '0',
 `originalname` varchar(255) character set latin1 collate latin1_general_ci NOT NULL default '',
 PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Add in backend/config.php:
// BitBucket
$site_config["MAX_UPLOAD_FILESIZE"] = 512 * 1024;  // Max file size
$site_config["MAX_BITBUCKET_SIZE_USER"] = 1 * 1024 * 1024;  // Max space for users
$site_config["MAX_BITBUCKET_SIZE_UPLOADER"] = 10 * 1024 * 1024;  // Max space for uploaders
$site_config["BITBUCKET_DIR"] = "bitbucket";  // BitBucket images directory
$site_config["LOADBAR_IMG"] = "images/loadbar/";  // Loadbar images location

Add into command section of admincp.php:
<td align="center"><a href="bitbucket-gallery.php"><img src="images/admin/bitbucket.png" border="0" width="32" height="32"><br />Bitbucket Gallery</a><br /></td>

Into account.php under this line:
<?php print("<a href='mailbox.php'><b>".T_("YOUR_MESSAGES")."</b></a>");?>

Add this code:
&nbsp;|&nbsp;
<?php print("<a href='bitbucket.php'><b>BitBucket</b></a>");?>

Create a new folder called bitbucket and set the file permission to 777.

Upload all files and folders contained into BitBucket.zip archive into your root.


[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6682"]BitBucket.zip[/url]
You're right  :lol:   I corrected.
[size=18px]A new "Warned Users" code especially for this system[/size]



Into admincp.php replace the warned code with this one:

#======================================================================#
# Warned Users - Updated by BigMax (25-Mar-2013)
#======================================================================#
if ($action == "warned") {

if ($do == "delete") {

if ($_POST["removeall"]) {
$res = SQL_Query_exec("SELECT `id` FROM `users` WHERE `enabled` = 'yes' AND `status` = 'confirmed' AND `warned` = 'yes'");
 
while ($row = mysql_fetch_assoc($res)) {
SQL_Query_exec("DELETE FROM `warnings` WHERE `active` = 'yes' AND `userid` = '$row[id]'");
SQL_Query_exec("UPDATE `users` SET `warned` = 'no' WHERE `id` = '$row[id]'");
}
} else {
if (!@count($_POST['warned']))
show_error_msg("Error", "Nothing selected", 1);
$ids = array_map("intval", $_POST["warned"]);
$ids = implode(", ", $ids);
SQL_Query_exec("DELETE FROM `warnings` WHERE `active` = 'yes' AND `userid` IN ($ids)");
SQL_Query_exec("UPDATE `users` SET `warned` = 'no' WHERE `id` IN ($ids)");
}
autolink("admincp.php?action=warned", "Entries Confirmed");
}
$perpage = 50;
$count = get_row_count("users", "WHERE enabled = 'yes' AND status = 'confirmed' AND warned = 'yes'");
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, 'admincp.php?action=warned&amp;');

$res = SQL_Query_exec("SELECT `id`, `username`, `class`, `added`, `last_access`, `downloaded`, `uploaded` FROM `users` WHERE `enabled` = 'yes' AND `status` = 'confirmed' AND `warned` = 'yes' ORDER BY `added` DESC $limit");

stdhead("Warned Users");
navmenu();

begin_frame("Warned Users");
$warnedusers = number_format($count);
?>

<div style="margin-top:10px; margin-bottom:10px" align="center"><font size="2">
This page displays all users which are enabled and have active warnings<? if (get_user_class() == 10) { ?>, they can be mass deleted or deleted per user<br />
Please note that if you delete a warning which was for poor ratio, then this is extending the time user has left to expire<? } ?>
<div style="margin-top:10px" align="center">We have <font color="#FF2200"><b><?php echo $warnedusers; ?></b></font> warned user<?php echo ($warnedusers != 1 ? "s" : ""); ?></div></font></div>

<?php If ($count > $perpage) {
print($pagertop);
}
?>
<?php if ($count > 0): ?>

<form id="warned" method="post" action="admincp.php?action=warned&amp;do=delete">
<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center" class="table_table">
<tr>
<th class="table_head" align="left">Username</th>
<th class="table_head" align="left">Class</th>
<th class="table_head" align="left">Uploaded</th>
<th class="table_head" align="left">Downloaded</th>
<th class="table_head" align="left">Ratio</th>
<th class="table_head">Added</th>
<th class="table_head">Last Access</th>
<th class="table_head">Warnings</th>
<th class="table_head"><font color="#FF2200"><b>H</b><small>&</small><b>R</b></font></th>
<? if (get_user_class() >= 6) { ?>
<th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
<?php  }  ?>
</tr>

<?php
while ($row = mysql_fetch_assoc($res)):

$qry = SQL_Query_exec("SELECT COUNT(`hnr`) FROM `snatched` WHERE `uid` = '".$row["id"]."' AND `hnr` = 'yes'");
$res2 = mysql_fetch_row($qry);
If ($res2[0] > 0) {
$hnr = "<font style="background-color:B50000" color="#FEFEFE"><b>&nbsp; ".$res2[0]." &nbsp;</b></font>";
} else {
$hnr = "<font color=limegreen><b>No</b></font>";
}
$addeded = date("d-M-Y H:i", utc_to_tz_time($row["added"]));
$joined = ("".get_elapsed_time(sql_timestamp_to_unix_timestamp($row["added"]))." ago");
$lastaccess = (($row["last_access"] == "0000-00-00 00:00:00") ? "Never logged" : "".date("d-M-Y H:i", utc_to_tz_time($row["last_access"]))."");
$lastseen = (($row["last_access"] == "0000-00-00 00:00:00") ? "---" : "".get_elapsed_time(sql_timestamp_to_unix_timestamp($row["last_access"]))." ago" );
$downloaded = "<font color=#FF2200><b>".mksize($row["downloaded"])."</b></font>";
$uploaded = "<font color=limegreen><b>".mksize($row["uploaded"])."</b></font>";
if($row["downloaded"] != 0) {
$ratio = number_format($row["uploaded"] / $row["downloaded"], 2);
} else {
$ratio = "---";
}
$ratio = "<font color=".get_ratio_color($ratio)."><b>$ratio</b></font>";
?>

<tr>
<td class="table_col1"><a href="account-details.php?id=<?php echo $row["id"]; ?>"><b><?php echo class_user($row["username"]); ?></b></a></td>
<td class="table_col2"><?php echo get_user_class_name($row["class"]); ?></td>
<td class="table_col1"><?php echo $uploaded; ?></td>
<td class="table_col2"><?php echo $downloaded; ?></td>
<td class="table_col1"><?php echo $ratio; ?></td>
<td class="table_col2" align="center"><?php echo "".$addeded."<br />".$joined.""; ?></td>
<td class="table_col1" align="center"><?php echo "".$lastaccess."<br />".$lastseen.""; ?></td>
<td class="table_col1" align="center"><font color="#FF2200"><b>Active</b></font>: &nbsp;&nbsp; [<a href="account-details.php?id=<?php echo $row["id"]; ?>#warnings"><b><?php echo number_format(get_row_count("warnings", "WHERE userid = '$row[id]' AND active = 'yes'")); ?></b></a>]
<div style="margin-top:4px"><font color="limegreen"><b>Expired</b></font>: &nbsp;[<a href="account-details.php?id=<?php echo $row["id"]; ?>#warnings"><b><?php echo number_format(get_row_count("warnings", "WHERE userid = '$row[id]' AND active != 'yes'")); ?></b></a>]</div></td>
<td class="table_col1" align="center"><?php echo $hnr; ?></td>
<?php if (get_user_class() >= 6) { ?>
<td class="table_col2" align="center"><input type="checkbox" name="warned[]" value="<?php echo $row["id"]; ?>" /></td>
<?php  }  ?>
</tr>
<?php endwhile; ?>
<?php if (get_user_class() >= 6) { ?>
<tr>
<td colspan="10" align="right">
<input type="submit" value="Remove Checked" />
<input type="submit" name="removeall" value="Remove All" />
</td>
</tr>
<?php  }  ?>
</table>
</form>
<?php else: ?>
<center><font size="2"><b>No Warned Users!</b></font></center>
<?php
endif;

If ($count > $perpage)  {
print($pagerbottom);
} else {
print("<br />");
}

end_frame();
stdfoot();
}
If you have external torrents on your tracker,  you must know how many are dead and eventually delete them.

Create a new file torrents-dead.php:



<?php

require_once("backend/functions.php");

dbconn();



   if ($CURUSER["control_panel"] != "yes") { show_error_msg(T_("ERROR"), T_("SORRY_NO_RIGHTS_TO_ACCESS"), 1); }



   $page = (int) $_GET["page"];

   $perpage = 50;



   $res2 = SQL_Query_exec("SELECT COUNT(*) FROM torrents WHERE banned = 'no' AND external = 'yes' AND seeders < 1");

   $row2 = mysql_fetch_array($res2);

   $count = $row2[0];

   

   list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "torrents-dead.php?id=$id&amp;");

   

   $res = SQL_Query_exec("SELECT torrents.id, torrents.name, torrents.owner, torrents.external, torrents.size, torrents.seeders, torrents.leechers, torrents.times_completed, torrents.added, torrents.last_action, users.username FROM torrents LEFT JOIN users ON torrents.owner = users.id WHERE torrents.banned = 'no' AND torrents.external = 'yes' AND torrents.seeders < 1 ORDER BY torrents.added DESC $limit");



   if ($_POST["do"] == "delete") {

       if (!@count($_POST["torrentids"]))

           show_error_msg("Error", "<div style='margin-top:10px; margin-bottom:10px' align='center'>You must select at least one torrent. &nbsp; [<a href='torrents-dead.php'><b>Go Back</b></a>]</div>", 1);

       foreach ($_POST["torrentids"] as $id) {

           deletetorrent(intval($id));

           write_log("<a href=account-details.php?id=$CURUSER[id]><b>$CURUSER[username]</b></a> has deleted external torrent ID: [<b>$id</b>] from the page: <i><b>Dead External Torrents</b></i>");

       }

       autolink("torrents-dead.php", "Selected torrent(s) was deleted successfully.");

   }

     

   stdhead("Dead Extrnal Torrents");



   if ($count < 1) show_error_msg("".T_("NOTHING")."", "<div style='margin-top:10px; margin-bottom:10px' align='center'><font size='2'>".T_("NO_DEAD_EX_TOR")."</font></div>", 1);

 

   begin_frame("Dead Extrnal Torrents");

   

   echo "<div style='margin-top:10px' align='center'><font size='2'>List of external torrents without seeders, ordered by upload date</font></div>";

   echo "<div style='margin-top:10px; margin-bottom:20px' align='center'><font size='2'>We have <font color='red'><b>$count</b></font> dead external torrent".($count != 1 ? "s" : "")."</font></div>";

   

   If ($count > $perpage) { print($pagertop); }

   ?>



   <form id="myform" method='post' action='torrents-dead.php'>

   <input type='hidden' name='do' value='delete' />

   <table cellpadding="5" cellspacing="0" class="table_table" align="center" width="100%">

       <tr>

           <th class="table_head" align="left"><?php echo T_("TORRENT_NAME"); ?></th>

           <th class="table_head" align="left"><?php echo T_("UPLOADER"); ?></th>

           <th class="table_head"><?php echo T_("SIZE"); ?></th>

           <th class="table_head"><img src="images/seed.gif" border="0" title="Seeders"></th>

           <th class="table_head"><img src="images/leech.gif" border="0" title="Leechers"></th>

           <th class="table_head"><img src="images/ready.png" border="0" title="Completed"></th>

           <th class="table_head" width="1%"><?php echo T_("ADDED"); ?></th>

           <th class="table_head" width="1%">Last Action</th>

       <?php if (get_user_class() >= 6) { ?>

           <th class='table_head'><input type='checkbox' name='checkall' onclick='checkAll(this.form.id);' /></th>

       <?php } ?>

       </tr>



       <?php

   while ($row = mysql_fetch_assoc($res))

   {

       if ($row["username"]) $owner = "<a href='account-details.php?id=".$row["owner"]."'><b>".$row["username"]."</b></a>";

   else $owner = T_("UNKNOWN_USER");

   ?>

 

       <tr>

           <td class="table_col1"><a href="torrents-details.php?id=<?php echo $row["id"]; ?>"><?php echo CutName(htmlspecialchars($row["name"]), 50) ?></a></td>

           <td class="table_col2"><?php echo $owner; ?></td>

           <td class="table_col2" align="center"><?php echo mksize($row["size"]); ?></td>

           <td class="table_col1" align="center"><font color="limegreen"><b><?php echo number_format($row["seeders"]); ?></b></font></td>

           <td class="table_col2" align="center"><font color="red"><b><?php echo number_format($row["leechers"]); ?></b></font></td>

           <td class="table_col1" align="center"><font color="#0080FF"><b><?php echo number_format($row["times_completed"]); ?></b></font></td>

           <td class="table_col2" align="center"><?php echo date("d.M.Y H:i", utc_to_tz_time($row["added"])) ?></td>

           <td class="table_col2" align="center"><?php echo date("d.M.Y H:i", utc_to_tz_time($row["last_action"])) ?></td>

       <?php if (get_user_class() >= 6) { ?>

           <td class='table_col2' align='center'><input type='checkbox' name='torrentids[]' value='<?php echo $row["id"]; ?>' /></td>

       <?php } ?>

       </tr>

 

   <?php

   }

   ?>

   </table>

   <?php if (get_user_class() >= 6) { ?>

       <div style='margin-top:3px' align='right'><input type='submit' value='Delete Checked' /></div>

   <?php } ?>

   </form>

   <?php

   If ($count > $perpage) { print($pagerbottom); } else { print("<br />"); }



   end_frame();

   stdfoot();

?>


[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6660"]images.zip[/url]
It seems that you don't have this function in functions.php:



function get_ratio_color($ratio) {

   if ($ratio < 0.1) return "#AD1400";

   if ($ratio < 0.2) return "#CB1800";

   if ($ratio < 0.3) return "#EC1C00";

   if ($ratio < 0.4) return "#D26200";

   if ($ratio < 0.5) return "#9D9B00";

   if ($ratio < 0.6) return "#C1B500";

   if ($ratio < 0.7) return "#A1BE00";

   if ($ratio < 0.8) return "#94C500";

   if ($ratio < 0.9) return "#7ECC00";

   if ($ratio < 1) return "#6FDD00";

   return "#2DDF00";

}



So copy this code there, below the last function.
This is another mod from tbdev that I adapted to work for TT 2.08

Create a new file called topten and upload it in your root:


<?php

require "backend/functions.php";
dbconn(false);
loggedinonly();

if (get_user_class() < 2)
   show_error_msg("Acces denied", "You must be at least Power User!", 1);

function usertable($res, $frame_caption) {
global $CURUSER;
   
begin_frame($frame_caption, true);
?>

<table class=table_table width=100% align=center border=0 cellpadding=4>
   <tr style="font:bold">

       <td class=table_head align=center width=10%>Rank</td>
       <td class=table_head align=left width=20%>User</td>
       <td class=table_head align=left width=10%>Uploaded</td>
       <td class=table_head align=left width=10%>UL speed</td>
       <td class=table_head align=left width=10%>Downloaded</td>
       <td class=table_head align=left width=10%>DL speed</td>
       <td class=table_head align=center width=10%>Ratio</td>
       <td class=table_head align=center width=20%>Joined</td>
   </tr>

<?php
   $num = 0;
   
while ($a = mysql_fetch_assoc($res)) {
 ++$num;
$highlight = $CURUSER["id"] == $a["userid"] ? " bgcolor=#1B2B1F" : "";

if ($a["downloaded"]) {
$ratio = $a["uploaded"] / $a["downloaded"];
$color = get_ratio_color($ratio);
$ratio = number_format($ratio, 2);
   
if ($color)
$ratio = "<font color=$color>$ratio</font>";
} else
$ratio = "Inf.";
print("<tr$highlight>
       
<td class=table_col1 align=center>$num</td>
<td class=table_col2 align=left$highlight><a href=account-details.php?id=" .$a["userid"] . "><b>" .    $a["username"] . "</b>" ."</td>
       <td class=table_col1 align=left$highlight><font color=limegreen>" . mksize($a["uploaded"]) . "</font></td>
       <td class=table_col2 align=left$highlight><font color=limegreen>" . mksize($a["upspeed"]) . "/s" ."</font></td>
       <td class=table_col1 align=left$highlight><font color=#FF2400>" . mksize($a["downloaded"]) . "</font></td>
       <td class=table_col2 align=left$highlight><font color=#FF2400>" . mksize($a["downspeed"]) . "/s" . "</font></td>
       <td class=table_col1 align=center$highlight>" . $ratio ."</td>
       <td class=table_col2 align=center>" . gmdate("d-M-Y",strtotime($a["added"])) . " (" .get_elapsed_time(sql_timestamp_to_unix_timestamp($a["added"])) . " ago)</td>
     </tr>");
}
print("</table>");
   end_frame();
 }

function _torrenttable($res, $frame_caption) {

begin_frame($frame_caption, true);

?>

<table class=table_table width=100% align=center border=0 cellpadding=4>
   <tr style="font:bold">
       <td class=table_head align=center>Rank</td>
       <td class=table_head align=left>Name</td>
       <td class=table_head align=center><img src="images/ready.png" border=0 title=Completed></td>
       <td class=table_head align=right>Traffic</td>
       <td class=table_head align=right><img src="images/seed.gif" border=0 title=Seeders></td></td>
       <td class=table_head align=right><img src="images/leech.gif" border=0 title=Leechers></td></td>
       <td class=table_head align=right>Total</td>
       <td class=table_head align=right>Ratio</td>
</tr>

<?php

   $num = 0;

while ($a = mysql_fetch_assoc($res)) {
 ++$num;

if ($a["leechers"]) {
$r = $a["seeders"] / $a["leechers"];
   $ratio = "<font color=" . get_ratio_color($r) . ">" . number_format($r, 2) . "</font>";
} else
$ratio = "Inf.";
   print("<tr>
       <td align=center class=table_col1>$num</td>
       <td align=left class=table_col2><a href=torrents-details.php?id=" . $a["id"] . "&hit=1><b>" . $a["name"] . "</b></a></td>
       <td align=center class=table_col1><font color=#0080FF><b>" . number_format($a["times_completed"]) . "</b></font></td>
       <td align=right class=table_col2>" . mksize($a["data"]) . "</td>
       <td align=right class=table_col1><font color=limegreen><b>" . number_format($a["seeders"]) . "</b></font></td>
       <td align=right class=table_col2><font color=red><b>" . number_format($a["leechers"]) . "</b></font></td>
       <td align=right class=table_col1>" . ($a["leechers"] + $a["seeders"]) . "</td>
       <td align=right class=table_col2>$ratio</td>
   </tr>\n");
}
   print("</table>");

end_frame();
}
 
function countriestable($res, $frame_caption, $what) {
global $CURUSER;

begin_frame($frame_caption, true);

?>

<table class=table_table width=50% align=center border=0 cellpadding=4>
   <tr style="font:bold">
       <td class=table_head align=center>Rank</td>
       <td class=table_head align=center>Country&nbsp;Flag</td>
       <td class=table_head align=left>Country&nbsp;Name</td>
       <td class=table_head align=right><?=$what?></td>
   </tr>

<?php

   $num = 0;
   
while ($a = mysql_fetch_assoc($res)) {
   ++$num;

if ($what == "Users")
  $value = number_format($a["num"]);
elseif ($what == "Uploaded")
       $value = mksize($a["ul"]);
elseif ($what == "Average")
   $value = mksize($a["ul_avg"]);
elseif ($what == "Ratio")
       $value = number_format($a["r"],2);

if ($a[flagpic]) {
       $flag = "<img align=center src=images/countries/$a[flagpic]>";
   } else {
   $flag = "<img align=center src=images/countries/unknown.gif>";
}

if ($a[name]) {
  $name = "<b>$a[name]</b>";
} else {
  $name = "<b>Land of Homeless!</b>";
}
   print("<tr>
       <td align=center class=table_col1>$num</td>
       <td align=center class=table_col2>" . "$flag</td>
       <td class=table_col1>$name</td>" . "
       <td align=right class=table_col2>$value</td>
   </tr>\n");
}
   print("</table>");

   end_frame();
 }

stdhead("Top 10");

 begin_frame("..:: Top Ten ::..");

   $type = isset($_GET["type"]) ? 0 + $_GET["type"] : 0;

if (!in_array($type,array(1,2,3)))
   $type = 1;
   $limit = isset($_GET["lim"]) ? 0 + $_GET["lim"] : false;
   $subtype = isset($_GET["subtype"]) ? $_GET["subtype"] : false;

   print("<div style='font: bold 12px Verdana; margin-top:10px; margin-bottom:15px' align=center>" .

   ($type == 1 && !$limit ? "Users" : "<a href=topten.php?type=1>Users</a>") .    " | " .
   ($type == 2 && !$limit ? "Torrents" : "<a href=topten.php?type=2>Torrents</a>") . " | " .
   ($type == 3 && !$limit ? "Countries" : "<a href=topten.php?type=3>Countries</a>") . "
   </div>\n");

   $pu = get_user_class($CURUSER) >= 3;

 if (!$pu)
 $limit = 10;

 if ($type == 1) {

   $mainquery = "SELECT id as userid, username, added, uploaded, downloaded, uploaded / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(added)) AS upspeed, downloaded / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(added)) AS downspeed FROM users WHERE enabled = 'yes'";

if (!$limit || $limit > 250)
   $limit = 10;

if ($limit == 10 || $subtype == "ul") {
$order = "uploaded DESC";
$r = SQL_Query_exec($mainquery . " ORDER BY $order " . " LIMIT $limit");
 usertable($r, "Top $limit Uploaders" . ($limit == 10 && $pu ? " <font class=small> -
[<a href=topten.php?type=1&amp;lim=100&amp;subtype=ul>Top 100</a>] - [<a href=topten.php?type=1&amp;lim=250&amp;subtype=ul>Top 250</a>]</font>" : ""));
}

if ($limit == 10 || $subtype == "dl") {
$order = "downloaded DESC";
$r = SQL_Query_exec($mainquery . " ORDER BY $order " . " LIMIT $limit");
 usertable($r, "Top $limit Downloaders" . ($limit == 10 && $pu ? " <font class=small> -
[<a href=topten.php?type=1&amp;lim=100&amp;subtype=dl>Top 100</a>] - [<a href=topten.php?type=1&amp;lim=250&amp;subtype=dl>Top 250</a>]</font>" : ""));
}
 
if ($limit == 10 || $subtype == "uls") {
$order = "upspeed DESC";
$r = SQL_Query_exec($mainquery . " ORDER BY $order " . " LIMIT $limit");
 usertable($r, "Top $limit Fastest Uploaders <font class=small>(average, includes inactive time)</font>" .
     ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=1&amp;lim=100&amp;subtype=uls>Top 100</a>] -
[<a href=topten.php?type=1&amp;lim=250&amp;subtype=uls>Top 250</a>]</font>" : ""));
}

if ($limit == 10 || $subtype == "dls") {
$order = "downspeed DESC";
$r = SQL_Query_exec($mainquery . "  ORDER BY $order " . " LIMIT $limit");
 usertable($r, "Top $limit Fastest Downloaders <font class=small>(average, includes inactive time)</font>" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=1&amp;lim=100&amp;subtype=dls>Top 100</a>] - [<a href=topten.php?type=1&amp;lim=250&amp;subtype=dls>Top 250</a>]</font>" : ""));
}
   
if ($limit == 10 || $subtype == "bsh") {
$order = "uploaded / downloaded DESC";
$extrawhere = " AND downloaded > 1073741824";
$r = SQL_Query_exec($mainquery . $extrawhere . " ORDER BY $order " . " LIMIT $limit");
 usertable($r, "Top $limit Best Sharers <font class=small>(with minimum 1 GB downloaded)</font>" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=1&amp;lim=100&amp;subtype=bsh>Top 100</a>] - [<a href=topten.php?type=1&amp;lim=250&amp;subtype=bsh>Top 250</a>]</font>" : ""));
}

if ($limit == 10 || $subtype == "wsh") {
$order = "uploaded / downloaded ASC, downloaded DESC";
$extrawhere = " AND downloaded > 1073741824";
$r = SQL_Query_exec($mainquery . $extrawhere . " ORDER BY $order " . " LIMIT $limit");

 usertable($r, "Top $limit Worst Sharers <font class=small>(with minimum 1 GB downloaded)</font>" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=1&amp;lim=100&amp;subtype=wsh>Top 100</a>] - [<a href=topten.php?type=1&amp;lim=250&amp;subtype=wsh>Top 250</a>]</font>" : ""));
}
}
elseif ($type == 2)
{
 
if (!$limit || $limit > 50)
$limit = 10;

if ($limit == 10 || $subtype == "act") {

   $r = SQL_Query_exec("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' GROUP BY t.id ORDER BY seeders + leechers DESC, seeders DESC, added ASC LIMIT $limit");

 _torrenttable($r, "Top $limit Most Active Torrents" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=2&amp;lim=25&amp;subtype=act>Top 25</a>] - [<a href=topten.php?type=2&amp;lim=50&amp;subtype=act>Top 50</a>]</font>" : ""));
}

if ($limit == 10 || $subtype == "sna") {

$r = SQL_Query_exec("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' GROUP BY t.id ORDER BY times_completed DESC LIMIT $limit");
 _torrenttable($r, "Top $limit Most Snatched Torrents" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=2&amp;lim=25&amp;subtype=sna>Top 25</a>] - [<a href=topten.php?type=2&amp;lim=50&amp;subtype=sna>Top 50</a>]</font>" : ""));
}

if ($limit == 10 || $subtype == "mdt") {
   $r = SQL_Query_exec("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND leechers >= 5 AND times_completed > 0 GROUP BY t.id ORDER BY data DESC, added ASC LIMIT $limit");

       _torrenttable($r, "Top $limit Most Data Transferred Torrents" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=2&amp;lim=25&amp;subtype=mdt>Top 25</a>] - [<a href=topten.php?type=2&amp;lim=50&amp;subtype=mdt>Top 50</a>]</font>" : ""));
}
   
if ($limit == 10 || $subtype == "bse") {
   $r = SQL_Query_exec("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND seeders >= 5 GROUP BY t.id ORDER BY seeders / leechers DESC, seeders DESC, added ASC LIMIT $limit");
 _torrenttable($r, "Top $limit Best Seeded Torrents <font class=small>(with minimum 5 seeders)</font>" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=2&amp;lim=25&amp;subtype=bse>Top 25</a>] - [<a href=topten.php?type=2&amp;lim=50&amp;subtype=bse>Top 50</a>]</font>" : ""));
}

if ($limit == 10 || $subtype == "wse") {
   $r = SQL_Query_exec("SELECT t.*, (t.size * t.times_completed + SUM(p.downloaded)) AS data FROM torrents AS t LEFT JOIN peers AS p ON t.id = p.torrent WHERE p.seeder = 'no' AND leechers >= 5 AND times_completed > 0 GROUP BY t.id ORDER BY seeders / leechers ASC, leechers DESC LIMIT $limit");
       _torrenttable($r, "Top $limit Worst Seeded Torrents <font class=small>(with minimum 5 leechers, excluding unsnatched torrents)</font>" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=2&amp;lim=25&amp;subtype=wse>Top 25</a>] - [<a href=topten.php?type=2&amp;lim=50&amp;subtype=wse>Top 50</a>]</font>" : ""));
}
}
elseif ($type == 3)
{

if (!$limit || $limit > 25)
$limit = 10;

if ($limit == 10 || $subtype == "us") {
   $r = SQL_Query_exec("SELECT name, flagpic, COUNT(users.country) as num FROM countries LEFT JOIN users ON users.country = countries.id GROUP BY name ORDER BY num DESC LIMIT $limit");
       countriestable($r, "Top $limit Countries<font class=small> (users)</font>" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=3&amp;lim=25&amp;subtype=us>Top 25</a>]</font>" : ""),"Users");
}

if ($limit == 10 || $subtype == "ul") {
   $r = SQL_Query_exec("SELECT c.name, c.flagpic, sum(u.uploaded) AS ul FROM users AS u LEFT JOIN countries AS c ON u.country = c.id WHERE u.enabled = 'yes' GROUP BY c.name ORDER BY ul DESC LIMIT $limit");

 countriestable($r, "Top $limit Countries<font class=small> (total uploaded)</font>" . ($limit == 10 && $pu ? " <font class=small> - [<a href=topten.php?type=3&amp;lim=25&amp;subtype=ul>Top 25</a>]</font>" : ""),"Uploaded");
}

if ($limit == 10 || $subtype == "avg") {
   $r = SQL_Query_exec("SELECT c.name, c.flagpic, sum(u.uploaded)/count(u.id) AS ul_avg FROM users AS u LEFT JOIN countries AS c ON u.country = c.id WHERE u.enabled = 'yes' GROUP BY c.name HAVING sum(u.uploaded) > 1099511627776 AND count(u.id) >= 100 ORDER BY ul_avg DESC LIMIT $limit");

 countriestable($r, "Top $limit Countries<font class=small> (average total uploaded per user, with minimum 1TB uploaded and 100 users)</font>" . ($limit == 10 && $pu ? " <font class=small> -
[<a href=topten.php?type=3&amp;lim=25&amp;subtype=avg>Top 25</a>]</font>" : ""),"Average");
}

if ($limit == 10 || $subtype == "r") {
   $r = SQL_Query_exec("SELECT c.name, c.flagpic, sum(u.uploaded)/sum(u.downloaded) AS r FROM users AS u LEFT JOIN countries AS c ON u.country = c.id WHERE u.enabled = 'yes' GROUP BY c.name HAVING sum(u.uploaded) > 1099511627776 AND sum(u.downloaded) > 1099511627776 AND count(u.id) >= 100 ORDER BY r DESC LIMIT $limit");

 countriestable($r, "Top $limit Countries<font class=small> (ratio, with minimum 1TB uploaded, 1TB downloaded and 100 users)</font>" . ($limit == 10 && $pu ? " <font class=small> -
[<a href=topten.php?type=3&amp;lim=25&amp;subtype=r>Top 25</a>]</font>" : ""),"Ratio");
}
}

end_frame();
stdfoot();
?>


Into 'Top 10 Fastest Uploaders' list you can easily find the users with abnormal amount of upload in a very short time.

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6658"]images.zip[/url]
If you want to see all the Bittorrent Clients that works on your tracker create a new file called clients.php:


<?php
require_once("backend/functions.php");
dbconn(false);
loggedinonly();

$res12 = SQL_Query_exec("SELECT client, peer_id FROM peers GROUP BY client");

stdhead("All Clients");
begin_frame("All Clients");

print("<br /><table class=tabla_table align=center border=0 cellspacing=0 cellpadding=5>n");
print("<tr><th class=table_head>Client</th><th class=table_head>Peer ID</th></tr>n");

while($arr12 = mysql_fetch_assoc($res12))
{
print("<tr><td class=table_col1>&nbsp; $arr12[client] &nbsp;</td><td class=table_col2>&nbsp; $arr12[peer_id] &nbsp;</td></tr>n");
}

print("</table><br />n");

end_frame();
stdfoot();
?>

If you want to ban a client this is a quick way to find the 'Client ID (Agent ID)' that is the same with 'Peer ID'.
Thanks ArcticWolf, this line is OK but for me not works properly and I don't know why...

I think I solved the problem in another way. Because at every `$event == "stopped"` is added to `ltime` the value of `$site_config ['announce_interval']`, this value must to be subtracted back from `ltime`.

Into announce.php below this line:



if ($event == "stopped") { // UPDATE "STOPPED" EVENT

I added this new line:




SQL_Query_exec("UPDATE LOW_PRIORITY `snatched` SET `ltime` = `ltime` - '".$site_config['announce_interval']."' WHERE `tid` = '$torrentid' AND `uid` = '$userid'");




After the tests that I've done show that it works correctly now but I'll be more confident after a few days.

Please tell your opinion about this change.
This is a wrong place?



}else{



   $elapsed = ($self['seeder'] == 'yes') ? (gmtime() - $self['ez']) : 0;

   $upthis = max(0, $uploaded - $self["uploaded"]);

   $downthis = max(0, $downloaded - $self["downloaded"]);



   if (($upthis > 0 || $downthis > 0 || $elapsed > 0) && is_valid_id($userid)){ // LIVE STATS!)



If is so, where should be placed?
I already have this code and unfortunately not help me with anything. The problem is not with rtorrent, is with extra time added and seedboxes.

I do not know exactly how does work a seedbox, but probably a torrent is stopped and restarted for many times in a day because the seeding time is increased so much.

On my tracker I have 2 seedboxes with Deluge and is the same issue with the seeding time. Users do not know this yet, otherwise you will see at them the same problem.

Send a mass PM and tell them how to make seed time and then you will see the same issue in their records :D
After many tests performed with many clients I can say that this code from announce.php does not work correctly:



$elapsed = ($self['seeder'] == 'yes') ? $site_config['announce_interval'] - floor(($self['ez'] - time()) / 60) : 0;


At least on my tracker...

No matter which client you use, if you stop a torrent from seeding when it starts again is added at the time of seeding and time for announce: $site_config['announce_interval']

So if a member has the patience to do that several times, he did not must to remain at seed, the seed time will be done with a few clicks...

And ArcticWolf, I'm sorry but your code multiplies extra time added for about 10 times. On my tracker this is the result...
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728