Hello after some modifications I share with you the auto promote function which works on the v3, it is configured to have the promotion above the ratio of 1.00 below the ratio of 1.00 you will be demoted to members.
I put you two functions vip and power user
you can change this part of the code if you want to allow more in ratio and replace the 1 by the one of your choice >>> uploaded / downloaded) >= 1.0");
in the backend folder open the file cleanup.php and at the end of the file just before ?
add the code ... enjoy
[color=rgb(243, 121, 52)]For the vip function[/color]
[color=rgb(243, 121, 52)]For the power users function[/color]
I put you two functions vip and power user
you can change this part of the code if you want to allow more in ratio and replace the 1 by the one of your choice >>> uploaded / downloaded) >= 1.0");
in the backend folder open the file cleanup.php and at the end of the file just before ?
add the code ... enjoy
[color=rgb(243, 121, 52)]For the vip function[/color]
####################################
# AUTO PROMOTE MEMBERS VIP #
####################################
$gigs = 25*1073741824; // 25 GB
$res_premote = SQL_Query_exec("SELECT id FROM users WHERE class = 1 AND uploaded >= $gigs AND (uploaded / downloaded) >= 1.0");
$time = get_date_time();
while ($arr_premote = mysqli_fetch_assoc($res_premote)) {
SQL_Query_exec("UPDATE users SET class = 3 WHERE id = $arr_premote[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr_premote[id], '$time', 'You have been automatically promoted from User to Power User, If your ratio drops below 1.00 you will be demoted.', 'You have been promoted to: vip')");
}
unset($res_premote,$arr_premote);
$res_demote = SQL_Query_exec("SELECT id FROM users WHERE class = 3 AND uploaded >= $gigs AND (uploaded / downloaded) <= 1.0");
while ($arr_demote = mysqli_fetch_assoc($res_demote)) {
SQL_Query_exec("UPDATE users SET class = 1 WHERE id = $arr_demote[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr_demote[id], '$time', 'You have been automatically demoted from Power User to User.', 'You have been demoted to User')");
}
unset($res_demote,$arr_demote);
##########################
# END AUTO PROMOTE MEMBERS VIP#
##########################[color=rgb(243, 121, 52)]For the power users function[/color]
####################################
# AUTO PROMOTE POWER USERS #
####################################
$gigs = 25*1073741824; // 25 GB
$res_premote = SQL_Query_exec("SELECT id FROM users WHERE class = 1 AND uploaded >= $gigs AND (uploaded / downloaded) >= 1.0");
$time = get_date_time();
while ($arr_premote = mysqli_fetch_assoc($res_premote)) {
SQL_Query_exec("UPDATE users SET class = 2 WHERE id = $arr_premote[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr_premote[id], '$time', 'You have been automatically promoted from User to Power User, If your ratio drops below 1.00 you will be demoted.', 'You have been promoted to: vip')");
}
unset($res_premote,$arr_premote);
$res_demote = SQL_Query_exec("SELECT id FROM users WHERE class = 2 AND uploaded >= $gigs AND (uploaded / downloaded) <= 1.0");
while ($arr_demote = mysqli_fetch_assoc($res_demote)) {
SQL_Query_exec("UPDATE users SET class = 1 WHERE id = $arr_demote[id]");
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr_demote[id], '$time', 'You have been automatically demoted from Power User to User.', 'You have been demoted to User')");
}
unset($res_demote,$arr_demote);
##########################
# END AUTO PROMOTE POWER USERS #
##########################