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
User Posts

Go to Profile

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
"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);
"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]
"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
So looks like this is done then ? apart from style but I'm no css boff so that's up to someone else
"shadows, post: 66821, member: 20311":

I just tested. For example code "ds434dgcde83f743de4649".

1. Registered account with this code.
2. Tried again to register and got the following message  "Your invitation code ds434dgcde83f743de4649 is invalid."

So it is working well for me.

PS: I removed delete invite code option for users with class lower than moderators.

You could remove the class as no one  else can view your invite page it's set with $_GET['id'] so I'm not sure what the admin class is for tbh you can not navigate to my invite page nor I yours so only the user can delete there invite codes unless you code something in to admincp
Ah you're absolutely correct which makes my previous post redundant ignore it lol I need to get some rest lol I'm over thinking this shit ????
There's also one more bug that in the original script the user can delete the created invite and get it back then confirm the user ie infinite invites need to put a check to see if the invites in use before it can be deleted
That will not work after further testing if the invite is removed then its bypassing the invite code check in account-signup ie same code multiple sign-up because the invite code gets deleted after sign up theres never any code there to check against so the system will let you sign up with the same code over and over forever seems the original coder knew this lol
if you want it like you could remove the invite after signup is complete in account-signup.php or account-confirm

in account-signup.php find
if ($site_config["INVITEONLY"]){ //invite only is on

add under
SQL_Query_exec("DELETE FROM invites WHERE invite = ".sqlesc($invite));


untested so you will need to make sure it works
"shadows, post: 66810, member: 20311":

Can you post whole account-signup.php ?

Edit: The first part is checking if email confirm is enabled for users if invite-only is disabled, the second part is to check if email confirm is enabled when invite-only is enabled.

yeah thats what im saying email confirm and inviteonly shouldnt be on at the same time

senario you signup with invite code sucsess then you get and email to say follow this link to activate your account and you click it and bingo accounts confirmed
the email confirm will bypass the invite only confirm you will still have an invite code there which brings us back to the whole code not deleting after a user is confirmed

so set $site_config['CONFIRMEMAIL'] = false;
and $site_config['INVITEONLY'] = true;
account-signup.php

<?php
//
//  TorrentTrader v2.x
//    $LastChangedDate: 2012-01-29 09:06:37 -0600 (Sun, 29 Jan 2012) $
//      $LastChangedBy: torrenttrader $
//  
//    http://www.torrenttrader.org
//
//
require_once("backend/functions.php");
dbconn();
$site_config["LEFTNAV"] = $site_config["MIDDLENAV"] = $site_config["RIGHTNAV"] = false;

$username_length = 15; // Max username length. You shouldn't set this higher without editing the database first
$password_minlength = 6;
$password_maxlength = 40;
   //get max members, and check how many users there is
   $numsitemembers = get_row_count("users");
   if ($numsitemembers >= $site_config["maxusers"])
       show_error_msg(T_("SORRY")."...", T_("SITE_FULL_LIMIT_MSG") . number_format($site_config["maxusers"])." ".T_("SITE_FULL_LIMIT_REACHED_MSG")." ".number_format($numsitemembers)." members",1);

if ($_GET["takesignup"] == "1") {

//IP Check
if ($site_config["ipcheck"] && $site_config["accountmax"] > "0") {
$ip = $_SERVER['REMOTE_ADDR'];
$ipc = SQL_Query_exec("SELECT COUNT(ip) FROM users WHERE ip = '$ip'");
$ipq = mysqli_result($ipc, 0);
if ($ipq >= $site_config["accountmax"])
show_error_msg("Error","$site_config[SITENAME] only allows $site_config[accountmax] account per IP. If you would like to create a new account, please contact a staff member via PM or IRC.<br><br> The error was: <font color=red>maximum account count($site_config[accountmax]) exceeded for $ip($ipq), cannot proceed with signup.</font>",1);
}
//  

// Disable checks if we're signing up with an invite
if ($site_config["INVITEONLY"]){
       $invite = $_POST["invite"];
         $r = SQL_Query_exec("SELECT inviter, inviteid, confirmed FROM invites WHERE invite=".sqlesc($invite));
         $i = mysqli_fetch_assoc($r);
         if (mysqli_num_rows($r) == 0)
         show_error_msg("Error", "Invite ".htmlspecialchars($invite)." not found.\nPlease retry signup or request a new one.", 1);
         if ($i["inviteid"] != 0)
         show_error_msg("Error", "Invite ".htmlspecialchars($invite)." already taken.\nPlease request a new one with your inviter.", 1);
         }

         $message == "";

function validusername($username) {
       $allowedchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
       for ($i = 0; $i < strlen($username); ++$i)
           if (strpos($allowedchars, $username[$i]) === false)
           return false;
       return true;
}

   $wantusername = $_POST["wantusername"];
   $email = $_POST["email"];
   $wantpassword = $_POST["wantpassword"];
   $passagain = $_POST["passagain"];
   $country = $_POST["country"];
   $gender = $_POST["gender"];
   $client = $_POST["client"];
   $age = (int) $_POST["age"];

 if (empty($wantpassword) || (empty($email) && !$invite_row) || empty($wantusername))
   $message = T_("DONT_LEAVE_ANY_FIELD_BLANK");
 elseif (strlen($wantusername) > $username_length)
   $message = sprintf(T_("USERNAME_TOO_LONG"), $username_length);
 elseif ($wantpassword != $passagain)
   $message = T_("PASSWORDS_NOT_MATCH");
 elseif (strlen($wantpassword) < $password_minlength)
   $message = sprintf(T_("PASS_TOO_SHORT_2"), $password_minlength);
 elseif (strlen($wantpassword) > $password_maxlength)
   $message = sprintf(T_("PASS_TOO_LONG_2"), $password_maxlength);
 elseif ($wantpassword == $wantusername)
    $message = T_("PASS_CANT_MATCH_USERNAME");
 elseif (!validusername($wantusername))
   $message = "Invalid username.";
 elseif (!validemail($email))
       $message = "That doesn't look like a valid email address.";

   if ($message == "") {
       // Certain checks must be skipped for invites
           //check email isnt banned
           $maildomain = (substr($email, strpos($email, "@") + 1));
           $a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$email'")));
           if ($a[0] != 0)
               $message = sprintf(T_("EMAIL_ADDRESS_BANNED_S"), $email);

           $a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$maildomain'")));
           if ($a[0] != 0)
               $message = sprintf(T_("EMAIL_ADDRESS_BANNED_S"), $email);

         // check if email addy is already in use
         $a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from users where email='$email'")));
         if ($a[0] != 0)
           $message = sprintf(T_("EMAIL_ADDRESS_INUSE_S"), $email);

      //check username isnt in use
     $a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from users where username='$wantusername'")));
     if ($a[0] != 0)
       $message = sprintf(T_("USERNAME_INUSE_S"), $wantusername);

     $secret = mksecret(); //generate secret field

     $wantpassword = passhash($wantpassword);// hash the password
   }

   if ($message != "")
       show_error_msg(T_("SIGNUP_FAILED"), $message, 1);

 if ($message == "") {
 if ($site_config["CONFIRMEMAIL"]){//req confirm email true/false
               $status = "pending";
       }else{
       if ($site_config["INVITEONLY"]){
       $status = "pending";
       }else{
               $status = "confirmed";
       }
  }
   //make first member admin
   if ($numsitemembers == '0')
       $signupclass = '7';
   else
       $signupclass = '1';

  if ($site_config["INVITEONLY"]){
      $ret = SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, age, country, gender, client, stylesheet, language, class, ip, invited_by, invitedate) VALUES (" .
     implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip(), $i["inviter"], get_date_time()))).")");
  } else {
      $ret = SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, age, country, gender, client, stylesheet, language, class, ip) VALUES (" .
     implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip()))).")");
  }
   $id = mysqli_insert_id($GLOBALS["DBconnector"]);
  if ($site_config["INVITEONLY"]){
     SQL_Query_exec(" UPDATE invites SET inviteid = $id, confirmed='no' WHERE invite = " . sqlesc($invite));
  }

   $psecret = md5($secret);
   $thishost = $_SERVER["HTTP_HOST"];
   $thisdomain = preg_replace('/^www\./is', "", $thishost);

   //ADMIN CONFIRM
   if ($site_config["ACONFIRM"]) {
       $body = T_("YOUR_ACCOUNT_AT")." ".$site_config['SITENAME']." ".T_("HAS_BEEN_CREATED_YOU_WILL_HAVE_TO_WAIT")."\n\n".$site_config['SITENAME']." ".T_("ADMIN");
   }else{//NO ADMIN CONFIRM, BUT EMAIL CONFIRM
       $body = T_("YOUR_ACCOUNT_AT")." ".$site_config['SITENAME']." ".T_("HAS_BEEN_APPROVED_EMAIL")."\n\n    ".$site_config['SITEURL']."/account-confirm?id=$id&secret=$psecret\n\n".T_("HAS_BEEN_APPROVED_EMAIL_AFTER")."\n\n    ".T_("HAS_BEEN_APPROVED_EMAIL_DELETED")."\n\n".$site_config['SITENAME']." ".T_("ADMIN");
   }


 if ($site_config["CONFIRMEMAIL"] && !$site_config["INVITEONLY"]){ //email confirmation is on
//                ini_set("sendmail_from", "");
               sendmail($email, "Your ".$site_config['SITENAME']." User Account", $body, "From: ".$site_config['SITENAME']." <".$site_config['SITEEMAIL'].">");
               header("Refresh: 0; url=account-confirm-ok?type=signup&email=" . urlencode($email));
       }else{
               if ($site_config["INVITEONLY"]){ //invite only is on
               header("Refresh: 0; url=account-confirm-ok?type=invite");
               }else{
               header("Refresh: 0; url=account-confirm-ok?type=noconf");
       }
}
   //send pm to new user
   if ($site_config["WELCOMEPMON"]){
       $dt = sqlesc(get_date_time());
       $msg = sqlesc($site_config["WELCOMEPMMSG"]);
       SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $id, $dt, $msg, 0)");
   }

   die;
 }

}//end takesignup



