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
Invite Code System [v3.0 Port]
Controls ·  Search New posts · Mark unread

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

Unknown User
2019-07-05 12:16:15
"shadows, post: 66823, member: 20311":

Delete option is not meant for normal users. Only staff should be able to delete their invitations and recreate those for testing purpose. That's why I removed delete option for normal users.

So how do you get to the user's invite page to delete them then ? The Id is set when the user logs in
Unknown User
2019-07-05 12:17:59
"serph, post: 66825, member: 1398":

So how do you get to the user's invite page to delete them then ?

They can't delete them so they can't abuse delete/recreate option. Once created it will stand there until they give the code to someone to use it. After the code is used it will disappear from there.

Yeah, the plugin is completed.
Unknown User
2019-07-05 12:28:18
"shadows, post: 66826, member: 20311":

They can't delete them so they can't abuse delete/recreate option. Once created it will stand there until they give the code to someone to use it. After the code is used it will disappear from there.

Yeah, the plugin is completed.

Ok I get you it's just you said only staff to delete and I was like how lol ok good were all good to go [USER=311]@MicroMonkey[/USER]
Unknown User
2019-07-05 14:46:43
"serph, post: 66827, member: 1398":

Ok I get you it's just you said only staff to delete and I was like how lol ok good were all good to go [USER=311]@MicroMonkey[/USER]

[USER=1398]@serph[/USER] and [USER=311]@MicroMonkey[/USER] do you maybe know how to tweak backend/cleanup.php file so it gives to every user who is registered more than 1 month 2 invites? Without the need to have upload/download and ratio.

This is the code
// Invite update function (Author: TorrentialStorm)
function autoinvites($interval, $minlimit, $maxlimit, $minratio, $invites, $maxinvites) {
   $time = gmtime() - ($interval*86400);
   $minlimit = $minlimit*1024*1024*1024;
   $maxlimit = $maxlimit*1024*1024*1024;
   $res = SQL_Query_exec("SELECT id, username, class, invites FROM users WHERE enabled = 'yes' AND status = 'confirmed' AND downloaded >= $minlimit AND downloaded < $maxlimit AND uploaded / downloaded >= $minratio AND warned = 'no' AND UNIX_TIMESTAMP(invitedate) <= $time");
   if (mysqli_num_rows($res) > 0) {
       while ($arr = mysqli_fetch_assoc($res)) {
           $maxninvites = $maxinvites[$arr['class']];
           if ($arr['invites'] >= $maxninvites)
               continue;
           if (($maxninvites-$arr['invites']) < $invites)
               $invites = $maxninvites - $arr['invites'];

           SQL_Query_exec("UPDATE users SET invites = invites+$invites, invitedate = NOW() WHERE id=$arr[id]");
           write_log("Gave $invites invites to '$arr[username]' - Class: ".get_user_class_name($arr['class'])."");
       }
   }
}


Along with this


   // START INVITES UPDATE
   // SET INVITE AMOUNTS ACCORDING TO RATIO/GIGS ETC
   // autoinvites(interval to give invites (days), min downloaded GB, max downloaded GB, min ratio, invites to give, max invites allowed (array))
   // $maxinvites[CLASS ID] = max # of invites;
   $maxinvites[1] = 5;   // User
   $maxinvites[2] = 10;  // Power User
   $maxinvites[3] = 20;  // VIP
   $maxinvites[4] = 25;  // Uploader
   $maxinvites[5] = 100; // Moderator
   $maxinvites[6] = 100; // Super Moderator
   $maxinvites[7] = 400; // Administrator

   // Give 1 invite every 21 days to users with > 1GB downloaded AND < 4GB downloaded AND ratio > 0.50
   autoinvites(21, 1, 4, 0.50, 1, $maxinvites);
   autoinvites(14, 1, 4, 0.90, 2, $maxinvites);
   autoinvites(14, 4, 7, 0.95, 2, $maxinvites);

   $maxinvites[1] = 7; // User
   autoinvites(14, 7, 10, 1.00, 3, $maxinvites);

   $maxinvites[1] = 10; // User
   autoinvites(14, 10, 100000, 1.05, 4, $maxinvites);
   //END INVITES
Unknown User
2019-07-05 15:23:24
"shadows, post: 66828, member: 20311":

