This mod will auto promote users to the class you choose. It works well for me and is ported from another project.
Open backend/cleanup.php and find
//DELETE PENDING USER ACCOUNTS OVER TIMOUT AGE
Add right before // line
[ATTACH type="full" alt="auto-promoted.png"]5901[/ATTACH]
Open backend/cleanup.php and find
//DELETE PENDING USER ACCOUNTS OVER TIMOUT AGE
Add right before // line
// Auto promote users
$regular = 1; // Regular class ID
$promotclass = 3; // Promoted class ID
$limit = 25 * 1024 * 1024 * 1024;
$minratio = 1.05;
$maxdt = get_date_time(time() - 86400 * 28);
$res = SQL_Query_exec("SELECT id, username FROM users WHERE class = $regular AND uploaded >= $limit AND uploaded / downloaded >= $minratio AND added < $maxdt");
if ($res) {
$dt = get_date_time();
$msg = "Congratulations, you have been automatically promoted to Power User. You can now do more stuff.";
while ($arr = mysql_fetch_assoc($res)) {
SQL_Query_exec("UPDATE users SET class = $promotclass WHERE id = $arr[id]");
$txt = "You have been promoted to Power User!";
$event = "$arr[username] has been promoted Power User";
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $txt, 0)");
SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, $arr[username], $event, $dt, 0)");
write_log("The user <a href=\"/user/?id=$arr[id]\">$arr[username]</a> was automatically promoted to power user.");
}
}
// Auto demote users
$minratio = 0.95;
$res = SQL_Query_exec("SELECT id, username FROM users WHERE class = $promotclass AND uploaded / downloaded < $minratio");
if ($res) {
$dt = get_date_time();
$msg = "You were automatically demoted from Power User to Regular because your share ratio fell below $minratio.";
while ($arr = $res->fetch()) {
SQL_Query_exec("UPDATE users SET class = $regular WHERE id = $arr[id]");
$txt = "You have been demoted to Regular!";
$event = "$arr[username] has been demoted Regular";
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id], $dt, $txt, 0)");
SQL_Query_exec("INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, $arr[username], $event, $dt, 0)");
write_log("The user <a href=\"/user/?id=$arr[id]\">$arr[username]</a> was automatically demoted to regular.");
}
}
[ATTACH type="full" alt="auto-promoted.png"]5901[/ATTACH]
