Hi everyone. Once again I thank everyone for everything you did for me <_<
I have a module in my tracker, witch is in test mode for 2 months. Then I saw so much spam in the download area.
My module is:
And it was tested in torrent tard 2.06
rename the download.php file to download1.php
in the download1.php find
add save
create a new file with the name download-php and paste
// TorrentTrader v2.x
// This file was last updated: 29/Aug/2007
//
// http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn();
loggedinonly();
//check permissions
if ($site_config["MEMBERSONLY"]){
loggedinonly();
if($CURUSER["can_download"]=="no")
show_error_msg("Error","You do not have permission to download torrents",1);
}
$id = (int)$_GET["id"];
if (!$id)
show_error_msg("ID not found", "You can't download, if you don't tell me what you want!",1);
$res = mysql_query("SELECT filename, banned, external, announce FROM torrents WHERE id =".intval($id));
$row = mysql_fetch_array($res);
$trackerurl = $row['announce'];
$torrent_dir = $site_config["torrent_dir"];
$fn = "$torrent_dir/$id.torrent";
if (!$row)
show_error_msg("File not found", "No file has been found with that ID!",1);
if ($row["banned"] == "yes")
show_error_msg("Error", "Torrent is banned.", 1);
if (!is_file($fn))
show_error_msg("File not found", "The ID has been found on the Database, but the torrent has gone!<BR><BR>Check Server Paths and CHMODs Are Correct!",1);
if (!is_readable($fn))
show_error_msg("File not found", "The ID and torrent were found, but the torrent is NOT readable!",1);
$names = $row['filename'];
stdhead("Downloads");
begin_frame("<CENTER><B>Download do \"".$names."\"</B></CENTER>");
if ($CURUSER["downloaded"] > 0) {
$ratioranck = number_format($CURUSER["uploaded"] / $CURUSER["downloaded"], 2);
}else{
$ratioranck = "0";
}
?>
<script language="javascript">
var temporestante;
var countdown;
function checkAll()
{
if(download.everything.checked)
{
var div_ref = document.all("id_div");
div_ref.style.visibility = "visible";
temporestante = '<?php echo count_ratio_down($ratioranck) ?>';
countDown();
} else {
var div_ref = document.all("id_div");
div_ref.style.visibility = "hidden";
stopDown();
}
}
function countDown(){
temporestante = temporestante - 1;
// Calculate time remaining
var remaining_sec = (temporestante % 60);
var remaining_min = (((temporestante - remaining_sec) % 3600) / 60);
var remaining_hours = ((((temporestante - remaining_sec) - (remaining_min * 60)) % 86400) / 3600);
if(remaining_sec < 10){ remaining_sec = '0' + remaining_sec; }
if(remaining_min < 10){ remaining_min = '0' + remaining_min; }
if(remaining_hours < 10){ remaining_hours = '0' + remaining_hours; }
if (temporestante > 0) {
document.getElementById("dl").innerHTML='You have to wait <b><font color="RED">'+ remaining_min+' minuto e '+ remaining_sec+'</font></b> seconds to Download because of your Ratio.</a>';
countdown = setTimeout("countDown()", 1000);
}
else
document.getElementById("dl").innerHTML='Download OK<BR><input type=submit name=action value=Download class=btn>';
}
function stopDown(){
clearTimeout(countdown);
}
</script>
<?
echo "<P align=\"center\">";
echo "<form name=download method=post action=download1.php?id=$id&name=" . rawurlencode($row["filename"]) . "><b>Li, e compreendo os termos de Utiliza
I have a module in my tracker, witch is in test mode for 2 months. Then I saw so much spam in the download area.
My module is:
And it was tested in torrent tard 2.06
rename the download.php file to download1.php
in the download1.php find
if($CURUSER["can_download"]=="no")
show_error_msg("Error","You do not have permission to download torrents",1);
}then addif ($_POST['action'] != "Download")
show_error_msg("Attention", "You cannot use this Direct Download, Thanks!",1);
add save
add this in the functions.php file
function count_ratio_down($ratioranck) {
if ($ratio < 0.1) return "120";
if ($ratio < 0.5) return "75";
if ($ratio < 0.9) return "53";
return "0";
}add save
create a new file with the name download-php and paste
<?//// TorrentTrader v2.x
// This file was last updated: 29/Aug/2007
//
// http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn();
loggedinonly();
//check permissions
if ($site_config["MEMBERSONLY"]){
loggedinonly();
if($CURUSER["can_download"]=="no")
show_error_msg("Error","You do not have permission to download torrents",1);
}
$id = (int)$_GET["id"];
if (!$id)
show_error_msg("ID not found", "You can't download, if you don't tell me what you want!",1);
$res = mysql_query("SELECT filename, banned, external, announce FROM torrents WHERE id =".intval($id));
$row = mysql_fetch_array($res);
$trackerurl = $row['announce'];
$torrent_dir = $site_config["torrent_dir"];
$fn = "$torrent_dir/$id.torrent";
if (!$row)
show_error_msg("File not found", "No file has been found with that ID!",1);
if ($row["banned"] == "yes")
show_error_msg("Error", "Torrent is banned.", 1);
if (!is_file($fn))
show_error_msg("File not found", "The ID has been found on the Database, but the torrent has gone!<BR><BR>Check Server Paths and CHMODs Are Correct!",1);
if (!is_readable($fn))
show_error_msg("File not found", "The ID and torrent were found, but the torrent is NOT readable!",1);
$names = $row['filename'];
stdhead("Downloads");
begin_frame("<CENTER><B>Download do \"".$names."\"</B></CENTER>");
if ($CURUSER["downloaded"] > 0) {
$ratioranck = number_format($CURUSER["uploaded"] / $CURUSER["downloaded"], 2);
}else{
$ratioranck = "0";
}
?>
<script language="javascript">
var temporestante;
var countdown;
function checkAll()
{
if(download.everything.checked)
{
var div_ref = document.all("id_div");
div_ref.style.visibility = "visible";
temporestante = '<?php echo count_ratio_down($ratioranck) ?>';
countDown();
} else {
var div_ref = document.all("id_div");
div_ref.style.visibility = "hidden";
stopDown();
}
}
function countDown(){
temporestante = temporestante - 1;
// Calculate time remaining
var remaining_sec = (temporestante % 60);
var remaining_min = (((temporestante - remaining_sec) % 3600) / 60);
var remaining_hours = ((((temporestante - remaining_sec) - (remaining_min * 60)) % 86400) / 3600);
if(remaining_sec < 10){ remaining_sec = '0' + remaining_sec; }
if(remaining_min < 10){ remaining_min = '0' + remaining_min; }
if(remaining_hours < 10){ remaining_hours = '0' + remaining_hours; }
if (temporestante > 0) {
document.getElementById("dl").innerHTML='You have to wait <b><font color="RED">'+ remaining_min+' minuto e '+ remaining_sec+'</font></b> seconds to Download because of your Ratio.</a>';
countdown = setTimeout("countDown()", 1000);
}
else
document.getElementById("dl").innerHTML='Download OK<BR><input type=submit name=action value=Download class=btn>';
}
function stopDown(){
clearTimeout(countdown);
}
</script>
<?
echo "<P align=\"center\">";
echo "<form name=download method=post action=download1.php?id=$id&name=" . rawurlencode($row["filename"]) . "><b>Li, e compreendo os termos de Utiliza