Now this will only work if you have the free leech installed. I took this from torrent strike and modified it a little so it will work here. it also has where you can add a category number for categories that always stay free leech so when you turn off free leech they stay on. now it is just a normal click here sentence but you could always replace that with a button.
in admincp.php find:
now you can go into the free leech in your staff cp and use the function. i have tested this on v2.03 and it works. i am also working on a code that will set certain categories automatically to freeleech on upload so if you have any ideas let me know. enjoy :)
in admincp.php find:
if ($action=="freetorrents"){
stdhead("Free Leech Torrent Management");
navmenu();
$search = trim($search);
if ($search != '' ){
$whereand = "AND name LIKE " . sqlesc("%$search%") . "";
}
$res2 = mysql_query("SELECT COUNT(*) FROM torrents WHERE freeleech='1' $whereand");
$row = mysql_fetch_array($res2);
$count = $row[0];
$perpage = 50;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "admincp.php?action=freetorrents&");
begin_frame("Free Leech Torrent Management");
print("<CENTER><form method=get action=?>\n");
print("<input type=hidden name=action value=torrentmanage>\n");
print("" . SEARCH . ": <input type=text size=30 name=search>\n");
print("<input type=submit value='Search'>\n");
print("</form></CENTER>\n");
echo $pagertop;
?>
<CENTER><table align=center cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">
<tr>
<td class=table_head align=center>Name</td>
<td class=table_head align=center>Visible</td>
<td class=table_head align=center>Banned</td>
<td class=table_head align=center>Seeders</td>
<td class=table_head align=center>Leechers</td>
<td class=table_head align=center>Edit?</td>
</tr>
<?
$rqq = "SELECT id, name, seeders, leechers, visible, banned FROM torrents WHERE freeleech='1' $whereand ORDER BY name $limit";
$resqq = mysql_query($rqq);
while ($row = mysql_fetch_array($resqq)){
extract ($row);
$char1 = 35; //cut name length
$smallname = CutName(htmlspecialchars($row["name"]), $char1);
echo "<tr><td class=table_col1>" . $smallname . "</td><td class=table_col2>$row[visible]</td><td class=table_col1>$row[banned]</td><td class=table_col2>$row[seeders]</td><td class=table_col1>$row[leechers]</td><td class=table_col2><a href=\"torrents-edit.php?returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&id=" . $row["id"] . "\"><font size=1 face=Verdana>EDIT</a></td></tr>\n";
}
echo "</table></CENTER>\n";
print($pagerbottom);
end_frame();
stdfoot();
}and replace with:#======================================================================#
# Free Torrents
#======================================================================#
if ($action=="freetorrents"){
stdhead("Free Leech Torrent Management");
navmenu();
begin_frame("Free Leech Torrent Management");
$search = trim($search);
if ($search != '' ){
$whereand = "AND name LIKE " . sqlesc("%$search%") . "";
}
if ($do=="setallfree") {
mysql_query("UPDATE torrents SET freeleech='1' WHERE freeleech='0'");
print("<font size=2 color=red><center>Success, All torrents have been set free..</b></center></font><br>\n");
}else
if ($do=="setallnormal") {
mysql_query("UPDATE torrents SET freeleech='0' WHERE freeleech='1' AND category!='50'");
print("<font size=2 color=red><center><b>Success, All torrents have been set normal..</b></center></font><br>\n");
}
$res2 = mysql_query("SELECT COUNT(*) FROM torrents WHERE freeleech='1' $whereand");
$row = mysql_fetch_array($res2);
$count = $row[0];
$perpage = 50;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "admincp.php?action=freetorrents&");
print("<CENTER><form method=get action=?>\n");
print("<input type=hidden name=action value=torrentmanage>\n");
print("" . SEARCH . ": <input type=text size=30 name=search>\n");
print("<input type=submit value='Search'>\n");
print("</form></CENTER>\n");
echo "<br>";
print("<font size=2><center>Click <a href=admincp.php?action=freetorrents&do=setallfree><b><u>here</b></u></a> to set all torrents free.. </center></font><br><br> <font size=2><center>Click <a href=admincp.php?action=freetorrents&do=setallnormal><b><u>here</u></b></a> to set all torrents normal..</center></font> \n");
echo $pagertop;
?>
<CENTER><table align=center cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">
<tr>
<td class=table_head align=center>Name</td>
<td class=table_head align=center>Visible</td>
<td class=table_head align=center>Banned</td>
<td class=table_head align=center>Seeders</td>
<td class=table_head align=center>Leechers</td>
<td class=table_head align=center>Edit?</td>
</tr>
<?
$rqq = "SELECT id, name, seeders, leechers, visible, banned FROM torrents WHERE freeleech='1' $whereand ORDER BY name $limit";
$resqq = mysql_query($rqq);
while ($row = mysql_fetch_array($resqq)){
extract ($row);
$char1 = 35; //cut name length
$smallname = CutName(htmlspecialchars($row["name"]), $char1);
echo "<tr><td class=table_col1>" . $smallname . "</td><td class=table_col2>$row[visible]</td><td class=table_col1>$row[banned]</td><td class=table_col2>$row[seeders]</td><td class=table_col1>$row[leechers]</td><td class=table_col2><a href=\"torrents-edit.php?returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&id=" . $row["id"] . "\"><font size=1 face=Verdana>EDIT</a></td></tr>\n";
}
echo "</table></CENTER>\n";
print($pagerbottom);
end_frame();
stdfoot();
}
#======================================================================#
# END Free Torrents
#======================================================================#
now if you want to change the number of the category that always stays free then find this code and change the number to your category number:
category!='50'now you can go into the free leech in your staff cp and use the function. i have tested this on v2.03 and it works. i am also working on a code that will set certain categories automatically to freeleech on upload so if you have any ideas let me know. enjoy :)