[USER=1398]@serph[/USER] and [USER=311]@MicroMonkey[/USER] do you maybe know how to tweak backend/cleanup.php file so it gives to every user who is registered more than 1 month 2 invites? Without the need to have upload/download and ratio.

This is the code
// Invite update function (Author: TorrentialStorm)
function autoinvites($interval, $minlimit, $maxlimit, $minratio, $invites, $maxinvites) {
   $time = gmtime() - ($interval*86400);
   $minlimit = $minlimit*1024*1024*1024;
   $maxlimit = $maxlimit*1024*1024*1024;
   $res = SQL_Query_exec("SELECT id, username, class, invites FROM users WHERE enabled = 'yes' AND status = 'confirmed' AND downloaded >= $minlimit AND downloaded < $maxlimit AND uploaded / downloaded >= $minratio AND warned = 'no' AND UNIX_TIMESTAMP(invitedate) <= $time");
   if (mysqli_num_rows($res) > 0) {
       while ($arr = mysqli_fetch_assoc($res)) {
           $maxninvites = $maxinvites[$arr['class']];
           if ($arr['invites'] >= $maxninvites)
               continue;
           if (($maxninvites-$arr['invites']) < $invites)
               $invites = $maxninvites - $arr['invites'];

           SQL_Query_exec("UPDATE users SET invites = invites+$invites, invitedate = NOW() WHERE id=$arr[id]");
           write_log("Gave $invites invites to '$arr[username]' - Class: ".get_user_class_name($arr['class'])."");
       }
   }
}


Along with this


   // START INVITES UPDATE
   // SET INVITE AMOUNTS ACCORDING TO RATIO/GIGS ETC
   // autoinvites(interval to give invites (days), min downloaded GB, max downloaded GB, min ratio, invites to give, max invites allowed (array))
   // $maxinvites[CLASS ID] = max # of invites;
   $maxinvites[1] = 5;   // User
   $maxinvites[2] = 10;  // Power User
   $maxinvites[3] = 20;  // VIP
   $maxinvites[4] = 25;  // Uploader
   $maxinvites[5] = 100; // Moderator
   $maxinvites[6] = 100; // Super Moderator
   $maxinvites[7] = 400; // Administrator

   // Give 1 invite every 21 days to users with > 1GB downloaded AND < 4GB downloaded AND ratio > 0.50
   autoinvites(21, 1, 4, 0.50, 1, $maxinvites);
   autoinvites(14, 1, 4, 0.90, 2, $maxinvites);
   autoinvites(14, 4, 7, 0.95, 2, $maxinvites);

   $maxinvites[1] = 7; // User
   autoinvites(14, 7, 10, 1.00, 3, $maxinvites);

   $maxinvites[1] = 10; // User
   autoinvites(14, 10, 100000, 1.05, 4, $maxinvites);
   //END INVITES


somthing like this maybe untested no idea if it would work
autoinvites(30, 0, 0, 0.0,  2, $maxinvites);
Unknown User
2019-07-05 15:24:37
"serph, post: 66830, member: 1398":

somthing like this maybe untested no idea if it would work
autoinvites(30, 0, 0, 0.0,  2, $maxinvites);


I'm curious about this interval what does this do

    $minlimit = $minlimit*1024*1024*1024;
   $maxlimit = $maxlimit*1024*1024*1024;
Unknown User
2019-07-05 15:27:12
thats not going to work the code i posted that would give 2 invites to users with no ratio no download
as for the above code no idea its probably from version 1 torrentelstrom stopped working on TT from 2.05 i think
and tbh i forgot that was in there

edit: you can do what your asking for but as for how no idea lol
2019-07-05 18:29:03
Do you want me to move this to mods completed? Are all the files updated? Will also need the sql edits that go along with it. Can you update the post with those also? Or just create a new post. That works also. Nice job BTW.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Unknown User
2019-07-05 19:01:25
Ill get all files together and post it later tonight in mods complete
2021-01-27 22:18:55
it is possible to add the deletion of the list of invited members, to avoid infinite scrolling! LOL thanks.
2021-11-09 23:02:54
ok,  rĂ©ponse here >> https://torrenttrader.uk/topic?topicid=10363

thanks M-Jay
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