stdhead(T_("SIGNUP"));
begin_frame(T_("SIGNUP"));
?>
<? echo ("<center><b> Cookies Must Be Enabled To Register.</cenetr></b>");?>
<br>
<?php
if ($site_config["INVITEONLY"]):
?>
<?echo ("<center><b>Site Is Invite Only You Will Need An <font color=red>Invite Code</font> To Register.</center></b>");?>
<?php endif; ?>

<form method="post" action="account-signup.php?takesignup=1">
   <?php if ($invite_row) { ?>
   <input type="hidden" name="invite" value="<?php echo $_GET["invite"]; ?>" />
   <input type="hidden" name="secret" value="<?php echo htmlspecialchars($_GET["secret"]); ?>" />
   <?php } ?>
   <table cellspacing="0" cellpadding="2" border="0">
           <tr>
               <td><?php echo T_("USERNAME"); ?>: <font class="required"><font color="#F2000">*</font></td>
               <td><input type="text" size="40" name="wantusername" /></td>
           </tr>
           <tr>
               <td><?php echo T_("PASSWORD"); ?>: <font class="required"><font color="#F2000">*</font></td>
               <td><input type="password" size="40" name="wantpassword" /></td>
           </tr>
           <tr>
               <td><?php echo T_("CONFIRM"); ?>: <font class="required"><font color="#F2000">*</font></td>
               <td><input type="password" size="40" name="passagain" /></td>
           </tr>
           <tr>
               <td><?php echo T_("EMAIL"); ?>: <font class="required"><font color="#F2000">*</font></td>
               <td><input type="text" size="40" name="email" /></td>
           </tr>
           <?php
                          if ($site_config["INVITEONLY"]):
                          ?>
                        <tr><td>Invite Code: <font class="required"><font color="#F2000">*</font></td>
                               <td><input type="text" size="60" name="invite"/></td>
                       </tr>
                        <?php endif; ?>
           <tr>
               <td><?php echo T_("AGE"); ?>:</td>
               <td><input type="text" size="40" name="age" maxlength="3" /></td>
           </tr>
           <tr>
               <td><?php echo T_("COUNTRY"); ?>:</td>
               <td>
                   <select name="country" size="1">
                       <?php
                       $countries = "<option value=\"0\">---- ".T_("NONE_SELECTED")." ----</option>\n";
                       $ct_r = SQL_Query_exec("SELECT id,name,domain from countries ORDER BY name");
                       while ($ct_a = mysqli_fetch_assoc($ct_r)) {
                           $countries .= "<option value=\"$ct_a[id]\">$ct_a[name]</option>\n";
                       }
                       ?>
                       <?php echo $countries; ?>
                   </select>
               </td>
           </tr>
           <tr>
               <td><?php echo T_("GENDER"); ?>:</td>
               <td>
                   <input type="radio" name="gender" value="Male" /><?php echo T_("MALE"); ?>
                   &nbsp;&nbsp;
                   <input type="radio" name="gender" value="Female" /><?php echo T_("FEMALE"); ?>
               </td>
           </tr>
           <tr>
               <td><?php echo T_("PREF_BITTORRENT_CLIENT"); ?>:</td>
               <td><input type="text" size="40" name="client"  maxlength="20" /></td>
           </tr>
           <tr>
               <td align="center" colspan="2">
               <input type="submit" value="<?php echo T_("SIGNUP"); ?>" />
             </td>
           </tr>
   </table>
