Promote Member to PU when :
- is not warned,
- added for more than x days,
- has minimum y GB uploaded,
- has ratio >= 1.00.
Demote PU to Member when :
- has ratio < 1.00.
cleanup.php
find
- is not warned,
- added for more than x days,
- has minimum y GB uploaded,
- has ratio >= 1.00.
Demote PU to Member when :
- has ratio < 1.00.
cleanup.php
find
//OPTIMIZE TABLES
above add
//AUTO PROMOTE/DEMOTE
$gigs = 100*1073741824; // 100 GB
$delai = 28*86400; // 28 days
$date = get_date_time(gmtime() - $delai);
$time = get_date_time();
//Promote
$res = SQL_Query_exec("SELECT id FROM users WHERE class = '1' AND warned = 'no' AND added < '$date' AND uploaded >= $gigs AND (uploaded / downloaded) >= '1.0'");
while ($arr = mysql_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', 'Vous avez été promu Membre Elite, si votre ratio devient inférieur à 1.00, vous serez rétrogradé.', 'Vous avez été promu : Membre Elite')");
endwhile;
//Demote
$ret = SQL_Query_exec("SELECT id FROM users WHERE class = '2' AND uploaded >= $gigs AND (uploaded / downloaded) < '1.0'");
while ($art = mysql_fetch_assoc($ret)) :
SQL_Query_exec("UPDATE users SET class = 1 WHERE id = $art[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $art[id], '$time', 'Vous avez été rétrogradé Membre car votre ratio est inférieur à 1.0.', 'Vous avez été rétrogradé : Membre')");
endwhile;
// END AUTO PROMOTE/DEMOTE
