<?php
require_once("backend/functions.php");
dbconn();
if ($site_config["MEMBERSONLY"])
{
loggedinonly();
if ($CURUSER["view_torrents"] == "no")
show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);
}
$id = (int) $_GET["id"];
$res = SQL_Query_exec("SELECT name, external, banned FROM torrents WHERE id = $id");
$row = mysql_fetch_assoc($res);
if ((!$row) || ($row["banned"] == "yes" && $CURUSER["edit_torrents"] == "no"))
show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);
if ($row["external"] == "yes")
show_error_msg(T_("ERROR"), T_("THIS_TORRENT_IS_EXTERNALLY_TRACKED"), 1);
$res = SQL_Query_exec("SELECT users.id, users.username, users.uploaded, users.downloaded, users.privacy, completed.date FROM users LEFT JOIN completed ON users.id = completed.userid WHERE users.enabled = 'yes' AND completed.torrentid = '$id'");
if (mysql_num_rows($res) == 0)
show_error_msg(T_("ERROR"), T_("NO_DOWNLOADS_YET"), 1);
$title = sprintf(T_("COMPLETED_DOWNLOADS"), CutName($row["name"], 70));
stdhead($title);
begin_frame($title);
?>
<br />
<table cellpadding="5" cellspacing="0" align="center" class="table_table" width="99%">
<tr>
<td class="table_head"> <b><?php echo T_("USERNAME"); ?></b> | <b><?php echo T_("RATIO"); ?></b> </td>
<td class="table_head" align="center"> <b><?php echo T_("STARTED"); ?></b> </td>
<td class="table_head" align="center"> <b><?php echo T_("COMPLETED"); ?></b> </td>
<td class="table_head" align="center"> <b><?php echo T_("LAST_ACTION"); ?></b> </td>
<td class="table_head" align="center"> <b><?php echo T_("UPLOADED"); ?></b> </td>
<td class="table_head" align="center"> <b><?php echo T_("DOWNLOADED"); ?></b> </td>
<td class="table_head" align="center"> <b><?php echo T_("RATIO"); ?></b> </td>
<td class="table_head" align="center"> <b><?php echo T_("SEED_TIME"); ?></b> </td>
<td class="table_head" align="center"> <b><?php echo T_("SEEDING"); ?></b> </td>
<td class="table_head" align="center"> <font color="#FF1200"><b>H</b><small>&</small><b>R</b></font> </td>
</tr>
<?php
while ($row = mysql_fetch_assoc($res))
{
if (($row["privacy"] == "strong") && ($CURUSER["edit_users"] == "no"))
continue;
if ($row['downloaded'] > 0)
{
$ratio = $row['uploaded'] / $row['downloaded'];
$ratio = number_format($ratio, 2);
$color = get_ratio_color($ratio);
if ($color)
$ratio = "<font color=$color>$ratio</font>";
} else if ($row['uploaded'] > 0)
$ratio = 'Inf.';
else
$ratio = '---';
$comdate = date("d.M.Y<\\b\\r><\\s\\m\\a\\l\\l>H:i</\\s\\m\\a\\l\\l>", utc_to_tz_time($row["date"]));
$peers = (get_row_count("peers", "WHERE torrent = '$id' AND userid = '$row[id]'")) ? "<font color='#27B500'><b>".T_("YES")."</b></font>" : "<font color='#FF1200'><b>".T_("NO")."</b></font>";
$res2 = SQL_Query_exec("SELECT uload, dload, stime, utime, ltime, hnr FROM snatched WHERE tid = '$id' AND uid = '$row[id]'");
$row2 = mysql_fetch_assoc($res2);
if ($row2['dload'] > 0)
{
$tratio = $row2['uload'] / $row2['dload'];
$tratio = number_format($tratio, 2);
$color = get_ratio_color($tratio);
if ($color)
$tratio = "<font color=$color>$tratio</font>";
} else if ($row2['uload'] > 0)
$tratio = 'Inf.';
else
$tratio = '---';
$startdate = utc_to_tz(get_date_time($row2['stime']));
$lastaction = utc_to_tz(get_date_time($row2['utime']));
$upload = "<font color='#27B500'><b>".mksize($row2["uload"])."</b></font>";
$download = "<font color='#FF1200'><b>".mksize($row2["dload"])."</b></font>";
$seedtime = $row2['ltime'] ? mkprettytime($row2['ltime']) : '---';
if ($row2['hnr'] != "yes") { $hnr = "<font color='#27B500'><b>".T_("NO")."</b></font>"; } else { $hnr = "<font color='#FF1200'><b>".T_("YES")."</b></font>"; }
?>
<tr>
<td class="table_col1"><a href="account-details.php?id=<?php echo $row["id"]; ?>"><b><?php echo $row["username"]; ?></b></a> | <b><?php echo $ratio; ?></b></td>
<td class="table_col2" align="center"><?php echo date('d.M.Y<\\b\\r>H:i', sql_timestamp_to_unix_timestamp($startdate));?></td>
<td class="table_col1" align="center"><?php echo $comdate; ?></td>
<td class="table_col2" align="center"><?php echo date('d.M.Y<\\b\\r>H:i', sql_timestamp_to_unix_timestamp($lastaction));?></td>
<td class="table_col1" align="center"><?php echo $upload; ?></td>
<td class="table_col2" align="center"><?php echo $download; ?></td>
<td class="table_col1" align="center"><b><?php echo $tratio; ?></b></td>
<td class="table_col2" align="center"><?php echo $seedtime; ?></td>
<td class="table_col1" align="center"><?php echo $peers; ?></td>
<td class="table_col2" align="center"><b><?php echo $hnr; ?></b></td>
</tr>
<?php
}
?>
</table>
<div style="margin-top:10px; margin-bottom:10px" align="center">
<a href="torrents-details.php?id=<?php echo $id; ?>"><?php echo "<input type='submit' value='".T_("BACK_TO_DETAILS")."'>"; ?></a>
</div>
<?php
end_frame();
stdfoot();
?>
//===| Anti-Flood
if ( strlen($msg) > $site_config['floodsize'] )
show_error_msg("Error", "Your message is too big, only $site_config['floodsize'] characters are allowed.", 1);
$res = SQL_Query_exec("SELECT COUNT(*) FROM `messages` WHERE sender = $CURUSER[id] AND added > '" . get_date_time(gmtime() - ($site_config['floodtime'] * 60)) . "'");
$row = mysql_fetch_row($res);
if ($row[0] > $site_config['floodlimit'])
show_error_msg("Error", "You are only prohibited $site_config[floodlimit] messages in $site_config[floodtime] minutes.", 1);
//===| End SQL_Query_exec("DELETE FROM reports WHERE votedfor = $id AND type = 'torrent'");SQL_Query_exec("DELETE FROM `snatched` WHERE `tid` = '$id'");SQL_Query_exec("DELETE FROM pollanswers WHERE userid = $userid");SQL_Query_exec("DELETE FROM `snatched` WHERE `uid` = '$userid'");function seedtime($ts = 0)
{
$days = floor($ts / 86400);
$hours = floor($ts / 3600 ) % 24;
$mins = floor($ts / 60) % 60;
$secs = $ts % 60;
return sprintf( '%d days, %d hours, %d minutes, %d seconds...', $days, $hours, $mins, $secs);
}$ret = SQL_Query_exec("INSERT INTO peers (connectable, torrent, peer_id, ip, passkey, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, client) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", " . sqlesc($passkey) . ", $port, $uploaded, $downloaded, $left, '".get_date_time()."', '".get_date_time()."', '$seeder', '$userid', " . sqlesc($agent) . ")");if ( ($MEMBERSONLY) && (($seeder == 'no' && $torrent['freeleech'] == 0)) ) {
SQL_Query_exec("INSERT INTO `snatched` (`uid`, `tid`, `stime`, `utime`) VALUES ('$userid', '$torrentid', '".gmtime()."', '".gmtime()."') ON DUPLICATE KEY UPDATE `utime` = '" . gmtime() . "'");
}if ( $MEMBERSONLY )
SQL_Query_exec("INSERT INTO completed (userid, torrentid, date) VALUES ($userid, $torrentid, '".get_date_time()."')");if ( $MEMBERSONLY )
{
SQL_Query_exec("INSERT INTO completed (userid, torrentid, date) VALUES ($userid, $torrentid, '".get_date_time()."')");
SQL_Query_exec("UPDATE LOW_PRIORITY `snatched` SET `completed` = '1' WHERE `tid` = '$torrentid' AND `uid` = '$userid' AND `utime` = '" . gmtime() . "'");
}$upthis = max(0, $uploaded - $self["uploaded"]);$elapsed = ($self['seeder'] == 'yes') ? $site_config['announce_interval'] - floor(($self['ez'] - time()) / 60) : 0;if (($upthis > 0 || $downthis > 0) && is_valid_id($userid))if (($upthis > 0 || $downthis > 0 || $elapsed > 0) && is_valid_id($userid))SQL_Query_exec("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error: Unable to update stats");SQL_Query_exec("UPDATE LOW_PRIORITY `snatched` SET `uload` = `uload` + '$upthis', `dload` = `dload` + '$downthis', `utime` = '".gmtime()."', `ltime` = `ltime` + '$elapsed' WHERE `tid` = '$torrentid' AND `uid` = '$userid'");<?php print("<a href='mailbox.php'><b>".T_("YOUR_MESSAGES")."</b></a>");?> |
<?php print("<a href='snatched.php'><b>".T_("YOUR_SNATCHLIST")."</b></a>");?><?php echo T_("AGE"); ?>: <?php echo htmlspecialchars($user["age"])?><br /><?php if ($CURUSER["edit_users"]=="yes" && $CURUSER["class"] > $user["class"]) { ?>
<div style="margin-bottom:3px"><a href="snatched.php?uid=<?php echo $user["id"]?>"><?php echo "<input type='submit' value='".T_("SNATCHLIST")."'>"; ?></a></div>
<?php } ?>echo "[<a href='torrents-edit.php?id=$row[id]&returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'><b>".T_("EDIT_TORRENT")."</b></a>]";echo " <a href=snatched.php?tid=$row[id]><input type='submit' value='".T_("SNATCHLIST")."'></a> ";//===| Snatchlist
$LANG["SNATCHLIST"] = "Snatchlist";
$LANG["YOUR_SNATCHLIST"] = "Your Snatchlist";
$LANG["SNATCHLIST_FOR"] = "Snatchlist For:";
$LANG["LAST_ACTION"] = "Last Action";
$LANG["SEED_TIME"] = "Seed Time";
$LANG["GO_TO_YOUR_PROFILE"] = "Go to Your Profile";
$LANG["GO_TO_USER_ACCOUNT"] = "Go to User Account";
$LANG["HNR"] = "<font color=#FF1200><b>H</b><small>&</small><b>R</b></font>";
$LANG["SNATCHED_MESSAGE"] = "This page displays the details to all downloaded torrents, completed or not.";
$LANG["NO_USER_WITH_ID"] = "There is no user with ID: ";
$LANG["NO_TORRENT_WITH_ID"] = "There is no torrent with ID: ";
$LANG["REGISTERED_MEMBERS_TO_TORRENT"] = "Registered Members To Torrent:";
$LANG["NO_PERMISSION"] = "You don't have permission for this action!";
$LANG["T_L_OR_E"] = "Local or External";
$LANG["LOCAL_TORRENT"] = "Local Torrent";
$LANG["EXTERNAL_TORRENT"] = "External Torrent";
$LANG["FREE"] = "Free";
$LANG["USER_NOT_FOUND"] = "Not found any member with this name into database!";
ALTER TABLE `users` ADD `averted1` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `users` ADD `averted2` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `users` ADD `averted3` enum('yes','no') NOT NULL default 'no'; //===| Start Disable Inactive Accounts |===//
//===| Config
$dw1 = 69; //===| Days until the first warning: three weeks to finish
$dw2 = 76; //===| Days until the second warning: two weeks to finish
$dw3 = 83; //===| Days until the third warning: one week to finish
$dtd = 90; //===| Days until the inactive accounts are disabled
$warning1 = sqlesc(get_date_time(gmtime() - ($dw1 * 86400)));
$warning2 = sqlesc(get_date_time(gmtime() - ($dw2 * 86400)));
$warning3 = sqlesc(get_date_time(gmtime() - ($dw3 * 86400)));
$disabled = sqlesc(get_date_time(gmtime() - ($dtd * 86400)));
//===| Reset emails averted if the user has been logged
$res0 = SQL_Query_exec("SELECT id, averted1, averted2, averted3 FROM users WHERE enabled = 'yes' AND averted1 = 'yes' || averted2 = 'yes' || averted3 = 'yes' AND last_access > $warning1");
while ($arr0 = mysql_fetch_assoc($res0))
{
SQL_Query_exec("UPDATE users SET averted1 = 'no', averted2 = 'no', averted3 = 'no' WHERE id = $arr0[id]");
}
//===| First warning
$res1 = SQL_Query_exec("SELECT id, username, email, averted1 FROM users WHERE enabled = 'yes' AND averted1 = 'no' AND last_access > $warning2 AND last_access < $warning1");
while ($arr1 = mysql_fetch_assoc($res1))
{
// Send first email
$subject = "Warning for inactivity";
$body = "You have received this email for the following reason:n------------------------------nYour account '".$arr1["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
sendmail($arr1["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
SQL_Query_exec("UPDATE users SET averted1 = 'yes' WHERE id = $arr1[id]");
}
//===| Second warning
$res2 = SQL_Query_exec("SELECT id, username, email, averted2 FROM users WHERE enabled = 'yes' AND averted2 = 'no' AND last_access > $warning3 AND last_access < $warning2");
while ($arr2 = mysql_fetch_assoc($res2))
{
// Send second email
$subject = "Warning for inactivity";
$body = "You have received this email for the following reason:n------------------------------nYour account '".$arr2["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
sendmail($arr2["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
SQL_Query_exec("UPDATE users SET averted2 = 'yes' WHERE id = $arr2[id]");
}
//===| Third Warning
$res3 = SQL_Query_exec("SELECT id, username, email, averted3 FROM users WHERE enabled = 'yes' AND averted3 = 'no' AND last_access > $disabled AND last_access < $warning3");
while ($arr3 = mysql_fetch_assoc($res3))
{
// Send third email
$subject = "Warning for inactivity";
$body = "You have received this email for the following reason:n------------------------------nYour account '".$arr3["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
sendmail($arr3["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
SQL_Query_exec("UPDATE users SET averted3 = 'yes' WHERE id = $arr3[id]");
}
//===| Disable accounts
$res4 = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE enabled = 'yes' AND last_access != '0000-00-00 00:00:00' AND last_access < $disabled");
while ($arr4 = mysql_fetch_assoc($res4))
{
$modcomment = htmlspecialchars($arr4["modcomment"]);
$modcomment = gmdate("d-M-Y") . " - Disabled for inactivity by Systemn". $modcomment;
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET enabled = 'no', modcomment = $modcom WHERE id = $arr4[id]");
write_log("<a href=account-details.php?id=$arr4[id]><b>$arr4[username]</b></a> account has been disabled for inactivity by System");
}
//===| End Disable Inactive Accounts |===// 
<?php
require_once("backend/smilies.php");
require_once("backend/functions.php");
require_once("backend/config.php");
dbconn();
//===| GET CURRENT USERS THEME AND LANGUAGE
if ($CURUSER)
{
$ss_a = @mysql_fetch_array(@sql_query_exec("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));
if ($ss_a)
$THEME = $ss_a["uri"];
$lng_a = @mysql_fetch_array(@sql_query_exec("select uri from languages where id=" . $CURUSER["language"]));
if ($lng_a)
$LANGUAGE = $lng_a["uri"];
}
else
{ //===| Not logged in so get default theme/language
$ss_a = mysql_fetch_array(sql_query_exec("select uri from stylesheets where id='" . $site_config['default_theme'] . "'"));
if ($ss_a)
$THEME = $ss_a["uri"];
$lng_a = mysql_fetch_array(sql_query_exec("select uri from languages where id='" . $site_config['default_language'] . "'"));
if ($lng_a)
$LANGUAGE = $lng_a["uri"];
}
echo'<link rel="stylesheet" type="text/css" href="'.$site_config['SITEURL'].'/themes/'.$THEME.'/theme.css" />';
if (!isset($_GET["form"])||!isset($_GET["text"]))
{
err_msg("Error!","Missing parameter!");
print("</body></html>");
die();
}
$parentform=htmlentities(urldecode($_GET["form"]));
$parentarea=htmlentities(urldecode($_GET["text"]));
?>
<script language=javascript>
function SmileIT(smile,textarea)
{
//===| Attempt to create a text range (IE)
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
{
var caretPos = textarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? smile + ' ' : smile
caretPos.select();
}
//===| Mozilla text range replace
else if (typeof(textarea.selectionStart) != "undefined")
{
var begin = textarea.value.substr(0, textarea.selectionStart);
var end = textarea.value.substr(textarea.selectionEnd);
var scrollPos = textarea.scrollTop;
textarea.value = begin + smile + end;
if (textarea.setSelectionRange)
{
textarea.focus();
textarea.setSelectionRange(begin.length + smile.length, begin.length + smile.length);
}
textarea.scrollTop = scrollPos;
}
//===| Just put it on the end
else
{
textarea.value += smile;
textarea.focus(textarea.value.length - 1);
}
}
</script>
<body class="shoutbox_body">
<table class="table_table" width="100%" cellpadding="1" cellspacing="1">
<tr>
<?php
global $count;
while ((list($code, $url) = each($smilies)))
{
if ($count % 3==0)
print("n<tr>");
print("nt<td class="table_table" align="center"><a href="javascript: SmileIT('".str_replace("'","'",$code)."',window.opener.document.forms.$parentform.$parentarea);"><img border=0 src=images/smilies/".$url."></a></td>");
$count++;
if ($count % 3==0)
print("n</tr>");
}
?>
</tr>
</table>
<div align="center">
<a href="javascript: window.close()"><?php echo CLOSE; ?></a>
</div>
<br />
</body>
?> function PopSmiles(form,name)
{
link = 'moresmiles.php?action=display&form='+form+'&text='+name
newWin=window.open('moresmiles.php?form='+form+'&text='+name,'moresmile','height=450,width=400,resizable=no,scrollbars=yes,location=no');
if (window.focus) {newWin.focus()}
}

if ($site_config["MIDDLENAV"]){
middleblocks();