Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Auto promote users!
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2011-10-13 22:43:05
this would prob be an better cleanup

replace

$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')");

}





With





$gigs = 25*1073741824; // 25 GB

$res_premote = mysql_query("SELECT id FROM users WHERE class = 1 AND uploaded >= $gigs AND (uploaded / downloaded) >= 1.0");

$time = get_date_time();

while ($arr_premote = mysql_fetch_assoc($res_premote)) {

mysql_query("UPDATE users SET class = 2 WHERE id = $arr_premote[id]");

mysql_query("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: Power User')");

}

unset($res_premote,$arr_premote);



$res_demote = mysql_query("SELECT id FROM users WHERE class = 2 AND uploaded >= $gigs AND (uploaded / downloaded) <= 1.0");

while ($arr_demote = mysql_fetch_assoc($res_demote)) {

mysql_query("UPDATE users SET class = 1 WHERE id = $arr_demote[id]");

mysql_query("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);
Unknown User
2011-10-14 03:30:26
i install the code above but

Uploaded: 24.00 GB

Downloaded: 23.00 GB

Ratio: 1.04347826087

the user rank is P.User

Uploaded: 24.00 GB

Downloaded: 26.00 GB

Ratio: 0.923076923077

the user rank is remain P.User...not demote
Unknown User
2011-10-14 14:07:19
your uploaded needs to be 25 GB
Unknown User
2011-10-14 15:32:31
i understand

i put in my test

Uploaded: 27.00 GB

Downloaded: 30.00 GB

Ratio: 0.9

and is Member from P.User

Thanks

the code is ok

$res_demote = mysql_query("SELECT id FROM users WHERE class = 2 AND uploaded >= $gigs AND (uploaded / downloaded) <= 1.0");

or

$res_demote = mysql_query("SELECT id FROM users WHERE class = 2 AND uploaded >= $gigs AND (uploaded / downloaded) < 1.0");
Unknown User
2011-10-14 16:59:02
first one is less or equal too

second one is less than
Unknown User
2011-12-12 06:36:31
"TorrentialStorm, post: 39989":
	$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

and where do i put this?
Unknown User
2011-12-12 06:53:21
Stevo in cleanup.php at the end before ?>
Unknown User
2012-10-20 07:48:21
Question deleted. All works nice. Thanke

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6148"]cleanup.php[/url]
cleanup.php
Download
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728