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:
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6660"]images.zip[/url]
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&");
$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. [<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]

