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
List of Dead External Torrents
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2013-03-23 13:09:32
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]
images.zip
Download
Unknown User
2013-03-23 14:12:27
nice works great keep up the good work mate
2013-03-23 18:04:20
BigMax1 thanks you!  :)

From my side I add a admincp  ;)

 <td align="center"><a href="torrents_dead.php"><img src="images/admin/torrents-externe.png" border="0" width="32" height="32"><br /><?php echo T_("LIST_TORRENTS_EXTERNE"); ?></a><br /></td>




Add langues

French:

$LANG["LIST_TORRENTS_EXTERNE"] = "Liste des<br />torrents externe";

English:

$LANG["LIST_TORRENTS_EXTERNE"] = "List of<br />external torrents";


2015-03-26 07:28:25
big thanks
2019-08-08 19:19:33
thank you works well on the v3 and I converted them for non-external torrents;)
2019-08-09 00:39:41
[USER=401]@spiritblue[/USER] would you like to share your version with us please
2019-08-11 11:22:48
"DarkMaster, post: 67066, member: 1":

[USER=401]@spiritblue[/USER] would you like to share your version with us please

of course  ;)
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728