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

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

Unknown User
2019-07-05 21:32:14
FIRST OFF BACKUP ALL YOU'RE FILES BEFORE ATTEMPTING THIS

Now add invites & users sql into database

CREATE TABLE `invites` (

 `id` int(10) unsigned NOT NULL auto_increment,

 `inviter` int(10) unsigned NOT NULL default '0',

 `inviteid` int(10) NOT NULL default '0',

 `invite` varchar(32) NOT NULL default '',

 `time_invited` datetime NOT NULL default '0000-00-00 00:00:00',

 `confirmed` char(3) NOT NULL default 'no',

 PRIMARY KEY  (`id`),

 KEY `inviter` (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;


And now the users sql

ALTER TABLE `users` ADD `invited_by` int(10) NOT NULL default '0';

ALTER TABLE `users` ADD  `invites` smallint(4) NOT NULL default '0';


For all those with modded account-signup.php follow below instructions
for all those with stock account-signup.php just add all the files in the zip
[color=rgb(184, 49, 47)]FOR THOSE WHO HAVE MODDED ACCOUNT-SIGNUP DO NOT ADD THE ONE IN THE ZIP[/color]

Now open up account-signup.php find and remove/comment out


//invite only check

if ($site_config["INVITEONLY"]){
show_error_msg("Invite only", "<br><br><center>Sorry this site has disabled user registration, the only way to register is via a invite from a existing member.<br><br></center>",1);
}


Now find in account-signup.php

// Disable checks if we're signing up with an invite
if (!is_valid_id($_REQUEST["invite"]) || strlen($_REQUEST["secret"]) != 32) {
   //invite only check
   if ($site_config["INVITEONLY"]) {
       show_error_msg(T_("INVITE_ONLY"), "<br /><br /><center>".T_("INVITE_ONLY_MSG")."<br /><br /></center>",1);
   }

Replace with


// 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 == "";

Now Find
if ($site_config["CONFIRMEMAIL"]){//req confirm email true/false

   $status = "pending";

   }else{

   $status = "confirmed";

   }


   Replace with

if ($site_config["CONFIRMEMAIL"]){//req confirm email true/false

   $status = "pending";

   }else{

   if ($site_config["INVITEONLY"]){

   $status = "pending";

   }else{

   $status = "confirmed";

   }

  }


  Still in account-signup.php
 
  find


 

 SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, last_access, age, country, gender, client, stylesheet, language, class, ip) VALUES (" .
     implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip()))).")");


 Replace with

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


     Now find

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

       }


       Replace with

 
if ($site_config["CONFIRMEMAIL"]){ //email confirmation is on

       ini_set("sendmail_from", "");

       mail($email, "Your ".$site_config['SITENAME']." User Account", $body, "From: ".$site_config['SITENAME']." <".$site_config['SITEEMAIL'].">");

       header("Refresh: 0; url=account-confirm-ok.php?type=signup&email=" . urlencode($email));

       }else{

       if ($site_config["INVITEONLY"]){ //invite only is on
       SQL_Query_exec("DELETE FROM invites WHERE invite = ".sqlesc($invite));
       header("Refresh: 0; url=account-confirm-ok.php?type=invite");

       }else{

       header("Refresh: 0; url=account-confirm-ok.php?type=noconf");

       }
     }


     Find

     

       <?php echo T_("COOKIES"); ?>
     


     Replace with

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

       
       Now find

       
 <td>Email: <font class="small"><font color="#FF0000">*</font></td>

               <td><input type="text" size="40" name="email"/></td>

               </tr>

              <tr>


       Underneath add

 
<?php
             if ($site_config["INVITEONLY"]):
             ?>
            <td>Invite Code: <font class="small"><font color="#FF0000">*</font></td>
            <td><input type="text" size="40" name="invite"/></td>
            </tr>
            <tr>
            <?php endif; ?>


            Save and close account-signup.php

            upload all files in attached zip to the root of your website just the php files not the invite folder ive added the hack were on signup invited user gets 2 gig upload and the person who invited gets 2 gig upload if you do not wish to have this hack please open up takeconfirm.php and remove thease lines

           
