"serph, post: 66827, member: 1398":
Ok I get you it's just you said only staff to delete and I was like how lol ok good were all good to go [USER=311]@MicroMonkey[/USER]
[USER=1398]@serph[/USER] and [USER=311]@MicroMonkey[/USER] do you maybe know how to tweak backend/cleanup.php file so it gives to every user who is registered more than 1 month 2 invites? Without the need to have upload/download and ratio.
This is the code
// Invite update function (Author: TorrentialStorm)
function autoinvites($interval, $minlimit, $maxlimit, $minratio, $invites, $maxinvites) {
$time = gmtime() - ($interval*86400);
$minlimit = $minlimit*1024*1024*1024;
$maxlimit = $maxlimit*1024*1024*1024;
$res = SQL_Query_exec("SELECT id, username, class, invites FROM users WHERE enabled = 'yes' AND status = 'confirmed' AND downloaded >= $minlimit AND downloaded < $maxlimit AND uploaded / downloaded >= $minratio AND warned = 'no' AND UNIX_TIMESTAMP(invitedate) <= $time");
if (mysqli_num_rows($res) > 0) {
while ($arr = mysqli_fetch_assoc($res)) {
$maxninvites = $maxinvites[$arr['class']];
if ($arr['invites'] >= $maxninvites)
continue;
if (($maxninvites-$arr['invites']) < $invites)
$invites = $maxninvites - $arr['invites'];
SQL_Query_exec("UPDATE users SET invites = invites+$invites, invitedate = NOW() WHERE id=$arr[id]");
write_log("Gave $invites invites to '$arr[username]' - Class: ".get_user_class_name($arr['class'])."");
}
}
}
Along with this
// START INVITES UPDATE
// SET INVITE AMOUNTS ACCORDING TO RATIO/GIGS ETC
// autoinvites(interval to give invites (days), min downloaded GB, max downloaded GB, min ratio, invites to give, max invites allowed (array))
// $maxinvites[CLASS ID] = max # of invites;
$maxinvites[1] = 5; // User
$maxinvites[2] = 10; // Power User
$maxinvites[3] = 20; // VIP
$maxinvites[4] = 25; // Uploader
$maxinvites[5] = 100; // Moderator
$maxinvites[6] = 100; // Super Moderator
$maxinvites[7] = 400; // Administrator
// Give 1 invite every 21 days to users with > 1GB downloaded AND < 4GB downloaded AND ratio > 0.50
autoinvites(21, 1, 4, 0.50, 1, $maxinvites);
autoinvites(14, 1, 4, 0.90, 2, $maxinvites);
autoinvites(14, 4, 7, 0.95, 2, $maxinvites);
$maxinvites[1] = 7; // User
autoinvites(14, 7, 10, 1.00, 3, $maxinvites);
$maxinvites[1] = 10; // User
autoinvites(14, 10, 100000, 1.05, 4, $maxinvites);
//END INVITES