Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Torrent Trader > Mods & Themes
Reply
  #1  
Old 19th July 2017, 06:06
rubaiyatfardin's Avatar
rubaiyatfardin rubaiyatfardin is offline
Member
 
Join Date: Jul 2017
Posts: 1
Default [Mod]Give users 1 Ratio Bonus when singup
8-) 8-)
yeah you saw the title right .....
Without ratio point user will not able to download anything :roll:
but there is no ratio row in table so ratio is generated using : uploaded/download(yeah upload devided by download) :roll:

And I am the original modifier of this code

So lets start
edit account-singup.php an paste this fully
Code:
<?php
//
//  TorrentTrader v2.x
//    $LastChangedDate: 2012-09-27 22:15:34 +0100 (Thu, 27 Sep 2012) $
//      
// ratio system modified by siam
//Dont remove any of this 
//
require_once("backend/functions.php");
dbconn();

$username_length = 15; // Max username length. You shouldn't set this higher without editing the database first
$password_minlength = 6;
$password_maxlength = 40;

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

    //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);
} else {
    $res = SQL_Query_exec("SELECT id FROM users WHERE id = $_REQUEST[invite] AND MD5(secret) = ".sqlesc($_REQUEST["secret"]));
    $invite_row = mysqli_fetch_assoc($res);
    if (!$invite_row) {
        show_error_msg(T_("ERROR"), T_("INVITE_ONLY_NOT_FOUND")." ".($site_config['signup_timeout']/86400)." days.", 1);
    }
}

if ($_GET["takesignup"] == "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"];
    $uploaded = (int) $_POST["1"];

  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 (!$invite_row && !validemail($email))
        $message = "That doesn't look like a valid email address.";

    if ($message == "") {
        // Certain checks must be skipped for invites
        if (!$invite_row) {
            //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 LIKE '%$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 ($invite_row) {
            SQL_Query_exec("UPDATE users SET username=".sqlesc($wantusername).", password=".sqlesc($wantpassword).", secret=".sqlesc($secret).", status='confirmed', added='".get_date_time()."' WHERE id=$invite_row[id]");
            //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, $invite_row[id], $dt, $msg, 0)");
            }
            header("Refresh: 0; url=../account-confirm-ok.php?type=confirm");
            die;
        }

    if ($site_config["CONFIRMEMAIL"]) { //req confirm email true/false
        $status = "pending";
    }else{
        $status = "confirmed";
    }

    //make first member admin
    if ($numsitemembers == '0')
        $signupclass = '7';
    else
        $signupclass = '1';

    SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, last_access, age, country, gender, client, stylesheet, language, uploaded, downloaded, 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"],1000000000,1000000000, $signupclass, getip()))).")");

    $id = ((is_null($___mysqli_res = mysqli_insert_id($GLOBALS["___mysqli_ston"]))) ? false : $___mysqli_res);

    $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.php?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"]){ //email confirmation is on
        sendmail($email, "Your $site_config[SITENAME] User Account", $body, "", "-f$site_config[SITEEMAIL]");
        header("Refresh: 0; url=../account-confirm-ok.php?type=signup&email=" . urlencode($email));
    }else{ //email confirmation is off
        header("Refresh: 0; url=../account-confirm-ok.php?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 (`id`, `sender`, `receiver`, `added`, `msg`, `unread`, `poster`, `subject`, `location`) VALUES (NULL, '0', '$id', '$dt', '$msg', //'yes', '0', '', 'in')");
    }

    die;
  }

//end takesignup



stdhead(T_("SIGNUP"));
//begin_frame(T_("SIGNUP"));
?>
<style type="text/css">

