<?php
require_once("backend/functions.php");
dbconn();
loggedinonly();
$site_config["LEFTNAV"] = false;
$site_config["MIDDLENAV"] = false;
$site_config["RIGHTNAV"] = false;
if (!$site_config["INVITEONLY"] && !$site_config["ENABLEINVITES"]) {
show_error_msg(T_("INVITES_DISABLED"), T_("INVITES_DISABLED_MSG"), 1);
}
$users = get_row_count("users", "WHERE enabled = 'yes'");
if ($users >= $site_config["maxusers_invites"]) {
show_error_msg(T_("ERROR"), "Sorry, The current user account limit (" . number_format($site_config["maxusers_invites"]) . ") has been reached. Inactive accounts are pruned all the time, please check back again later...", 1);
}
if ($CURUSER["invites"] == 0) {
show_error_msg(T_("YOU_HAVE_NO_INVITES"), T_("YOU_HAVE_NO_INVITES_MSG"), 1);
}
if ($_GET["take"]) {
$email = $_POST["email"];
if (!validemail($email))
show_error_msg(T_("ERROR"), T_("INVALID_EMAIL_ADDRESS"), 1);
//check email isnt banned
$maildomain = (substr($email, strpos($email, "@") + 1));
$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$email'")));
if ($a[0] != 0)
$message = sprintf(T_("EMAIL_ADDRESS_BANNED"), $email);
$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$maildomain'")));
if ($a[0] != 0)
$message = sprintf(T_("EMAIL_ADDRESS_BANNED"), $email);
// check if email addy is already in use
if (get_row_count("users", "WHERE email='$email'"))
$message = sprintf(T_("EMAIL_ADDRESS_INUSE"), $email);
if ($message)
show_error_msg(T_("ERROR"), $message, 1);
$secret = mksecret();
$username = "invite_".mksecret(20);
$ret = SQL_Query_exec("INSERT INTO users (username, secret, email, status, invited_by, added, stylesheet, language) VALUES (".
implode(",", array_map("sqlesc", array($username, $secret, $email, 'pending', $CURUSER["id"]))) . ",'" . get_date_time() . "', $site_config[default_theme], $site_config[default_language])");
if (!$ret) {
// If username is somehow taken, keep trying
while (mysqli_errno($GLOBALS["DBconnector"]) == 1062) {
$username = "invite_".mksecret(20);
$ret = SQL_Query_exec("INSERT INTO users (username, secret, email, status, invited_by, added, stylesheet, language) VALUES (".
implode(",", array_map("sqlesc", array($username, $secret, $email, 'pending', $CURUSER["id"]))) . ",'" . get_date_time() . "', $site_config[default_theme], $site_config[default_language])");
}
show_error_msg(T_("ERROR"), T_("DATABASE_ERROR"), 1);
}
$id = mysqli_insert_id($GLOBALS["DBconnector"]);
$invitees = "$id $CURUSER[invitees]";
SQL_Query_exec("UPDATE users SET invites = invites - 1, invitees='$invitees' WHERE id = $CURUSER[id]");
$psecret = md5($secret);
$mess = strip_tags($_POST["mess"]);
$body = <<<EOD
You have been invited to $site_config[SITENAME] by $CURUSER[username]. They have specified this address ($email) as your email.
If you do not know this person, please ignore this email. Please do not reply.
Message:
-------------------------------------------------------------------------------
$mess
-------------------------------------------------------------------------------
Il s'agit d'un site privé et vous devez accepter les règles avant de pouvoir participer.:
$site_config[SITEURL]/rules.php
$site_config[SITEURL]/faq.php
This is a private site and you must agree to the rules before you can enter:
$site_config[SITEURL]/rules.php
$site_config[SITEURL]/faq.php
To confirm your invitation, you have to follow this link:
$site_config[SITEURL]/account-signup.php?invite=$id&secret=$psecret
After you do this, you will be able to use your new account. If you fail to
do this, your account will be deleted within a few days. We urge you to read
the RULES and FAQ before you start using $site_config[SITENAME].
EOD;
sendmail($email, "$site_config[SITENAME] user registration confirmation", $body, "", "-f$site_config[SITEEMAIL]");
header("Refresh: 0; url=account-confirm-ok.php?type=invite&email=" . urlencode($email));
die;
}
stdhead(T_("INVITE"));
begin_frame(T_("INVITE"));
?>
<form method="post" action="invite.php?take=1">
<table border="0" cellspacing="0" cellpadding="3">
<tr valign="top"><td align="center"><b><?php echo T_("EMAIL_ADDRESS");?>:</b></td><td align="left"><input type="text" size="50" name="email" />
<table width="850" border="0" cellspacing="0" cellpadding="10"><tr><td><font class="small"><?php echo T_("EMAIL_ADDRESS_VALID_MSG");?></font></td></tr></table>
</td></tr>
<tr><td align="right"><b><?php echo T_("MESSAGE");?>:</b></td><td align="left"><textarea name="mess" rows="10" cols="80"></textarea>
</td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("SEND_AN_INVITE");?>" /></td></tr>
</table>
</form>
<?php
end_frame();
stdfoot();
?> print("<tr><td>Seed Bonus</td><td align='left'><input type='text' size='4' name='seedbonus' value='".$user["seedbonus"]."' /></td></tr>\n");

