freeleech
credit to kami.
sql
PHP Code:
1 ALTER TABLE `torrents` ADD `freeleech` ENUM('0', '1') DEFAULT '0' NOT NULL;
2 Now we need to edit announce.php
Find this :
PHP Code:
if ($upthis > 0 || $downthis > 0)
mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
And replace it with this:
i
PHP Code:
f ($upthis > 0 || $downthis > 0)
{
$freelech = mysql_query("SELECT * FROM torrents WHERE id = '$torrentid' AND freeleech = '1'");
if (mysql_num_rows($freelech) == 1)
{
mysql_query("UPDATE users SET uploaded = uploaded + $upthis WHERE id=$userid") or err("Tracker error 3");
}
else
{
mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
}
}
3. Now make file called freeleech.php in your root dir and put this in it:
PHP Code:
<?php
ob_start("ob_gzhandler");
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
$akcija = $_GET['akcija'];
$napaka = (int)$_GET['napaka'];
$odstraniid = (int)$_GET['odstraniid'];
stdhead("Free Leech");
begin_main_frame();
if (get_user_class() < UC_MODERATOR)
{
stdmsg("Error", "No access.");
end_main_frame();
stdfoot();
exit;
}
echo "<h1 align=center>Free Leech</h1>\n";
if ($napaka == 1)
{
echo "<br /><font color=\"red\">Torrent with this ID doesn't exist!</font><br />";
}
if ($napaka == 2)
{
echo "<br /><font color=\"red\">This torrent is now free leech!</font><br />";
}
if ($napaka == 3)
{
echo "<br /><font color=\"red\">This torrent isn't free leech anymore!</font><br />";
}
if ($napaka == 4)
{
echo "<br /><font color=\"red\">This torren't isn't freeleech!</font><br />";
}
echo "<br /><form name=\"freeleech\" method=\"post\" action=\"freeleech.php?akcija=poslji\">
Torrent ID:
<input name=\"id\" type=\"text\" value=\"\" />
(You need to enter id of the torrent you want to make free leech)
<br /><br />
<input type=\"submit\" value=\"Send\"></form>";
if ($akcija == "poslji")
{
$id = (int)$_POST['id'];
$rezultat = mysql_query("SELECT * FROM torrents WHERE id = '$id'");
if (mysql_num_rows($rezultat) < 1)
{
header("Location: freeleech.php?napaka=1");
die();
}
else
{
mysql_query("UPDATE torrents SET freeleech = '1' WHERE id = '$id'");
}
header("Location: freeleech.php?napaka=2");
}
echo "<br /><div align=\"center\"><h1>Free leech torrents</h1><br />";
$rezultat = mysql_query("SELECT * FROM torrents WHERE freeleech = '1'");
if (mysql_num_rows($rezultat) > 0)
{
echo "<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" class=\"main\">
<tr>
<td class=rowhead><center>Id</center></td>
<td class=rowhead><center>Name</center></td>
<td class=rowhead><center>freeleech</center></td>
</tr>";
while ($vrstica = mysql_fetch_array($rezultat))
{
echo "
<tr>
<td><center>$vrstica[id]</center></td>
<td><center><a href=\"details.php?id=$vrstica[id]\" target=\"_blank\">".format_comment($vrstica[name])."</a></center></td>
<td><center><a href=\"freeleech.php?akcija=odstrani&odstraniid=$vrstica[id]\">Remove</a></center></td>
</tr>";
}
}
else
{
echo "No free leech torrents!";
}
echo "</table><br /><br />Copyrights © for free leech by Kami</div>";
if ($akcija == "odstrani")
{
$rezultat = mysql_query("SELECT * FROM torrents WHERE id = '$odstraniid' AND freeleech = '1'");
if (mysql_num_rows($rezultat) < 1)
{
header("Location: freeleech.php?napaka=4");
die();
}
else
{
mysql_query("UPDATE torrents SET freeleech = '0' WHERE id = '$odstraniid'");
}
header("Location: freeleech.php?napaka=3");
}
end_main_frame();
stdfoot();
die();
?>
4. Now we also need to edit details.php (this is required if you want to have text "This torrent is freeleech so only upload counts" in torrent description)
Find this
PHP Code:
if (!empty($row["descr"]))
tr("Description", str_replace(array("\n", " "), array("<br>\n", " "), format_urls(htmlspecialchars($row["descr"]))), 1);
And replace it with this:
PHP Code:
if (!empty($row["descr"]))
{
$rezultat = mysql_num_rows(mysql_query("SELECT * FROM torrents WHERE id = '$id' AND freeleech = '1'"));
if ($rezultat == 1)
{
$row["descr"] .= "\n[color=red]This torrent is freeleech so only upload counts![/color]";
}
tr("Description", str_replace(array("\n", " "), array("<br>\n", " "), format_comment(format_urls(htmlspecialchars($row["descr"])))), 1);
}
Image instead of [Freeleech] text:
If you want to use image instead of freeleech text, you should drop step 4.
Then, replace this (line 767):
PHP Code:
print("\"><b>$dispname</b></a>\n");
with this:
PHP Code:
$freeleech = mysql_result(mysql_query("SELECT freeleech FROM torrents WHERE id = '$id'"), 0);
if ($freeleech == 1)
{
$freeimage = "<img src=\"images/YOUR_IMAGE.gif\" />";
}
else
{
$freeimage = "";
}
print("\"><b>$dispname</b></a> $freeimage\n");
Old version (obsolete - make all torrents free addon won't work properly with this version)
1. We need to make another column in table "torrents":
PHP Code:
ALTER TABLE `torrents` ADD `freeleech` VARCHAR( 3 ) DEFAULT 'no' NOT NULL;
2. Now we need to edit announce.php
Find this
PHP Code:
if ($upthis > 0 || $downthis > 0)
mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
And replace it with this:
PHP Code:
if ($upthis > 0 || $downthis > 0)
{
$freelech = mysql_query("SELECT * FROM torrents WHERE id='$torrentid' AND freeleech='yes'");
if (mysql_num_rows($freelech) == 1)
{
mysql_query("UPDATE users SET uploaded = uploaded + $upthis WHERE id=$userid") or err("Tracker error 3");
}
else
{
mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
}
}
3. Now make file called freeleech.php in your root dir and put this in it:
PHP Code:
<?php
ob_start("ob_gzhandler");
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
$akcija = $_GET['akcija'];
$napaka = $_GET['napaka'];
$odstraniid = $_GET['odstraniid'];
stdhead("Free Leech");
begin_main_frame();
if (get_user_class() < UC_ADMINISTRATOR)
{
stdmsg("Napaka", "Nimate dostopa.)"); // You don't have access
stdfoot();
exit;
}
echo "<h1 align=center>Free Leech</h1>\n";
if ($napaka == 1)
{
echo "<br /><font color=\"red\">Torrent z tem ID-jem ne obstaja!</font><br />"; // Torrent with this ID doesn't exist
}
if ($napaka == 2)
{
echo "<br /><font color=\"red\">Torrent je uspešno postal free leech!</font><br />"; // This torrent is now free leech
}
if ($napaka == 3)
{
echo "<br /><font color=\"red\">Ta torrent več sedaj ni free leech!</font><br />"; // This torrent isn't free leech anymore
}
echo "<br /><form name=\"\" method=\"post\" action=\"freeleech.php?akcija=poslji\">
Id torrenta:
<input name=\"idtorrenta\" type=\"text\" value=\"\" />
(vnesite ID torrenta za kategera hocete nastavit da je free leech, ce ne vete ki najdete ID niste vredni svojega statusa!
<br /><br />
<input type=\"submit\" value=\"Poslji\"></form>"; // You need to enter id of the torrent you want to make free leech
if ($akcija == "poslji")
{
$idtorrenta = $_POST['idtorrenta'];
$rezultat = mysql_query("SELECT * from torrents WHERE id='$idtorrenta'");
$ime = mysql_query("SELECT name from torrents WHERE id='$idtorrenta' LIMIT 1");
if (mysql_num_rows($rezultat) < 1)
{
header("Location: freeleech.php?napaka=1");
die();
}
while ($vrstica = mysql_fetch_array($ime))
{
$ime1 = $vrstica[name] . " [[color="red"]freeleech[/color]]";
mysql_query("UPDATE torrents SET freeleech='yes', name='$ime1' WHERE id='$idtorrenta'");
}
header("Location: freeleech.php?napaka=2");
}
echo "<br /><div align=\"center\"><h1>Free leech torrenti</h1><br />";
$rezultat = mysql_query("SELECT * from torrents WHERE freeleech='yes'");
echo "<table width=\"500\" border=\"0\">
<tr>
<td class=rowhead><center>Id</center></td>
<td class=rowhead><center>Ime</center></td>
<td class=rowhead><center>freeleech</center></td>
</tr>"; // Ime = Name
while ($vrstica = mysql_fetch_array($rezultat))
{
echo "
<tr>
<td><center>$vrstica[id]</center></td>
<td><center><a href=\"http://www.slo-scene.net/details.php?id=$vrstica[id]\" target=\"_blank\">".format_comment($vrstica[name])."</a></center></td>
<td><center><a href=\"freeleech.php?akcija=odstrani&odstraniid=$vrstica[id]\">Odstrani</a></center></td>
</tr>"; // Odstrani = Remove
}
echo "</table><br /><br />Copyrights © for free leech by Kami</div>";
if ($akcija == "odstrani")
{
$rezultat = mysql_query("SELECT * from torrents WHERE id='$odstraniid'");
mysql_query("UPDATE torrents SET freeleech='no' WHERE id='$odstraniid'");
while ($vrstica = mysql_fetch_array($rezultat))
{
$ime = str_replace(" [[color="red"]freeleech[/color]]", " ", $vrstica[name]);
mysql_query("UPDATE torrents SET name='$ime' WHERE id='$odstraniid'");
}
header("Location: freeleech.php?napaka=3");
}
stdfoot();
die();
?>
4. Now we need to edit bittorrent.php (this is required if we want to have [FreeLech] after the torrent name in red color)
Find this:
PHP Code:
$dispname = htmlspecialchars($row["name"]);
And replace it with this:
PHP Code:
$dispname = format_comment(htmlspecialchars($row["name"]));
(torrent name is now formated same as comments - color tags etc.)
5. Now we also need to edit userdetails.php (this is required if we want to have [FreeLech] after the torrent name in red color)
Find this:
PHP Code:
while ($a = mysql_fetch_assoc($r))
{
$r2 = mysql_query("SELECT name, image FROM categories WHERE id=$a[category]") or sqlerr(__FILE__, __LINE__);
$a2 = mysql_fetch_assoc($r2);
$cat = "<img src=\"/pic/$a2[image]\" alt=\"$a2[name]\">";
$torrents .= "<tr><td style='padding: 0px'>$cat</td><td><a href=details.php?id=" . $a["id"] . "&hit=1><b>" . htmlspecialchars($a["name"]) . "</b></a></td>" .
"<td align=right>$a[seeders]</td><td align=right>$a[leechers]</td></tr>\n";
}
and replace it with this:
PHP Code:
while ($a = mysql_fetch_assoc($r))
{
$r2 = mysql_query("SELECT name, image FROM categories WHERE id=$a[category]") or sqlerr(__FILE__, __LINE__);
$a2 = mysql_fetch_assoc($r2);
$cat = "<img src=\"/pic/$a2[image]\" alt=\"$a2[name]\">";
$torrents .= "<tr><td style='padding: 0px'>$cat</td><td><a href=details.php?id=" . $a["id"] . "&hit=1><b>" .
format_comment(htmlspecialchars($a["name"])) . "</b></a></td>" .
"<td align=right>$a[seeders]</td><td align=right>$a[leechers]</td></tr>\n";
}
Find this:
PHP Code:
$ret .= "<tr><td style='padding: 0px'><img src=\"pic/$catimage\" alt=\"$catname\" width=42 height=42></td>\n" .
"<td><a href=details.php?id=$arr[torrent]&hit=1><b>" . htmlspecialchars($arr["torrentname"]) .
"</b></a></td><td align=center>$ttl</td><td align=center>$size</td><td align=right>$seeders</td><td align=right>$leechers</td><td align=center>$uploaded</td>\n" .
"<td align=center>$downloaded</td><td align=center>$ratio</td></tr>\n";
and replace it with this:
PHP Code:
$ret .= "<tr><td style='padding: 0px'><img src=\"pic/$catimage\" alt=\"$catname\" width=42 height=42></td>\n" .
"<td><a href=details.php?id=$arr[torrent]&hit=1><b>" . format_comment(htmlspecialchars($arr["torrentname"])) .
"</b></a></td><td align=center>$ttl</td><td align=center>$size</td><td align=right>$seeders</td><td align=right>$leechers</td><td align=center>$uploaded</td>\n" .
"<td align=center>$downloaded</td><td align=center>$ratio</td></tr>\n";
With this script you can make torrent free leech.
Free leech means, that only upload count at specified torrent.
Bump: freeleech
credit to kami.
sql
PHP Code:
1 ALTER TABLE `torrents` ADD `freeleech` ENUM('0', '1') DEFAULT '0' NOT NULL;
2 Now we need to edit announce.php
Find this :
PHP Code:
if ($upthis > 0 || $downthis > 0)
mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
And replace it with this:
i
PHP Code:
f ($upthis > 0 || $downthis > 0)
{
$freelech = mysql_query("SELECT * FROM torrents WHERE id = '$torrentid' AND freeleech = '1'");
if (mysql_num_rows($freelech) == 1)
{
mysql_query("UPDATE users SET uploaded = uploaded + $upthis WHERE id=$userid") or err("Tracker error 3");
}
else
{
mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
}
}
3. Now make file called freeleech.php in your root dir and put this in it:
PHP Code:
<?php
ob_start("ob_gzhandler");
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
$akcija = $_GET['akcija'];
$napaka = (int)$_GET['napaka'];
$odstraniid = (int)$_GET['odstraniid'];
stdhead("Free Leech");
begin_main_frame();
if (get_user_class() < UC_MODERATOR)
{
stdmsg("Error", "No access.");
end_main_frame();
stdfoot();
exit;
}
echo "<h1 align=center>Free Leech</h1>\n";
if ($napaka == 1)
{
echo "<br /><font color=\"red\">Torrent with this ID doesn't exist!</font><br />";
}
if ($napaka == 2)
{
echo "<br /><font color=\"red\">This torrent is now free leech!</font><br />";
}
if ($napaka == 3)
{
echo "<br /><font color=\"red\">This torrent isn't free leech anymore!</font><br />";
}
if ($napaka == 4)
{
echo "<br /><font color=\"red\">This torren't isn't freeleech!</font><br />";
}
echo "<br /><form name=\"freeleech\" method=\"post\" action=\"freeleech.php?akcija=poslji\">
Torrent ID:
<input name=\"id\" type=\"text\" value=\"\" />
(You need to enter id of the torrent you want to make free leech)
<br /><br />
<input type=\"submit\" value=\"Send\"></form>";
if ($akcija == "poslji")
{
$id = (int)$_POST['id'];
$rezultat = mysql_query("SELECT * FROM torrents WHERE id = '$id'");
if (mysql_num_rows($rezultat) < 1)
{
header("Location: freeleech.php?napaka=1");
die();
}
else
{
mysql_query("UPDATE torrents SET freeleech = '1' WHERE id = '$id'");
}
header("Location: freeleech.php?napaka=2");
}
echo "<br /><div align=\"center\"><h1>Free leech torrents</h1><br />";
$rezultat = mysql_query("SELECT * FROM torrents WHERE freeleech = '1'");
if (mysql_num_rows($rezultat) > 0)
{
echo "<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\" class=\"main\">
<tr>
<td class=rowhead><center>Id</center></td>
<td class=rowhead><center>Name</center></td>
<td class=rowhead><center>freeleech</center></td>
</tr>";
while ($vrstica = mysql_fetch_array($rezultat))
{
echo "
<tr>
<td><center>$vrstica[id]</center></td>
<td><center><a href=\"details.php?id=$vrstica[id]\" target=\"_blank\">".format_comment($vrstica[name])."</a></center></td>
<td><center><a href=\"freeleech.php?akcija=odstrani&odstraniid=$vrstica[id]\">Remove</a></center></td>
</tr>";
}
}
else
{
echo "No free leech torrents!";
}
echo "</table><br /><br />Copyrights © for free leech by Kami</div>";
if ($akcija == "odstrani")
{
$rezultat = mysql_query("SELECT * FROM torrents WHERE id = '$odstraniid' AND freeleech = '1'");
if (mysql_num_rows($rezultat) < 1)
{
header("Location: freeleech.php?napaka=4");
die();
}
else
{
mysql_query("UPDATE torrents SET freeleech = '0' WHERE id = '$odstraniid'");
}
header("Location: freeleech.php?napaka=3");
}
end_main_frame();
stdfoot();
die();
?>
4. Now we also need to edit details.php (this is required if you want to have text "This torrent is freeleech so only upload counts" in torrent description)
Find this
PHP Code:
if (!empty($row["descr"]))
tr("Description", str_replace(array("\n", " "), array("<br>\n", " "), format_urls(htmlspecialchars($row["descr"]))), 1);
And replace it with this:
PHP Code:
if (!empty($row["descr"]))
{
$rezultat = mysql_num_rows(mysql_query("SELECT * FROM torrents WHERE id = '$id' AND freeleech = '1'"));
if ($rezultat == 1)
{
$row["descr"] .= "\n[color=red]This torrent is freeleech so only upload counts![/color]";
}
tr("Description", str_replace(array("\n", " "), array("<br>\n", " "), format_comment(format_urls(htmlspecialchars($row["descr"])))), 1);
}
Image instead of [Freeleech] text:
If you want to use image instead of freeleech text, you should drop step 4.
Then, replace this (line 767):
PHP Code:
print("\"><b>$dispname</b></a>\n");
with this:
PHP Code:
$freeleech = mysql_result(mysql_query("SELECT freeleech FROM torrents WHERE id = '$id'"), 0);
if ($freeleech == 1)
{
$freeimage = "<img src=\"images/YOUR_IMAGE.gif\" />";
}
else
{
$freeimage = "";
}
print("\"><b>$dispname</b></a> $freeimage\n");
Old version (obsolete - make all torrents free addon won't work properly with this version)
1. We need to make another column in table "torrents":
PHP Code:
ALTER TABLE `torrents` ADD `freeleech` VARCHAR( 3 ) DEFAULT 'no' NOT NULL;
2. Now we need to edit announce.php
Find this
PHP Code:
if ($upthis > 0 || $downthis > 0)
mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
And replace it with this:
PHP Code:
if ($upthis > 0 || $downthis > 0)
{
$freelech = mysql_query("SELECT * FROM torrents WHERE id='$torrentid' AND freeleech='yes'");
if (mysql_num_rows($freelech) == 1)
{
mysql_query("UPDATE users SET uploaded = uploaded + $upthis WHERE id=$userid") or err("Tracker error 3");
}
else
{
mysql_query("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error 3");
}
}
3. Now make file called freeleech.php in your root dir and put this in it:
PHP Code:
<?php
ob_start("ob_gzhandler");
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
$akcija = $_GET['akcija'];
$napaka = $_GET['napaka'];
$odstraniid = $_GET['odstraniid'];
stdhead("Free Leech");
begin_main_frame();
if (get_user_class() < UC_ADMINISTRATOR)
{
stdmsg("Napaka", "Nimate dostopa.)"); // You don't have access
stdfoot();
exit;
}
echo "<h1 align=center>Free Leech</h1>\n";
if ($napaka == 1)
{
echo "<br /><font color=\"red\">Torrent z tem ID-jem ne obstaja!</font><br />"; // Torrent with this ID doesn't exist
}
if ($napaka == 2)
{
echo "<br /><font color=\"red\">Torrent je uspešno postal free leech!</font><br />"; // This torrent is now free leech
}
if ($napaka == 3)
{
echo "<br /><font color=\"red\">Ta torrent več sedaj ni free leech!</font><br />"; // This torrent isn't free leech anymore
}
echo "<br /><form name=\"\" method=\"post\" action=\"freeleech.php?akcija=poslji\">
Id torrenta:
<input name=\"idtorrenta\" type=\"text\" value=\"\" />
(vnesite ID torrenta za kategera hocete nastavit da je free leech, ce ne vete ki najdete ID niste vredni svojega statusa!
<br /><br />
<input type=\"submit\" value=\"Poslji\"></form>"; // You need to enter id of the torrent you want to make free leech
if ($akcija == "poslji")
{
$idtorrenta = $_POST['idtorrenta'];
$rezultat = mysql_query("SELECT * from torrents WHERE id='$idtorrenta'");
$ime = mysql_query("SELECT name from torrents WHERE id='$idtorrenta' LIMIT 1");
if (mysql_num_rows($rezultat) < 1)
{
header("Location: freeleech.php?napaka=1");
die();
}
while ($vrstica = mysql_fetch_array($ime))
{
$ime1 = $vrstica[name] . " [[color="red"]freeleech[/color]]";
mysql_query("UPDATE torrents SET freeleech='yes', name='$ime1' WHERE id='$idtorrenta'");
}
header("Location: freeleech.php?napaka=2");
}
echo "<br /><div align=\"center\"><h1>Free leech torrenti</h1><br />";
$rezultat = mysql_query("SELECT * from torrents WHERE freeleech='yes'");
echo "<table width=\"500\" border=\"0\">
<tr>
<td class=rowhead><center>Id</center></td>
<td class=rowhead><center>Ime</center></td>
<td class=rowhead><center>freeleech</center></td>
</tr>"; // Ime = Name
while ($vrstica = mysql_fetch_array($rezultat))
{
echo "
<tr>
<td><center>$vrstica[id]</center></td>
<td><center><a href=\"http://www.slo-scene.net/details.php?id=$vrstica[id]\" target=\"_blank\">".format_comment($vrstica[name])."</a></center></td>
<td><center><a href=\"freeleech.php?akcija=odstrani&odstraniid=$vrstica[id]\">Odstrani</a></center></td>
</tr>"; // Odstrani = Remove
}
echo "</table><br /><br />Copyrights © for free leech by Kami</div>";
if ($akcija == "odstrani")
{
$rezultat = mysql_query("SELECT * from torrents WHERE id='$odstraniid'");
mysql_query("UPDATE torrents SET freeleech='no' WHERE id='$odstraniid'");
while ($vrstica = mysql_fetch_array($rezultat))
{
$ime = str_replace(" [[color="red"]freeleech[/color]]", " ", $vrstica[name]);
mysql_query("UPDATE torrents SET name='$ime' WHERE id='$odstraniid'");
}
header("Location: freeleech.php?napaka=3");
}
stdfoot();
die();
?>
4. Now we need to edit bittorrent.php (this is required if we want to have [FreeLech] after the torrent name in red color)
Find this:
PHP Code:
$dispname = htmlspecialchars($row["name"]);
And replace it with this:
PHP Code:
$dispname = format_comment(htmlspecialchars($row["name"]));
(torrent name is now formated same as comments - color tags etc.)
5. Now we also need to edit userdetails.php (this is required if we want to have [FreeLech] after the torrent name in red color)
Find this:
PHP Code:
while ($a = mysql_fetch_assoc($r))
{
$r2 = mysql_query("SELECT name, image FROM categories WHERE id=$a[category]") or sqlerr(__FILE__, __LINE__);
$a2 = mysql_fetch_assoc($r2);
$cat = "<img src=\"/pic/$a2[image]\" alt=\"$a2[name]\">";
$torrents .= "<tr><td style='padding: 0px'>$cat</td><td><a href=details.php?id=" . $a["id"] . "&hit=1><b>" . htmlspecialchars($a["name"]) . "</b></a></td>" .
"<td align=right>$a[seeders]</td><td align=right>$a[leechers]</td></tr>\n";
}
and replace it with this:
PHP Code:
while ($a = mysql_fetch_assoc($r))
{
$r2 = mysql_query("SELECT name, image FROM categories WHERE id=$a[category]") or sqlerr(__FILE__, __LINE__);
$a2 = mysql_fetch_assoc($r2);
$cat = "<img src=\"/pic/$a2[image]\" alt=\"$a2[name]\">";
$torrents .= "<tr><td style='padding: 0px'>$cat</td><td><a href=details.php?id=" . $a["id"] . "&hit=1><b>" .
format_comment(htmlspecialchars($a["name"])) . "</b></a></td>" .
"<td align=right>$a[seeders]</td><td align=right>$a[leechers]</td></tr>\n";
}
Find this:
PHP Code:
$ret .= "<tr><td style='padding: 0px'><img src=\"pic/$catimage\" alt=\"$catname\" width=42 height=42></td>\n" .
"<td><a href=details.php?id=$arr[torrent]&hit=1><b>" . htmlspecialchars($arr["torrentname"]) .
"</b></a></td><td align=center>$ttl</td><td align=center>$size</td><td align=right>$seeders</td><td align=right>$leechers</td><td align=center>$uploaded</td>\n" .
"<td align=center>$downloaded</td><td align=center>$ratio</td></tr>\n";
and replace it with this:
PHP Code:
$ret .= "<tr><td style='padding: 0px'><img src=\"pic/$catimage\" alt=\"$catname\" width=42 height=42></td>\n" .
"<td><a href=details.php?id=$arr[torrent]&hit=1><b>" . format_comment(htmlspecialchars($arr["torrentname"])) .
"</b></a></td><td align=center>$ttl</td><td align=center>$size</td><td align=right>$seeders</td><td align=right>$leechers</td><td align=center>$uploaded</td>\n" .
"<td align=center>$downloaded</td><td align=center>$ratio</td></tr>\n";
With this script you can make torrent free leech.
Free leech means, that only upload count at specified torrent.