
<?php
require_once("backend/functions.php");
dbconn();
loggedinonly();
$action = $_REQUEST["action"];
if ($action == "searchuser") {
$query = $_GET['query'];
$stmt = $GLOBALS["DBconnector"]->prepare("SELECT username FROM users WHERE username LIKE ?");
$searchTerm = $query . "%"; // match starting characters
$stmt->bind_param("s", $searchTerm);
$stmt->execute();
$result = $stmt->get_result();
$usernames = [];
while ($row = $result->fetch_assoc()) {
$usernames[] = $row['username'];
}
echo json_encode($usernames);
die();
}
if ($action == "taketransfer") {
$username = trim($_POST["username"]);
$credit = (int)$_POST["credit"];
$unit = trim($_POST["unit"]);
$anonym = isset($_POST["anonym"]) ? $_POST["anonym"] : '';
if (empty($username)) {
autolink("uptransfer.php", "No recipient was added...");
}
if ($credit < 1 || !$CURUSER) {
autolink("uptransfer.php", "Transfer is too small...");
}
// Define size units
define('KB', 1024);
define('MB', 1024 * KB);
define('GB', 1024 * MB);
define('TB', 1024 * GB);
// Convert credit to bytes
switch ($unit) {
case 'kb':
$credit *= KB;
break;
case 'mb':
$credit *= MB;
break;
case 'gb':
$credit *= GB;
break;
case 'tb':
$credit *= TB;
break;
default:
autolink("uptransfer.php", "Unité spécifiée non valide...");
}
if ($CURUSER["uploaded"] < $credit) {
autolink("uptransfer.php", "Vous essayez de faire don de crédits de téléchargement alors que vos crédits sont actuellement insuffisants...");
}
$stmt = $GLOBALS["DBconnector"]->prepare("SELECT id, uploaded, modcomment FROM users WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$res = $stmt->get_result()->fetch_assoc();
if (!$res) {
autolink("uptransfer.php", T_("USER_NOT_FOUND"));
}
$receiver = $res["id"];
$sender = $CURUSER["id"];
$modcomment1 = $res["modcomment"];
$modcomment2 = $CURUSER["modcomment"];
// Prepare modcomments
$date = gmdate("Y-m-d");
$modcomment1 = "$date - Credit upload: $username obtenue " . mksize($credit) . " depuis le " . $CURUSER['username'] . ".\n" . $modcomment1;
$modcomment2 = "$date - Credit upload: " . $CURUSER['username'] . " fait don " . mksize($credit) . " à $username.\n" . $modcomment2;
// Update receiver's uploaded credits and modcomment
$stmt = $GLOBALS["DBconnector"]->prepare("UPDATE users SET uploaded = uploaded + ?, modcomment = ? WHERE id = ?");
$stmt->bind_param("isi", $credit, $modcomment1, $receiver);
$stmt->execute();
// Update sender's uploaded credits and modcomment
$stmt = $GLOBALS["DBconnector"]->prepare("UPDATE users SET uploaded = uploaded - ?, modcomment = ? WHERE id = ?");
$stmt->bind_param("isi", $credit, $modcomment2, $sender);
$stmt->execute();
// Send notification
$subject = "You got an upload credit!";
if ($anonym != 'anonym') {
$msg = "Your account has been credited " . mksize($credit) . " compliments of " . $CURUSER['username'] . ".";
$stmt = $GLOBALS["DBconnector"]->prepare("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES (?, ?, NOW(), ?, 0, ?)");
$stmt->bind_param("iiss", $sender, $receiver, $msg, $subject);
} else {
$msg = "Your account has been credited " . mksize($credit) . " compliments of an anonymous user.";
$stmt = $GLOBALS["DBconnector"]->prepare("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES (0, ?, NOW(), ?, 0, ?)");
$stmt->bind_param("iss", $receiver, $msg, $subject);
}
$stmt->execute();
// Log the transfer
write_log("<font color=lime size=2>Credit Upload:</font><a href=account-details.php?id=$sender target=_blank>" . $CURUSER['username'] . "</a> fait don " . mksize($credit) . " à <a href=account-details.php?id=$receiver target=_blank>$username</a>");
autolink("uptransfer.php", "Tu as donné " . mksize($credit) . " en crédit d'upload vers " . $username);
die();
}
/* Start Page Output */
stdhead("Faire un don d'Uploads");
begin_frame(T_('Information'));
?>
<b><?php echo T_("WHY_SHOULD_DONATE"); ?></b><br />
<?php echo T_("CREDIT_UP_TEXT1"); ?>
<?php
end_frame();
begin_frame(T_('TRANSFER_UPLOAD'));
?>
<center>
<form name="transfer" method="post" action="uptransfer.php?action=taketransfer">
<table class="table_table" width="600" cellpadding="5">
<tr>
<td width="120"><b><?php echo T_("DONATE_TO"); ?>:</b></td>
<td>
<input type="text" id="username" name="username" size="20" onkeyup="searchUser(this.value)" autocomplete="off"> <input type="checkbox" name="anonym" value="anonym" style="vertical-align:middle;"> <?php echo T_("ANONYMOUS_TRANSFER"); ?>
<div id="suggestions" style="border: 1px solid #ccc; display: none; max-height: 100px; overflow-y: auto;"></div>
</td>
</tr>
<tr>
<td width="100"><b><?php echo T_("AMOUNT_CREDIT"); ?>:</b></td>
<td>
<input type="text" autocomplete="off" name="credit" size="20" value="1" pattern="\d*" title="Seuls les chiffres sont autorisés.">
<select name="unit" style="width:50px;">
<option value="kb">KB</option>
<option value="mb">MB</option>
<option value="gb">GB</option>
<option value="tb">TB</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<center><input name="submit" type="submit" value="Transfer!"></center>
</td>
</tr>
</table>
</form>
</center>
<?php
end_frame();
stdfoot();
?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
function searchUser(query) {
if (query.length > 0) { // Adjusted to start with the first character
$.ajax({
url: 'uptransfer.php?action=searchuser',
type: 'GET',
data: { query: query },
success: function(data) {
var suggestions = JSON.parse(data);
var suggestionsList = '';
if (suggestions.length > 0) {
suggestions.forEach(function(username) {
suggestionsList += '<div class="suggestion-item" onclick="selectUsername(\'' + username + '\')">' + username + '</div>';
});
} else {
suggestionsList = '<div class="suggestion-item">Aucune suggestion trouvée</div>';
}
$('#suggestions').html(suggestionsList).show();
}
});
} else {
$('#suggestions').hide();
}
}
function selectUsername(username) {
$('#username').val(username);
$('#suggestions').hide();
}
</script>
<style>
.suggestion-item {
padding: 10px;
cursor: pointer;
}
.suggestion-item:hover {
background-color: #f0f0f0;
}
</style>
$num = 0;
while ($a = mysqli_fetch_assoc($res)){
++$num;
print("<tr class='table_col2'><td align='center' class='ttable_col1' >$num</td><td class='ttable_col2' style='text-align: justify'><a href='".$site_config['SITEURL']."/account-details.php?id=$a[id]'><b>".class_user($a['username'])."</b></a></td><td align='center' class='ttable_col1'>$a[num]</td></tr>\n");
}// Update Top forum posts by spiritblue 2024
$num = 0;
while ($a = mysqli_fetch_assoc($res)){
++$num;
if ($a['username']) {
print("<tr class='table_col2'><td align='center' class='ttable_col1' >$num</td><td class='ttable_col2' style='text-align: justify'><a href='".$site_config['SITEURL']."/account-details.php?id=$a[id]'><b>".class_user($a['username'])."</b></a></td><td align='center' class='ttable_col1'>$a[num]</td></tr>\n");
}else{
print("<tr class='table_col2'><td align='center' class='ttable_col1'>$num</td><td class='ttable_col2' style='text-align: justify'><img src='images/inconnu.png' height='34' width='36' alt='Inconnu' title='Inconnu!' border='0'><i><b>Banmni / Inconnu</b></i></td><td align='center' class='ttable_col1'>$a[num]</td></tr>\n");
}
}//Update Top forum posts by spiritblue 2024
//Update 2024 for more security by djlive
$num = 0;
while ($a = mysqli_fetch_assoc($res)) {
++$num;
$username = htmlspecialchars($a['username'], ENT_QUOTES, 'UTF-8');
$userId = (int)$a['id'];
$userNum = htmlspecialchars($a['num'], ENT_QUOTES, 'UTF-8');
$siteUrl = htmlspecialchars($site_config['SITEURL'], ENT_QUOTES, 'UTF-8');
if ($a['username']) {
echo "<tr class='table_col2'><td align='center' class='ttable_col1' >$num</td><td class='ttable_col2' style='text-align: justify'><a href='{$siteUrl}/account-details.php?id=$userId'><b>" . class_user($username) . "</b></a></td><td align='center' class='ttable_col1'>$userNum</td></tr>\n";
} else {
echo "<tr class='table_col2'><td align='center' class='ttable_col1'>$num</td><td class='ttable_col2' style='text-align: justify'><img src='images/inconnu.png' height='34' width='36' alt='Inconnu' title='Inconnu!' border='0'><i><b>Banmni / Inconnu</b></i></td><td align='center' class='ttable_col1'>$userNum</td></tr>\n";
}
} ALTER TABLE `torrents` ADD `thanks_magnet` LONGTEXT;$res = SQL_Query_exec("SELECT filename, banned, external, announce, thanks,thanks_magnet, $name = $row['filename'];// START THANKS MAGNETIC
$site_config["LEFTNAV"] = $site_config["RIGHTNAV"] = false; //Activate=true OR false
if ($CURUSER["id"] != $row["owner"] && !in_array($CURUSER["username"], explode(',', $row["thanks_magnet"])))
error_download('⚠ Error download ⚠ ','
<br/>
<div style="vertical-align: middle;font-size: 1.4em;"> You Haven\'t Thanked The Sharer Yet, Watch The Video ↴</div><hr class="barre" width="850" style="height:20px"/>
<video controls width="640">
<source src="/media/cc0-videos/flower.webm"
type="video/webm">
<source src="https://www.MY_NAME_SITE.com/infostelechargementtorrent.mp4"
type="video/mp4">
Sorry, your browser does not support embedded videos
</video>
<br/><a class="stylebouton" href="'.$site_config["SITEURL"].'/torrents-details.php?id='.$id.'' . ".$torrent." . '&hit=1">Back to my choice</a>
',1);
// END THANKS$res = SQL_Query_exec("SELECT torrents.anon, torrents.safe, torrents.markedby, torrents.tube, torrents.recommended, torrents.exclusif, torrents.thanks,torrents.thanks_magnet, //End Torrent Externe//START THANKS MAGNETIC\\\\
$thanksl = explode(",", $row['thanks_magnet']);
if ($CURUSER['username'] == $row['username']) {
$leftthanks = true;
$leftthanks2 = true;
} else {
foreach ($thanksl as $u) {
$thanks_magnet .= ($i > 0) ? ", $u" : $u;
if ($u == class_user($CURUSER['username'])) {
$leftthanks2 = true;
$leftthanks = true;
}
$i++;
}
}
if (!$leftthanks2) {
$button='<input type="button" name="thanks_magnet" value=" Say Thanks For Downloading " id="refresh">';
} else {
$button='<hr/>';
}
echo '<center><div id="Bouton_thanck"><p colspan="4"><hr class="barre"/> ⇘ Les Remerciments Magnetic ⇙ <div id="thankput"></div>'.$button.'<script type="text/javascript" src="'.$site_config["SITEURL"].'/js/thanks_magnet.js"></script>
<script type="text/javascript">
var $s = jQuery.noConflict();
$s("#thankput").load("thanks_magnet.php?id='.$id.'");
$s(function() {
$s("#refresh").click(function() {
$s("#thankput").empty().html(\'<center><img src="'.$site_config["SITEURL"].'/images/ajax-loader.gif" width="40" height="40"></center>\');
$s("#thankput").load("thanks_magnet.php?id='.$id.'&to=give&torrent='.$id.'")
return false;
})
})
</script></p></div></center><br/>';
////END THANKS MAGNETIC\\\\\

CREATE TABLE `gender` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`genpic` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`gen` char(3) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `gender` (`id`, `name`, `genpic`, `gen`) VALUES
(1, 'Male', 'male.png', 'MU'),
(2, 'Female', 'female.png', 'ZE'),
(3, 'Alien', 'alien.gif', 'AL'),
(4, 'Peace', 'peace.png', 'LT'),
(5, 'Secret', 'secret.png', 'NO'); $gender = "<option value='Homme'" . ($CURUSER["gender"] == "Male" ? " selected='selected'" : "") . ">" . T_("MALE") . "</option>\n"
. "<option value='Femme'" . ($CURUSER["gender"] == "Female" ? " selected='selected'" : "") . ">" . T_("FEMALE") . "</option>\n"; // Select Mod Gender
print('<td align="right" class="alt2">' .T_("GENDER"). ' :</td>
<td class="alt2">
' .T_("MALE"). ' :
<input type="radio" name="gender" value="Male" id="box" /> <img src="images/gender/male.png" alt="' .T_("MALE"). '" title="' .T_("MALE"). '" />
' .T_("FEMALE"). ' :
<input type="radio" name="gender" value="Female" id="box" /> <img src="images/gender/female.png" alt="' .T_("FEMALE"). '" title="' .T_("FEMALE"). '" />
' .T_("Alien"). ' :
<input type="radio" name="gender" value="Alien" id="box" /> <img src="images/gender/alien.gif" alt="' .T_("Alien"). '" title="' .T_("Alien"). '" />
<hr />
' .T_("LGBTQ"). ' :
<input type="radio" name="gender" value="LGBTQ" id="box" /> <img src="images/gender/peace.gif" style="width:22px;height:24px;" alt="' .T_("Peace"). '" title="' .T_("Peace"). '" />
' .T_("Secret"). ' :
<input type="radio" name="gender" value="Wont" id="box" /> <img src="images/gender/secret.png" style="width:22px;height:24px;" alt="' .T_("Secret"). '" title="' .T_("Secret"). '" /></td>');
// End Mod Gender<b><?php echo T_("USERNAME"); ?>:</b> <?php echo class_user($CURUSER["username"]); ?><br /><b><?php echo T_("GENDER"); ?>:</b> <?php echo T_($CURUSER["gender"]); ?><br /> <td>
<input type="radio" name="gender" value="Male" /><?php echo T_("MALE"); ?>
<input type="radio" name="gender" value="Female" /><?php echo T_("FEMALE"); ?>
</td> <td>
<?php echo T_("GENDER"); ?>:</td><td>
<?php echo T_("MALE"); ?> : <input type="radio" name="gender" value="Male" id="box" /> <img src="images/gender/male.png" title="<?php echo T_('MALE'); ?>" /> <?php echo T_("MALE"); ?>
<?php echo T_("FEMALE"); ?> :
<input type="radio" name="gender" value="Female" id="box" /> <img src="images/gender/female.png" alt="<?php echo T_('FEMALE'); ?>" title="<?php echo T_('FEMALE'); ?>" /> <?php echo T_("FEMALE"); ?>
<hr />
<?php echo T_("Alien"); ?> :
<input type="radio" name="gender" value="Alien" id="box" /> <img src="images/gender/alien.gif" alt="<?php echo T_('Alien'); ?>" title="<?php echo T_('Alien'); ?>" /> <?php echo T_("Alien"); ?>
<?php echo T_("LGBTQ"); ?> :
<input type="radio" name="gender" value="LGBTQ" id="box" /> <img src="images/gender/peace.gif" style="width:22px;height:24px;" alt="<?php echo T_('Peace'); ?>" title="<?php echo T_('Peace'); ?>" /> <?php echo T_("Peace"); ?>
<hr />
<?php echo T_("Secret"); ?> :
<input type="radio" name="gender" value="Wont" id="box" /> <img src="images/gender/secret.png" style="width:22px;height:24px;" alt="<?php echo T_('Secret'); ?>" title="<?php echo T_('Secret'); ?>" /> <?php echo T_("Secret"); ?>
</td>