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

You are in: Forum / Forum / Torrent Trader / v3 Mods Requests

2022-06-09 16:53:06
Hello can you tell me the code to add on mybonus.php or ? ? to have the function vip 3 day as on this site, thank you in advance πŸ™„

https://torrenttrader.uk/bonus  
2022-06-10 04:30:05
this is what i had on v3

in mybonus.php add new case
            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` = '4', `oldclass`='$oldclass', `vipuntil` = '$vipuntil' WHERE `id` = '$CURUSER[id]'");
               break;


add sql
 ALTER TABLE users  ADD `vipuntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE users  ADD `oldclass` int(10) UNSIGNED NOT NULL DEFAULT '0';


then finally cleanup.php (to demote automatic)
    $timenow = sqlesc(get_date_time());
   $subject = sqlesc("Your VIP class stay has just expired");
   $msg = sqlesc("Your VIP class stay has just expired. \nYour status is back to baseline. \nYou can now redeem crazy bonus points for a new VIP class stay. \nYou can also donate if you wish to obtain a longer stay.\n");
   $resv = SQL_Query_exec("SELECT id, oldclass FROM users WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
if (mysqli_num_rows($resv)){
   $rowv = mysqli_fetch_object($resv);
   $id = $rowv->id;
   $oldclass = $rowv->oldclass;
   SQL_Query_exec("UPDATE users SET class = '.$oldclass.', oldclass='1', vipuntil = '0000-00-00 00:00:00' WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
   SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES(0, '.$id.', $timenow, $subject, $msg, 0)");
}
2022-06-10 16:34:53
Hello M-jay and thank you for your help I will make the changes tonight and come back to tell you if it works for me   πŸ‘  πŸ˜‰
2022-06-10 18:08:35
good evening and can you tell me if the number 86400 is in second or in minute on this part of the code ?

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




                 
Last edited by niki on 2022-06-10 18:08:49
2022-06-10 20:17:20
86400 seconds is 1 day so for 1 month 30*86400

You need to add vip to select like this is admincp
array('invite', 'traffic'


array('invite', 'traffic','vip'
2022-06-10 21:45:18
thanks for the help and can you tell me where to put this code in cleanup.php ??


$timenow = sqlesc(get_date_time());
  $subject = sqlesc("Your VIP class stay has just expired");
  $msg = sqlesc("Your VIP class stay has just expired. \nYour status is back to baseline. \nYou can now redeem crazy bonus points for a new VIP class stay. \nYou can also donate if you wish to obtain a longer stay.\n");
  $resv = SQL_Query_exec("SELECT id, oldclass FROM users WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
if (mysqli_num_rows($resv)){
  $rowv = mysqli_fetch_object($resv);
  $id = $rowv->id;
  $oldclass = $rowv->oldclass;
  SQL_Query_exec("UPDATE users SET class = '.$oldclass.', oldclass='1', vipuntil = '0000-00-00 00:00:00' WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
  SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES(0, '.$id.', $timenow, $subject, $msg, 0)");
}
2022-06-11 03:13:32
just before last ?>
2022-06-11 07:44:04
thank you but when I make the change and click on [FORCE CLEAN] in the admin cp I get an error message with this

Database Error. Please report this to an administrator.

and the error message in admin cp in the SQL error function is as follows


Database Error in backend/cleanup.php on line 270: Data truncated for column 'class' at row 143. Query was: UPDATE users SET class = '.3.', oldclass='1', vipuntil = '0000-00-00 00:00:00' WHERE vipuntil < '2022-06-11 07:40:00' AND vipuntil <> '0000-00-00 00:00:00'.




I have modified the code and works with the code below and can you tell me if updating the vip class 3 and downgrade on the class 1 member will work with the modified code as below,.

// Start Vipuntil mod vip
   $timenow = sqlesc(get_date_time());
   $subject = sqlesc("Your VIP class stay has just expired");
   $msg = sqlesc("Your VIP class stay has just expired. \nYour status is back to baseline. \nYou can now redeem crazy bonus points for a new VIP class stay. \nYou can also donate if you wish to obtain a longer stay.\n");
   $resv = SQL_Query_exec("SELECT id, oldclass FROM users WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
if (mysqli_num_rows($resv)){
   $rowv = mysqli_fetch_object($resv);
   $id = $rowv->id;
   $oldclass = $rowv->oldclass;
   SQL_Query_exec("UPDATE users SET class ='3', oldclass='1', vipuntil = '0000-00-00 00:00:00' WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
   SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES(0, '.$id.', $subject, $timenow, $msg, 0)");
}
// End Remove Vipuntil mod vip




the modify part is the one below,...

J'ai remplacΓ©
UPDATE users SET class = '.$oldclass.', oldclass='1',



with this

UPDATE users SET class ='3', oldclass='1', 

Last edited by niki on 2022-06-11 08:26:21
2022-06-11 08:38:42
should be
UPDATE users SET class ='1', oldclass='3',


in bonus page we set class vip and old class value
in cleanup we change back if time passed
2022-06-11 08:52:35
Thank you M-jay πŸ˜‰  I made the changes on the test site before transferring to the correct site and I will see if the update will be done and come back to tell you the result  
2022-06-11 10:10:55
Hi M-jay, can you tell me if the code below is correct for the vip member to automatically return to the member class after 1 day.

cleanup.php

// Start Vipuntil mod vip
   $timenow = sqlesc(get_date_time());
   $subject = sqlesc("Your VIP class stay has just expired");
   $msg = sqlesc("Your VIP class stay has just expired. \nYour status is back to baseline. \nYou can now redeem crazy bonus points for a new VIP class stay. \nYou can also donate if you wish to obtain a longer stay.\n");
   $resv = SQL_Query_exec("SELECT id, oldclass FROM users WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
if (mysqli_num_rows($resv)){
   $rowv = mysqli_fetch_object($resv);
   $id = $rowv->id;
   $oldclass = $rowv->oldclass;
   SQL_Query_exec("UPDATE users SET class ='3', oldclass='1', vipuntil = '0000-00-00 00:00:00' WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
   SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES(0, '.$id.', $subject, $timenow, $msg, 0)");
}
// End Remove Vipuntil mod vip




mybonus.php

            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 2022-06-11 10:16:00
2022-06-11 14:09:13
In cleanup should be old class
SQL_Query_exec("UPDATE users SET class ='$oldclass', oldclass='1', vipuntil = '0000-00-00 00:00:00' WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");


And I see I may have mistake on my value. Value is days value should be 1
My mistake says 3000 days lol
https://torrenttrader.uk/adminbonus

Or for test in mybonus.php change $days = 1;
2022-06-11 14:19:44
thank you M-jay I'm doing the test  πŸ˜‰
2022-06-13 04:17:01
Hello, I'm coming back to tell you that I changed a member account for the vip class on Saturday night and we are Monday and the account is still on the vip class so the vip member has not been downgraded for the member class, would you have an idea for the account to be downgraded for the member class after 1 day.

thank you in advance for your help, here is the code below   πŸ˜‰



cleanup.php

// Start Vipuntil mod vip
  $timenow = sqlesc(get_date_time());
  $subject = sqlesc("Your VIP class stay has just expired");
  $msg = sqlesc("Your VIP class stay has just expired. \nYour status is back to baseline. \nYou can now redeem crazy bonus points for a new VIP class stay. \nYou can also donate if you wish to obtain a longer stay.\n");
  $resv = SQL_Query_exec("SELECT id, oldclass FROM users WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");
if (mysqli_num_rows($resv)){
  $rowv = mysqli_fetch_object($resv);
  $id = $rowv->id;
  $oldclass = $rowv->oldclass;
SQL_Query_exec("UPDATE users SET class ='$oldclass', oldclass='1', vipuntil = '0000-00-00 00:00:00' WHERE vipuntil < $timenow AND vipuntil <> '0000-00-00 00:00:00'");SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES(0, '.$id.', $subject, $timenow, $msg, 0)");
}
// End Remove Vipuntil mod vip





mybonus.php

            case 'VIP':
               $days = $row->value;
               $vipuntil = ( $CURUSER["vipuntil"] > "0000-00-00 00:00:00" ) ? $vipuntil = get_date_time( strtotime( $CURUSER["vipuntil"] ) + ( $days*1 ) ) : $vipuntil = get_date_time( gmtime() + ( $days*1 ) );
               $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;      
               
      }


2022-06-13 19:07:07
That code looks awfully bad to read.
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