</form>
<?php
end_frame();
stdfoot();
?>
well thats what i got in my account-signup i must of messed the file up in the archive my apologies have you added the code like i said and dose it work ?

edit:
why should it be like that you're already asking if confirm email is on. you're asking if its on twice and to set status to pending twice or am i not following you sorry :oops:

edit:2  no sorry your asking if inviteonly and confirmemail is on they both wouldnt be on at the same time thats not how the script is set up
that code should be like so i dont see  ! in your post

Quote:
@shadows  [b]if ($site_config["INVITEONLY"] [/b]instead of $site_config["INVITEONLY"] && $site_config["CONFIRMEMAIL"]


if ($site_config["CONFIRMEMAIL"] && !$site_config["INVITEONLY"]){ //email confirmation is on
//                ini_set("sendmail_from", "");
               sendmail($email, "Your ".$site_config['SITENAME']." User Account", $body, "From: ".$site_config['SITENAME']." <".$site_config['SITEEMAIL'].">");
               header("Refresh: 0; url=account-confirm-ok?type=signup&email=" . urlencode($email));
       }else{
               if ($site_config["INVITEONLY"]){ //invite only is on
               header("Refresh: 0; url=account-confirm-ok?type=invite");
               }else{
               header("Refresh: 0; url=account-confirm-ok?type=noconf");
       }
}





its saying if inviteonly is off !$site_config["INVITEONLY"]){ //email confirmation is on then use email confirm else if inviteonly
so you need to turn email confirm to false in backend/config

why email they know there signup was a sucsess becuase there told there inviter needs to confirm them so no need for email ???

as for the other mistake ill make correctiions thanks @shadow
$LANG["INVCODE_ERR"] = "Sorry you do not have any invites to generate a code!";
$LANG["SUCCESS"] = "Sign Up Succsesful Welcome To $site_config[SITENAME]";
$LANG["INVITE_DONE"] = "<b>Invite Succsesful Please Note Your Inviter Needs To Confirm Your Account Before You Can Login!<b>";
theres still loads of language to edit in the invite.php like the instructions could be moved to lang.php etc
"MicroMonkey, post: 66799, member: 311":

The ajshoutbox prolly explains why I didnt have any issues with this code. I have the ajax shitbox installed on my test box. I still removed it tho lol

Or just put it under the mysql_insert_id
Is the code getting erased after confirm now ?
Thanks
this is what you should have in there
if ($site_config["CONFIRMEMAIL"] && !$site_config["INVITEONLY"]){ //email confirmation is on
//                ini_set("sendmail_from", "");
               sendmail($email, "Your ".$site_config['SITENAME']." User Account", $body, "From: ".$site_config['SITENAME']." <".$site_config['SITEEMAIL'].">");
               header("Refresh: 0; url=account-confirm-ok?type=signup&email=" . urlencode($email));
       }else{
               if ($site_config["INVITEONLY"]){ //invite only is on
               header("Refresh: 0; url=account-confirm-ok?type=invite");
               }else{
               header("Refresh: 0; url=account-confirm-ok?type=noconf");
       }

edit: and set email confirm to false you use one or the other not both
so either inviteonly false or email confirm to false
$site_config['CONFIRMEMAIL'] = false;        //Enable / Disable Signup confirmation email

should be set  to false are you using the account-signup i posted or the v3 one ?
did you remove the @SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,NOW(), 'System', 'New User:".$wantusername." ')"); in account-signup.php
on my site its removing the created invite after you confirm the user i need [USER=311]@MicroMonkey[/USER] to test it on his end and see if its doing the same for him
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