//START THANKS\\\\
$thanksl = explode(",", $row['thanks']);
if ($CURUSER['username'] == $row['username']) {
$leftthanks = true;
$leftthanks2 = true;
} else {
foreach ($thanksl as $u) {
$thanks .= ($i > 0) ? ", $u" : $u;
if ($u == $CURUSER['username']) {
$leftthanks2 = true;
$leftthanks = true;
}
$i++;
}
}
if ( get_user_class() >= 1 )
if (!$leftthanks2) {
$button='<br/>
<input src="images/thanks.gif" height="30" width="290"style="border:0px;" type="image" id="refresh">';
} else {
$button='';
}
if ( get_user_class() >= 1 )
echo '<table align="left"><b>Thanks by : </b></table>
<div style='height:80px;line-height:2em;overflow:auto;padding:5px;'></div>
<div id="thankput"></div>'.$button.'
<script type="text/javascript" src="'.$site_config["SITEURL"].'/js/thanks.js"></script>
<script type="text/javascript">
var $s = jQuery.noConflict();
$s("#thankput").load("thanks.php?id='.$id.'");
$s(function() {
$s("#refresh").click(function() {
$s("#thankput").empty().html(\'<center><img src="'.$site_config["SITEURL"].'/images/ajax-loader.gif"></center>\');
$s("#thankput").load("thanks.php?id='.$id.'&to=give&torrent='.$id.'")
return false;
})
})
</script>
<br/>';
////END THANKS\\\\\<?php
//
// TorrentTrader v2.x
// $LastChangedDate: 2011-11-01 00:57:44 +0000 (Tue, 01 Nov 2011) $
// $LastChangedBy: dj-howarth1 $
//
// http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn();
loggedinonly();
if ($CURUSER["view_torrents"] == "no")
show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);
$id = (int) $_GET["id"];
if (isset($_COOKIE["reseed$id"]))
show_error_msg(T_("ERROR"), "You have recently made a request for this seed, please wait longer for another request..", 1);
$res = SQL_Query_exec("SELECT `owner`, `banned`, `external` FROM `torrents` WHERE `id` = $id");
$row = mysqli_fetch_assoc($res);
if (!$row || $row["banned"] == "yes" || $row["external"] == "yes")
show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);
$res2 = SQL_Query_exec("SELECT users.id FROM completed LEFT JOIN users ON completed.userid = users.id WHERE users.enabled = 'yes' AND users.status = 'confirmed' AND completed.torrentid = $id");
$message = $CURUSER['username'] . " Can you seed the torrent below to share it please,... because there is currently no or few Seeder, thank you in advance for your sharing for this torrent::\n\n" . $site_config["SITEURL"] . "/torrents-details.php?id=$id \n Thank You!";
while ( $row2 = mysqli_fetch_assoc($res2) )
{
SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row2['id']."', '".get_date_time()."', ".sqlesc($message).")");
}
if ($row["owner"] && $row["owner"] != $CURUSER["id"])
SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row['owner']."', '".get_date_time()."', ".sqlesc($message).")");
setcookie("reseed$id", $id, time() + 86400, '/');
show_error_msg("Complete", "Your reseed request is sent.", 1);
?>begin_frame(T_("TORRENT_DETAILS_FOR"). " \"" . $shortname . "\"");
echo "<div align='right'>[<a href='report.php?torrent=$id'><b>" .T_("REPORT_TORRENT"). "</b></a>] ";
if ($owned)
echo "[<a href='torrents-edit.php?id=$row[id]&returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'><b>".T_("EDIT_TORRENT")."</b></a>]<br>";echo "<div align='right'>[<a href='torrents-reseed.php?id=$id'><b><font color='#FC5F52'>Seed discount request for this torrent</font></b></a>]<br> ";<?
require "backend/functions.php";
//require_once("backend/phpbb2Bridge.php");
dbconn();
if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
$username = trim($_POST["username"]);
$password = trim($_POST["password"]);
if (!$username || !$password)
bark("Couldn't delete account", "Please fill out the form correctly.");
$password = md5($password);
$res = mysql_query("SELECT * FROM users WHERE username=" . sqlesc($username) . " && password=" .
sqlesc($password)) or sqlerr();
if (mysql_num_rows($res) != 1)
bark("Couldn't delete account", "Bad user name or password. Please verify that all entered information is correct.");
$arr = mysql_fetch_assoc($res);
//if ($arr["status"] == "confirmed")
//bark("Couldn't delete account", "Sorry, you can not delete a confirmed account.");
$id = $arr['id'];
$res = mysql_query("DELETE FROM users WHERE id=$id") or sqlerr();
if (mysql_affected_rows() != 1)
bark("Couldn't delete account", "Unable to delete the account.");
if ($CURUSER)
$x = $CURUSER['username'];
else
$x = "an anonymous user";
delete_phpBB2user ($username, $password);
bark("Success", "The account <b>$username</b> were deleted.", Success);
}
stdhead("Delete account");
begin_frame("Delete Account");
?>
Thanks for using <b><?=$SITENAME?></b>. If you are no longer in need of your account you can delete it using the form below. All your account details will be deleted but any .torrents which you uploaded will remian in place until all users have finished downloading from them.
Please be aware that deleted accounts cannot be recovered and that any priviledges accumulated on one account cannot be transferred if you choose to sign up again.<br /><br />
<table border=0 cellspacing=0 cellpadding=5>
<form method=post action=account-delete.php>
<tr><td class=rowhead><b>Username:</b></td><td><input size=40 name=username></td></tr>
<tr><td class=rowhead><b>Password:</b></td><td><input type=password size=40 name=password></td></tr>
<tr><td colspan=2 align="right"><input type=submit value='Delete Account'></td></tr>
</table>
</form>
<?
end_frame();
stdfoot();
?><?php
//
// TorrentTrader v2.x
// $LastChangedDate: 2011-11-01 00:57:44 +0000 (Tue, 01 Nov 2011) $
// $LastChangedBy: dj-howarth1 $
//
// http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn();
loggedinonly();
if ($CURUSER["view_torrents"] == "no")
show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);
$id = (int) $_GET["id"];
if (isset($_COOKIE["reseed$id"]))
show_error_msg(T_("ERROR"), "Vous avez recemment fait une demande pour cette semence, veuillez attendre plus longtemps pour une autre demande..", 1);
$res = SQL_Query_exec("SELECT `owner`, `banned`, `external` FROM `torrents` WHERE `id` = $id");
$row = mysqli_fetch_assoc($res);
if (!$row || $row["banned"] == "yes" || $row["external"] == "yes")
show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);
$res2 = SQL_Query_exec("SELECT users.id FROM completed LEFT JOIN users ON completed.userid = users.id WHERE users.enabled = 'yes' AND users.status = 'confirmed' AND completed.torrentid = $id");
$message = $CURUSER['username'] . " Pouvez vous remettre en seed le torrent ci-dessous pour le partager svp,... car il n'y a actuellement pas ou peu de Seeder, merci d'avance pour votre partage pour ce torrent::\n\n" . $site_config["SITEURL"] . "/torrents-details.php?id=$id \n Thank You!";
while ( $row2 = mysqli_fetch_assoc($res2) )
{
SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row2['id']."', '".get_date_time()."', ".sqlesc($message).")");
}
if ($row["owner"] && $row["owner"] != $CURUSER["id"])
SQL_Query_exec("INSERT INTO `messages` (`subject`, `sender`, `receiver`, `added`, `msg`) VALUES ('Torrent Reseed Request', '".$CURUSER['id']."', '".$row['owner']."', '".get_date_time()."', ".sqlesc($message).")");
setcookie("reseed$id", $id, time() + 86400, '/');
show_error_msg("Complete", "Votre demande de reseed est envoyée.", 1);
?>if ($row["external"] != "yes" && $row["times_completed"] > 0) {
echo("[<a href='torrents-completed.php?id=$id'>" .T_("WHOS_COMPLETED"). "</a>] ");
if ($row["seeders"] <= 1) {
echo("[<a href='torrents-reseed.php?id=$id'>" .T_("REQUEST_A_RE_SEED"). "</a>]");
}
}
?> //START THANKS\\\\
$thanksl = explode(",", $row['thanks']);
if ($CURUSER['username'] == $row['username']) {
$leftthanks = true;
$leftthanks2 = true;
} else {
foreach ($thanksl as $u) {
$thanks .= ($i > 0) ? ", $u" : $u;
if ($u == $CURUSER['username']) {
$leftthanks2 = true;
$leftthanks = true;
}
$i++;
}
}
if ( get_user_class() >= 1 )
if (!$leftthanks2) {
$button='<br/>
<input src="images/thanks.gif" height="30" width="290"style="border:0px;" type="image" id="refresh">';
} else {
$button='';
}
if ( get_user_class() >= 1 )
echo '<table align="left"><b>Merci par : </b></table>
<div id="thankput"></div>'.$button.'
<script type="text/javascript" src="'.$site_config["SITEURL"].'/js/thanks.js"></script>
<script type="text/javascript">
var $s = jQuery.noConflict();
$s("#thankput").load("thanks.php?id='.$id.'");
$s(function() {
$s("#refresh").click(function() {
$s("#thankput").empty().html(\'<center><img src="'.$site_config["SITEURL"].'/images/ajax-loader.gif"></center>\');
$s("#thankput").load("thanks.php?id='.$id.'&to=give&torrent='.$id.'")
return false;
})
})
</script>
<br/>';
////END THANKS\\\\\
maximum slott exceeded! you may only download 2 torrent at a timecase 'VIP':
$days = $row->value;
$vipuntil = ( $CURUSER["vipuntil"] > "0000-00-00 00:00:00" ) ? $vipuntil = get_date_time( strtotime( $CURUSER["vipuntil"] ) + ( $days*86400 ) ) : $vipuntil = get_date_time( gmtime() + ( $days*86400 ) );
$oldclass = ( $CURUSER["vipuntil"] > "0000-00-00 00:00:00" ) ? $oldclass = $CURUSER["oldclass"] : $oldclass = $CURUSER["class"];
SQL_Query_exec("UPDATE `users` SET `class` = '3', `oldclass`='$oldclass', `downloaded` = 0, `vipuntil` = '$vipuntil' WHERE `id` = '$CURUSER[id]'");
break;
}