"TorrentialStorm, post: 39989":Thank you, its ok for 2.07$gigs = 25*1073741824; // 25 GB
$res = mysql_query("SELECT id FROM users WHERE class = 1 AND uploaded >= $gigs AND uploaded >= downloaded");
$time = get_date_time();
while ($arr = mysql_fetch_assoc($res)) {
mysql_query("UPDATE users SET class = 2 WHERE id = $arr[id]");
mysql_query("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[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: Power User')");
}
$res = mysql_query("SELECT id FROM users WHERE class = 2 AND uploaded >= $gigs AND uploaded < downloaded");
while ($arr = mysql_fetch_assoc($res)) {
mysql_query("UPDATE users SET class = 1 WHERE id = $arr[id]");
mysql_query("INSERT INTO messages (sender, receiver, added, msg, subject) VALUES(0, $arr[id], '$time', 'You have been automatically demoted from Power User to User.', 'You have been demoted to User')");
}
that should work for any User that has uploaded 25+GBs and has a ratio over 1
"assus, post: 35524":its ok for 2.07, thanksUse thats code
if ( ($CURUSER["edit_users"]=="yes") || ($CURUSER['username'] == $row['user']) ){
echo "<div align='right' style='float: right'><a href='".$site_config['SITEURL']."/shoutbox.php?del=".$row['msgid']."' style='font-size: 8px'>[D]</a><div>";
}
$a = mysql_query("SELECT class FROM `users` WHERE id = $row[userid] ");
$a = @mysql_fetch_row($a);
switch ($a[0]) {
case 7: // Administrator
$user = "<font color=#ff0000>$row[user]</font>";
break;
case 6: // Super Moderator
$user = "<font color=#FF8080>$row[user]</font>";
break;
case 5: // Moderator
$user = "<font color=#0000FF>$row[user]</font>";
break;
case 4: // Uploader
$user = "<font color=#800000>$row[user]</font>";
break;
case 3: // VIP
$user = "<font color=#FF6600>$row[user]</font>";
break;
case 2: // Szuper Felhasznalo
$user = "<font color=#00CC00>$row[user]</font>";
break;
case 1: // Felhasznalo
$user = "<font color=#000000>$row[user]</font>";
break;
default: // User
$user = $row[user];
}
echo '</td><td style="font-size: 12px; padding-left: 5px"><a href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'" target="_parent"><b>' .$user. ':</b></a> '.nl2br(format_comment($row['message']));
echo '</td></tr>';
}