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
2008-03-10 20:10:51
I would be great if my users could be promoted to power users if they had more than 25GB and 1.05 of ratio!!

And if ratio  drops to 0.95 the power users are demoted to users!!

Cumps
Unknown User
2008-03-11 14:18:33
ok try this the only problem i see so far is that it does not send a message to the user.

in cleanup.php find:

//REMOVE WARNING

$res1 = mysql_query("SELECT id,username FROM users WHERE warned = 'yes' AND enabled='yes' AND uploaded / downloaded >= $minratio AND downloaded >= $downloaded");



if (mysql_num_rows($res1) > 0){

$timenow = get_date_time();

$reason = "Your warning of low ratio has been removed. We highly recommend you to keep a your ratio up to not be warned again.\n";



while ($arr1 = mysql_fetch_assoc($res1)){

write_log("Auto Leech warning has been removed for: <a href=account-details.php?id=".$arr1["id"].">".$arr1["username"]."</a>");



mysql_query("UPDATE users SET warned = 'no' WHERE id = '".$arr["id"]."'");

mysql_query("UPDATE warnings SET expiry = '".$timenow."' WHERE userid = '".$arr["id"]."'");

mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES ('0', '".$arr["id"]."', '".$timenow."', '".$reason."', '0')");

}

}
add after:




// promote to power users

$res = mysql_query("SELECT id,username FROM users WHERE class = 1 AND uploaded >= $promotegigs AND downloaded >= $minratio ");

if (mysql_num_rows($res) > 0)

{

$timenow = get_date_time();

$reason = sqlesc("You have been auto-promoted from User to Power User \n");

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, poster) VALUES('0', '".$arr["id"]."', '".$timenow."', '".$reason."', '0')");

}

}





ok now open config.php and find:





$site_config["ratiowarn_daystowarn"] = 14; //Days to ban





add after:





$site_config["ratiowarn_promote"] = true; //Promote power user

 $site_config["ratiowarn_promotegigs"] = 25; //Min GB Promote




now that should be it. i know it is ratio warn but i just decided to use that part for promotion also. you can adjust the ratio where you see the minratio in the config.php also you can change the number of gigs with the promotegigs. i hope it works for you enjoy B)
Unknown User
2008-03-11 20:40:11
thanks but that didn't work!!

no users where promoted!!

and when i force cleanup it appears a error on this line

Quote:
if (mysql_num_rows($res) > 0)
Unknown User
2008-03-11 21:44:50
at first i had the same problem but with this code it solved the problem. so now i do not know what to tell you. i tested it on v2.03 and it is working.

"SpaZiuR, post: 39977":
thanks but that didn't work!!
no users where promoted!!

and when i force cleanup it appears a error on this line
Unknown User
2008-03-11 21:55:29
don't know if that is the problem but i have v2.02!
Unknown User
2008-03-11 22:00:22
it may be the problem.

"SpaZiuR, post: 39984":
don't know if that is the problem but i have v2.02!
Unknown User
2008-03-11 22:06:22
i've done force cleanup again and still the same error!!

Quote:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/spaziur/domains/*********/public_html/backend/cleanup.php on line 98
Unknown User
2008-03-12 00:44:17
	$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
Unknown User
2008-03-12 01:37:04
yep that seems to work!!
Unknown User
2008-03-12 08:38:46
thx,  TorrentialStorm!
Unknown User
2008-03-12 18:17:33
thx Tor
Unknown User
2008-06-03 13:25:33
Shouldn't $time be $timenow for the queries?
Unknown User
2008-06-03 19:51:50
"HEAT22, post: 43113":
Shouldn't $time be $timenow for the queries?


yes
Unknown User
2008-08-04 18:50:31
What if I wanted to auto-promote from class 2 to class 3 and on?
Unknown User
2008-08-06 15:38:42
"TheUnknown, post: 45169":
What if I wanted to auto-promote from class 2 to class 3 and on?


change the number in these parts class = 1
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728