

$res = SQL_Query_exec("SELECT COUNT(*) FROM snatched where hnr='yes'"); //update by Gollum [CREATE TABLE `invites` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`inviter` int(10) unsigned NOT NULL DEFAULT '0',
`inviteid` int(10) NOT NULL DEFAULT '0',
`invite` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',
`time_invited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`confirmed` char(3) COLLATE utf8_bin NOT NULL DEFAULT 'no',
PRIMARY KEY (`id`),
KEY `inviter` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=182 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
ALTER TABLE `users` ADD `invited_by` int(10) NOT NULL default '0';
ALTER TABLE `users` ADD `invites` smallint(4) NOT NULL default '3';<?php
require_once("backend/functions.php");
dbconn();
$id = (int) $_GET["id"];
if (!@count($_POST['conusr'])) autolink("invite.php", "Nothing Selected.");
SQL_Query_exec("UPDATE invites SET confirmed='yes' WHERE inviteid IN (" . implode(", ", $_POST['conusr']) . ") AND confirmed='no'");
SQL_Query_exec("UPDATE users SET status = 'confirmed' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND status='pending'");
SQL_Query_exec("UPDATE users SET uploaded='2150000000' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND uploaded='0'");
$result = SQL_Query_exec("SELECT * from users WHERE username = '".$CURUSER['username']."'");
while ($row = mysqli_fetch_array($result)){ $old_upload_value = $row['uploaded'] + 2150000000; }
SQL_Query_exec("UPDATE users SET uploaded='$old_upload_value' WHERE username = '".$CURUSER['username']."'");
header("Refresh: 0; url=invite.php?id=$id");
?><?php
require_once("backend/functions.php");
dbconn();
function bark($msg) {
stdhead();
show_error_msg("Invitation failed!", $msg);
stdfoot();
exit;
}
$id = 0 + $_GET["id"];
if ($id == 0){
$id = $CURUSER["id"];
}
if (get_user_class() <= 6)
$id = $CURUSER["id"];
$re = SQL_Query_exec("SELECT invites FROM users WHERE id = $id") or sqlerr();
$tes = mysql_fetch_assoc($re);
if ($tes[invites] <= 0)
show_error_msg("Vous avez aucune invitation!");
$ret = SQL_Query_exec("SELECT username FROM users WHERE id = $id") or sqlerr();
$arr = mysql_fetch_assoc($ret);
$hash = md5(mt_rand(1,1000000));
SQL_Query_exec("INSERT INTO invites (inviter, invite, time_invited) VALUES ('$id', '$hash', '" . get_date_time() . "')");
SQL_Query_exec("UPDATE users SET invites = invites - 1 WHERE id = $id") or sqlerr(__FILE__, __LINE__);
header("Refresh: 0; url=invite.php?id=$id");
?>
M-jay:For clarification is this after admin confirm users - we just need to add mail here is admincpIs this right and ill play with it 👍autolink("admincp.php?action=confirmreg", "Entries Confirmed");
#======================================================================#
# Invited Users - Created by djhowarth
#======================================================================#
if ($action == "invited")
{
if ($do == "del")
{
if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);
$ids = array_map("intval", $_POST["users"]);
$ids = implode(", ", $ids);
$res = SQL_Query_exec("SELECT u.id, u.invited_by, i.invitees FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' AND u.id IN ($ids)");
while ($row = mysqli_fetch_assoc($res))
{
# We remove the invitee from the inviter and give them back there invite.
$invitees = str_replace("$row[id] ", "", $row["invitees"]);
SQL_Query_exec("UPDATE `users` SET `invites` = `invites` + 1, `invitees` = '$invitees' WHERE `id` = '$row[invited_by]'");
deleteaccount($row['id']);
}
autolink("admincp.php?action=invited", "Entrées supprimées");
}
$count = get_row_count("users", "WHERE status = 'confirmed' AND invited_by != '0'");
list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=invited&');
$res = SQL_Query_exec("SELECT u.id, u.username, u.email, u.added, u.last_access, u.class, u.invited_by, i.username as inviter FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'confirmed' AND u.invited_by != '0' ORDER BY u.added DESC $limit");
stdhead("Invited Users");
#navmenu();
begin_frame("Utilisateurs Invités");
?>
<center>
Cette page affiche tous les utilisateurs invités auxquels des invitations ont été envoyées et ont activé leur compte. En supprimant des utilisateurs, l'invité recevra une invitation et toutes les données associées à l'invité seront supprimées.<hr class="barre"/><?php echo number_format($count); ?> les membres ont confirmé les invitations.
</center>
<?php if ($count > 0): ?>
<br />
<form id="invited" method="post" action="admincp.php?action=invited">
<input type="hidden" name="do" value="del" />
<table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
<tr>
<th class="table_head">PSeudo</th>
<th class="table_head">E-mail</th>
<th class="table_head"><?php echo T_("CLASS");?></th>
<th class="table_head">Invité</th>
<th class="table_head">Dernier Accès</th>
<th class="table_head">Invité Par..</th>
<th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
</tr>
<?php while ($row = mysqli_fetch_assoc($res)): ?>
<tr>
<td class="table_col1" align="center"><a href="account-details.php?id=<?php echo $row["id"]; ?>"><?php echo $row["username"]; ?></a></td>
<td class="table_col2" align="center"><?php echo $row["email"]; ?></td>
<td class="table_col1" align="center"><?php echo get_user_class_name($row["class"]); ?></td>
<td class="table_col2" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
<td class="table_col1" align="center"><?php echo utc_to_tz($row["last_access"]); ?></td>
<td class="table_col2" align="center"><?php echo ( $row['inviter'] ) ? '<a href="account-details.php?id='.$row["invited_by"].'">'.$row["inviter"].'</a>' : 'Unknown User'; ?></td>
<td class="table_col1" align="center"><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" /></td>
</tr>
<?php endwhile; ?>
<tr>
<td colspan="7" align="right">
<input type="submit" value="Supprimer Les Cochés" />
</td>
</tr>
</table>
</form>
<?php
endif;
if ($count > 25) echo $pagerbottom;
end_frame();
navmenu();
stdfoot();
}
#======================================================================#
# End Invited Users - Created by djhowarth
#======================================================================# #======================================================================#
# View Pending Invited Users - Created by djhowarth
#======================================================================#
if ($action == "pendinginvite")
{
if ($do == "del")
{
if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);
$ids = array_map("intval", $_POST["users"]);
$ids = implode(", ", $ids);
$res = SQL_Query_exec("SELECT u.id, u.invited_by, i.invitees FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' AND u.id IN ($ids)");
while ($row = mysqli_fetch_assoc($res))
{
# We remove the invitee from the inviter and give them back there invite.
$invitees = str_replace("$row[id] ", "", $row["invitees"]);
SQL_Query_exec("UPDATE `users` SET `invites` = `invites` + 1, `invitees` = '$invitees' WHERE `id` = '$row[invited_by]'");
SQL_Query_exec("DELETE FROM `users` WHERE `id` = '$row[id]'");
}
autolink("admincp.php?action=pendinginvite", "Entrées supprimées");
}
$count = get_row_count("users", "WHERE status = 'pending' AND invited_by != '0'");
list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=pendinginvite&');
$res = SQL_Query_exec("SELECT u.id, u.username, u.email, u.added, u.invited_by, i.username as inviter FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' ORDER BY u.added DESC $limit");
stdhead("Invited Pending Users");
#navmenu();
begin_frame("Utilisateurs en attente d'invitations");
?>
<center>
Cette page affiche tous les utilisateurs invités auxquels des invitations ont été envoyées mais qui n'ont pas encore été activées. En supprimant un utilisateur, l'invité recevra son invitation et toutes les données associées à l'invité seront supprimées. <hr class="barre"/><?php echo number_format($count); ?> les membres sont en attente.
</center>
<?php if ($count > 0): ?>
<br />
<form id="pendinginvite" method="post" action="admincp.php?action=pendinginvite">
<input type="hidden" name="do" value="del" />
<table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
<tr>
<th class="table_head">Pseudo</th>
<th class="table_head">E-mail</th>
<th class="table_head">Invité</th>
<th class="table_head">Invité Par..</th>
<th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
</tr>
<?php while ($row = mysqli_fetch_assoc($res)): ?>
<tr>
<td class="table_col1" align="center"><?php echo $row["username"]; ?></td>
<td class="table_col2" align="center"><?php echo $row["email"]; ?></td>
<td class="table_col1" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
<td class="table_col2" align="center"><a href="account-details.php?id=<?php echo $row["invited_by"]; ?>"><?php echo $row["inviter"]; ?></a></td>
<td class="table_col1" align="center"><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" /></td>
</tr>
<?php endwhile; ?>
<tr>
<td colspan="5" align="right">
<input type="submit" value="Supprimer Les Cochés" />
</td>
</tr>
</table>
</form>
<?php
endif;
if ($count > 25) echo $pagerbottom;
end_frame();
navmenu();
stdfoot();
}
#======================================================================#
# End View Pending Invited Users - Created by djhowarth
#======================================================================# ##############################
# AUTO PROMOTE SUPER MEMBRES #
##############################
$gigs = 25*1073741824; // 25 GB
$res = SQL_Query_exec("SELECT id FROM users WHERE class = 1 AND uploaded >= $gigs AND uploaded >= downloaded");
$time = get_date_time();
while ($arr = mysqli_fetch_assoc($res)) {
SQL_Query_exec("UPDATE users SET class = 2 WHERE id = $arr[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[id], '$time', 'Félicitations, vous avez été automatiquement promu Membre pour Super Membre vous pouvez maintenant faire plus de choses., Si votre ratio tombe en dessous de 1,00, vous serez rétrogradé.', 'Vous avez été promu à: Super Membre')");
}
$res = SQL_Query_exec("SELECT id FROM users WHERE class = 2 AND uploaded >= $gigs AND uploaded < downloaded");
while ($arr = mysqli_fetch_assoc($res)) {
SQL_Query_exec("UPDATE users SET class = 1 WHERE id = $arr[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[id], '$time', 'Vous avez été automatiquement rétrogradé deSuper Membre pourMembre.', 'Vous avez été rétrogradé au rang d'utilisateur')");
}
###################################
# END AUTO PROMOTE SUPEER MEMBRES #
################################### // Warning upload image1
if (($num = $_FILES['image0']['error']))
autolink("torrents-upload.php", T_("ERROR_UPLOAD_IMAGE1"));
//$message = T_("ERROR_UPLOAD_IMAGE1");
// End MicroMonkey:Remember........mysql_query is SQL_Query_exec