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
autopromote problem
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2022-04-11 04:43:25
it is not autopromote when the ratio is over 1.1
$limit = 100*1024*1024*1024;

$limitdown = 50 * 1024 * 1024 * 1024;

$minratio = 1.1;

$maxdt = sqlesc(get_date_time(gmtime() - 86400*28));

$res = SQL_Query_exec("SELECT id, username FROM users WHERE class = 1 AND uploaded >= $limit AND downloaded >= $limitdown AND uploaded / downloaded >= $minratio AND added < $maxdt");

if (mysqli_num_rows($res) > 0)

{

$dt = sqlesc(get_date_time());

$msg = sqlesc("Congratulations, you have been auto-promoted from Member to Power User by System.");

while ($arr = mysqli_fetch_assoc($res))

{

SQL_Query_exec("UPDATE users SET class = 2 WHERE id = $arr[id]") ;

SQL_Query_exec("UPDATE users SET invites = invites +2 WHERE id = $arr[id]");

SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES (0, $arr[id], $dt, $msg, 0)");

write_log("User <a href=account-details.php?id=".$arr["id"].">".$arr["username"]."</a> Was automatically promoted from Member to Power User by System.");

}

}
Last edited by djlive on 2022-04-11 04:43:40
2022-04-11 14:14:20
Is Congratulations message sent, you can check in admincp/message-spy
Or search the admin log for promote

If no messages then it must be the query

Try this - see if we can narrow it down - on cleanup this will edit all so worth testing first before live site
$res = SQL_Query_exec("SELECT id, username FROM users WHERE class = 1 AND uploaded / downloaded > $minratio AND added < $maxdt");

If it doesn't work try without  AND added < $maxdt
Last edited by M-jay warn on 2022-04-11 14:25:08
2022-04-11 17:08:35
nope nothing
neither mesage and the same with that line no promote
// reedit it works without AND added < $maxdt thanx for help

Last edited by djlive on 2022-04-11 17:11:17
2022-04-11 17:21:29
Under $maxdt put this then check admin log might just need to play with date
write_log("$maxdt");
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728