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
requète sql
Controls ·  Search New posts · Mark unread

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

2021-08-29 11:50:38
Hello to all the team, I am looking to modify this piece of code in the file mybonus.php so that when a member changes points to get a vip account, and I would like the upgrade of the ratio in download is reset to 0 on his account at the same time as his vip account when we click on update.

thank you in advance for your help


 case 'VIP':
               $days = $row->value;
               $vipuntil = ( $CURUSER["vipuntil"] > "0000-00-00 00:00:00" ) ? $vipuntil = get_date_time( strtotime( $CURUSER["vipuntil"] ) + ( $days*86400 ) ) : $vipuntil = get_date_time( gmtime() + ( $days*86400 ) );
               $oldclass = ( $CURUSER["vipuntil"] > "0000-00-00 00:00:00" ) ? $oldclass = $CURUSER["oldclass"] : $oldclass = $CURUSER["class"];
               SQL_Query_exec("UPDATE `users` SET `class` = '3', `oldclass`='$oldclass', `vipuntil` = '$vipuntil' WHERE `id` = '$CURUSER[id]'");
               break;  
}




I tried to add this piece of code below but it doesn't work

SQL_Query_exec("UPDATE `users` SET `class` = '3' WHERE `downloaded` = `0`;

Last edited by niki on 2021-08-29 13:55:11
2021-08-30 18:21:23
You could test this if I understand correctly

SQL_Query_exec("UPDATE `users` SET `class` = '3', `oldclass`='$oldclass', `downloaded` = 0, `vipuntil` = '$vipuntil' WHERE `id` = '$CURUSER[id]'");


That resets downloaded when becoming vip

Or you could temporarily reset ratio with a sql column in users old ratio you would need to need to add old ratio back in cleanup if you use method below

SQL_Query_exec("UPDATE `users` SET `class` = '3', `oldclass`='$oldclass', `downloaded` = 0, `oldratio` = $CURUSER[downloaded], `vipuntil` = '$vipuntil' WHERE `id` = '$CURUSER[id]'");


If you wish to keep download at 0 while vip we might need to edit announce  :unsure
2021-08-31 18:35:34
Hello and thank you for your help M-jay it works fine now  :thumb  :bigsmile
2021-10-17 14:40:09
Hello I come back on this modification which works well and can you tell me if it is possible to add a function to limit the duration of the class vip to 1 month when a member changes points of his seedbonus to pass to the class vip :help


case 'VIP':
              $days = $row->value;
              $vipuntil = ( $CURUSER["vipuntil"] > "0000-00-00 00:00:00" ) ? $vipuntil = get_date_time( strtotime( $CURUSER["vipuntil"] ) + ( $days*86400 ) ) : $vipuntil = get_date_time( gmtime() + ( $days*86400 ) );
              $oldclass = ( $CURUSER["vipuntil"] > "0000-00-00 00:00:00" ) ? $oldclass = $CURUSER["oldclass"] : $oldclass = $CURUSER["class"];
             SQL_Query_exec("UPDATE `users` SET `class` = '3', `oldclass`='$oldclass', `downloaded` = 0, `vipuntil` = '$vipuntil' WHERE `id` = '$CURUSER[id]'");
              break;  
}
Last edited by niki on 2021-10-17 17:13:07
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