.form-signin {
  max-width: 330px;
  padding: 15px;
  margin: 0 auto;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
  margin-bottom: 10px;
}
.form-signin .checkbox {
  font-weight: normal;
}
.form-signin .form-control {
  position: relative;
  height: auto;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
  padding: 10px;
  font-size: 16px;
}
.form-signin .form-control:focus {
  z-index: 2;
}
.form-signin input[type="text"] {
  margin-bottom: -1px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
  margin-bottom: 10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
</style>
<div class="container">
<form method="post" class="form-signin" action="../register/?takesignup=1">
<h2 class="form-signin-heading">Register account?</h2>
    <?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 } ?>
    
                <label for="inputusername" class="sr-only"><?php echo T_("USERNAME"); ?></label>
                <input type="text" name="wantusername" class="form-control" placeholder="<?php echo T_("USERNAME"); ?>" required autofocus>
                    <label for="inputpassword" class="sr-only"><?php echo T_("PASSWORD"); ?></label>
                <input type="password" name="wantpassword" class="form-control" placeholder="<?php echo T_("PASSWORD"); ?>" required>
                    <label for="inputpasswordrepeat" class="sr-only"><?php echo T_("CONFIRM"); ?></label>
                <input type="password" name="passagain" class="form-control" placeholder="Repeat password" required>
                    <?php if (!$invite_row) {?>
                    <input type="email" name="email" class="form-control" placeholder="Email" required>
                    <?php } ?>
                    <input type="text" name="age" maxlength="3" class="form-control" placeholder="Age" required>
                        <select name="country" class="form-control select">
                        <?php
                        $countries = "<option value=\"0\">Location?</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>
                <div class="panel panel-default">
                                    <div class="panel-body">
                <div class="form-group">
                                        <div class="col-md-4">                                    
                                            <label class="check"><input type="radio" class="icheckbox" name="gender" value="Male" /> Male</label>
                                        </div>
                                        <div class="col-md-4">                                    
                                            <label class="check"><input type="radio" class="icheckbox" name="gender" value="Female" /> Female</label>
                                        </div> 
                    </div>
                </div>
                </div>
                <input type="text" name="clients" maxlength="20" class="form-control" placeholder="Torrent client?" required>
                <br>
                                <button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
</form>
</div>
<?php
//end_frame();
stdfoot();
?>
work Done .From now on every user that register will get 1 ratio bonus...

Now we will gonna update previously registered users with 1 bonus ratio

To do this:
go to mysql > users
execute this code
Code:
UPDATE users
SET    uploaded = '1000000000';
again execute this
Code:
UPDATE users
SET    downloaded = '1000000000';
Hell Yeah you did it :P

Last edited by Thor; 19th July 2017 at 20:47. Reason: No Introduction = No Advertising & No Seeking Donations.
Reply With Quote
  #2  
Old 19th July 2017, 15:46
fireknight's Avatar
fireknight fireknight is offline
Moderator
 
Join Date: Aug 2010
Australia
Posts: 168
Default
What the hell.

Just change the data base table for the user - change upload and download to give the right setting on singup.
Run the sql to update the existing users.

Job done - not rocket science.

Yes is could seem very daunting for a noob, but not that hard.

But then again - you are not after the simple and easy way to show people what to do.
You want to get something for your long drawn out way of doing things.

Advertise your site - or give you money.
Another scammer - praying on the noobs.
Reply With Quote
  #3  
Old 19th July 2017, 20:52
Krypto's Avatar
Krypto Krypto is offline
Retired from BVList
 
Join Date: Jan 2008
P2P
Posts: 510
Thumbs down
Quote:
Originally Posted by rubaiyatfardin View Post
Now we will gonna update previously registered users with 1 bonus ratio

To do this:
go to mysql > users
execute this code
Code:
UPDATE users
SET    uploaded = '1000000000';
again execute this
Code:
UPDATE users
SET    downloaded = '1000000000';
I strongly suggest you DO NOT execute the above, otherwise you'll have some very angry members as what that'll do is overwrite everyone's Upload/Download Ratio.
__________________
As an Admin I cannot Demote myself so, regardless of what my Userclass says, as of now I'm no longer a Member of BVList.

This Site's Reputation has been Destroyed beyond repair by certain individuals and, like recent members before me
I no longer wish to be associated with these childish tit-for-tat Posts
Reply With Quote
  #4  
Old 19th July 2017, 22:11
order's Avatar
order order is offline
Banned
 
Join Date: May 2017
Posts: 40
Default
Quote:
Originally Posted by Krypto View Post
I strongly suggest you DO NOT execute the above, otherwise you'll have some very angry members as what that'll do is overwrite everyone's Upload/Download Ratio.
Very true i was going to post this up to mate you do not need the above code from first thread at all its just a insert to db end of
Reply With Quote
Reply

Tags
bonus , modgive , ratio , singup , users

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 10:46. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2021, vBulletin Solutions Inc.