SQL_Query_exec("UPDATE users SET uploaded='2150000000' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND uploaded='0'"); 
            $result = SQL_Query_exec("SELECT * from users WHERE username = '".$CURUSER['username']."'");
            while ($row = mysqli_fetch_array($result)){ $old_upload_value = $row['uploaded'] + 2150000000; }
            SQL_Query_exec("UPDATE users SET uploaded='$old_upload_value' WHERE username = '".$CURUSER['username']."'");

  Add to languages/english.php


//INVITES
$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>";


In account.php find[/b]


<?php print("<a href='mailbox.php'><b>".T_("YOUR_MESSAGES")."</b></a>");?>


underneath add


&nbsp;|&nbsp;
<?php print("<a href='invite.php'><b>".T_("INVITES")."</b></a>");?>



for this to work
in backend/config set
$site_config['INVITEONLY'] = true;  
$site_config['CONFIRMEMAIL'] = false;
invite.zip
Download
2019-11-01 17:26:34
Dear [USER=1398]@serph[/USER] , when applying this mod to the 3.0 code the following raises questions >>

Point 1)

Both the fields appear to be there already from the install SQL code of TT3, be it with slightly different default values


`invited_by` int(10) NOT NULL default '0',
`invitees` varchar(100) NOT NULL default '',
`invites` smallint(5) NOT NULL default '0',


Should the values be changed to the values of this mod?


Code:
ALTER TABLE `users` ADD `invited_by` int(10) NOT NULL default '0';
ALTER TABLE `users` ADD  `invites` smallint(4) NOT NULL default '0';


Point 2)

The file account-confirm-ok.php from the zip file is from 2.08 still and has the following code which is not present in the 3.0 file:

elseif ($type == "invite") {
stdhead("User invite");
        show_error_msg(T_("SUCCESS"), T_("INVITE_DONE"), 1);
stdfoot();


See also the image attached here >>

[ATTACH type="full" alt="5223"]5223[/ATTACH]

Should this code be added to the 3.0 file?

Point 3)

In the mod, it is asked to look for the following code and replace it >>

ret = SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, age, country, gender, client, stylesheet, language, class, 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, $i["inviter"],get_date_time()))).")");
     $id = mysqli_insert_id($GLOBALS["DBconnector"]);


This code is by default not present in the account-signup.php file. The code that resembles it closest is the following >>

    SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, last_access, age, country, gender, client, stylesheet, language, class, ip) VALUES (" .
     implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip()))).")");

   $id = mysqli_insert_id($GLOBALS["DBconnector"]);


Would we have to replace this code?

Point 4)

Should we overwrite the invite.php file which comes with the default TT3 code, with the one provided in the ZIP file?

My files are for the most still default TT3 files.
Invite Code1.JPG
Invite Code1.JPG

If It Ain't Dutch, It Ain't Much!!
Unknown User
2019-11-07 02:34:10
I'll take a look at this tomorrow Frank sorry been away on holiday tbh this was converted using my 2.08 version for v3 so figured some things could have been missed the others who installed didn't give any feed back so thanks
Unknown User
2019-11-08 07:03:08
are you using a fresh install of v3 ? if so all the files in the zip should work fine if you drop and replace if not then as for your questions

1, the sql if you already have it sould work ok no need to change anythng

2, needs to be added to tell the invited user there signup is a success

3, ive changed that part of the code in the post it was wrong place please start over there were a couple of missplaced code

4, yes unless you plan on using the old version of invites without code then backup the old invites before overwiting

any problems ill help if i can  (y)
2019-11-08 17:21:48
Thanks for checking and for confirming some of my assumptions.
If It Ain't Dutch, It Ain't Much!!
2019-11-09 14:40:06
small error line #14 in file takeinvite

Big thanks serph (y)
2019-11-14 11:56:22
hello serph

at my house it does not work, after registration it has no 2G0 add to their ratio

SQL_Query_exec("UPDATE users SET uploaded='2150000000' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND uploaded='0'");
$result = SQL_Query_exec("SELECT * from users WHERE username = '".$CURUSER['username']."'");
while ($row = mysqli_fetch_array($result)){ $old_upload_value = $row['uploaded'] + 2150000000; }
SQL_Query_exec("UPDATE users SET uploaded='$old_upload_value' WHERE username = '".$CURUSER['username']."'");

thanks (y)
Unknown User
2019-11-16 19:57:20
you need to confirm the user before they get 2GB upload credit
2019-11-16 20:24:23
"serph, post: 67500, member: 1398":

you need to confirm the user before they get 2GB upload credit

I know it, for that I write to you, it does not marceh and likewise the sending of the MP does not function
Unknown User
2019-11-16 21:12:03
Can you zip up you're files I'll need to try and recreate you're error on my dev site I'm going to say it's a mod conflict becuase I just installed this on a fresh v3 and I dont have any issues
2019-11-17 12:46:49
"serph, post: 67503, member: 1398":

Can you zip up you're files I'll need to try and recreate you're error on my dev site I'm going to say it's a mod conflict becuase I just installed this on a fresh v3 and I dont have any issues

ok  thanks !
Unknown User
2019-11-17 16:38:11
erm i just tested you're files you zipped in takeconfirm you have commented out the add 2gig option ie

<?php
require_once("backend/functions.php");
dbconn();
$id = (int) $_GET["id"];
if (!@count($_POST['conusr'])) autolink("invite.php", "Nothing Selected.");
SQL_Query_exec("UPDATE invites SET confirmed='yes' WHERE inviteid IN (" . implode(", ", $_POST['conusr']) . ") AND confirmed='no'");
SQL_Query_exec("UPDATE users SET status = 'confirmed' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND status='pending'");
//SQL_Query_exec("UPDATE users SET uploaded='2150000000' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND uploaded='0'");
//$result = SQL_Query_exec("SELECT * from users WHERE username = '".$CURUSER['username']."'");
//while ($row = mysqli_fetch_array($result)){ $old_upload_value = $row['uploaded'] + 2150000000; }
//SQL_Query_exec("UPDATE users SET uploaded='$old_upload_value' WHERE username = '".$CURUSER['username']."'");
header("Refresh: 0; url=invite.php?id=$id");
?>


when i change it back it adds the 2gig on being confirmed

<?php
require_once("backend/functions.php");
dbconn();
$id = (int) $_GET["id"];
if (!@count($_POST['conusr'])) autolink("invite.php", "Nothing Selected.");
SQL_Query_exec("UPDATE invites SET confirmed='yes' WHERE inviteid IN (" . implode(", ", $_POST['conusr']) . ") AND confirmed='no'");
SQL_Query_exec("UPDATE users SET status = 'confirmed' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND status='pending'");
SQL_Query_exec("UPDATE users SET uploaded='2150000000' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND uploaded='0'");
$result = SQL_Query_exec("SELECT * from users WHERE username = '".$CURUSER['username']."'");
while ($row = mysqli_fetch_array($result)){ $old_upload_value = $row['uploaded'] + 2150000000; }
SQL_Query_exec("UPDATE users SET uploaded='$old_upload_value' WHERE username = '".$CURUSER['username']."'");
header("Refresh: 0; url=invite.php?id=$id");
?>

so its a mod conflict on you're end  that i cannot debug you will have to go thourgh your logs or debug thourgh firefox console or similar
if i can be of anymore help just shout but you're files are working on my dev site ?
2019-11-17 17:54:25
in writing is from me seen who did not walk had disabled, but I will look at the browser.
thank you.
2019-12-26 14:51:47
Here is the list of your sort invitations that you will place in the place you want ?

Link:
<a href=invitetree.php>".T_("INVITE_TREE")."</a>

lang :
$LANG["INVITE_TREE"] = "My Guests Compilations ";


Example!..
[ATTACH type="full" width="637px" alt="5313"]5313[/ATTACH]
invitetree.rar
Download
invit tree.JPG
invit tree.JPG

2019-12-27 18:00:22
To not have the "confirm" column empty when you have no validation to do, make this correction:

In[color=rgb(251, 160, 38)] invite.php[/color] look for :

if ($CURUSER['id'] == $id || $CURUSER['id'] >= 7)
print("<td align=center class=table_head><b>Confirm</b></td>");


Replace for :

if ($CURUSER['id'] == $id || $CURUSER['id'] >= 7)
if ($arr['status'] == 'pending')    
print("<td align=center class=$class table_head title=Confirm ?></td>");

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