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
Give positive ratio and invites to new u
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

2019-01-04 15:51:48
All credits to original Authors

this is a simple mod should give new users a 2GB upload and inf. ratio to get started (which you can change in the config) so new members dont get themselves in a ratio hole that they cant get out of. Your ratio is tracked normally, this just gives you a positive ratio to get started. I also added giving invites to new users. The default is ZERO, but feel free to do as you will. Edit the config as you please
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()))).")");


Change to
     SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, last_access, age, country, gender, client, stylesheet, uploaded, downloaded, language, invites, 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["new_member_upload_ratio"], 0, $site_config["default_language"], $site_config["new_member_invites"], $signupclass, getip()))).")");


add to backend/config.php
$site_config['new_member_upload_ratio'] = 2147483648; //2147483648 = 2GB of upload and inf. ratio to help get started
$site_config['new_member_invites'] = 0 ;       // Every new user will get 0 invites to start with. Change this to whatever floats your boat. Does not affect the regular giving of invites set by you or the system
Unknown User
2019-10-30 09:44:17
[color=rgb(84, 172, 210)]Thank You[/color];)

Just curious is  5368709120 = 5GB?
2019-11-02 05:11:13
yes.  its bytes to gigabytes https://convertlive.com/u/convert/bytes/to/gigabytes#5368709120
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-11-03 10:45:58
hello Bbam90 yes is correct
into file function.php
[php]
case "gb": // GigaByte
           return $num * 1073741824;
[/php]
1073741824 x 5
2020-07-15 13:59:18
Thanks so much for this. This ratio hole is very real and it’s happening like crazy for me. Much appreciated.
2020-08-13 02:46:34
What I did (for 5GB) is have them fill out a field for their profile, if enough chars are met (we ask 160 chars) they get the bonus 5GB on signup.


// 5GB Bonus - Fill out Bio (160 char) - Check
   if (strlen($bio) >= 160) {
       $uploaded = '5368709120'; // 5GB - 5368709120 bytes
       $bonus = 'yes';
       $bonustitle = '5GB Bonus Starter';
   }else{
       $uploaded = '0'; // 0GB - 0 bytes
       $bonus = 'no';
       $bonustitle = 'Regular';
   }


$uploaded => users.uploaded
$bonus     => users.bonus_enabled (VARCHAR(160) ALLOW NULL DEFAULT 'no'.)
$bonustitle => users.bonustitle TEXT(10) ALLOW NULL DEFAULT 'Regular'.

Those 2 last are custom columns I made. strlen checks if form field has text filled in or not. Then $bio = $_POST['profilebio'] and add input name="profilebio". Fits the job well.
2020-08-13 20:27:51
Nice stuff STorrents. When I made this mod, one thing I dont think I took into consideration was having this same function occur for invited members, this (I think) is only for those who sign up. Imma have to go check that later and see if thats the case. If you or anyone else finds out that this is true and fixes it before me, let me know

*EDIT Nevermind, I appaarently did add this to invite.php
        // If username is somehow taken, keep trying
       while (mysqli_errno($GLOBALS["DBconnector"]) == 1062) {
           $username = "invite_".mksecret(20);
   //        $ret = SQL_Query_exec("INSERT INTO users (username, secret, email, status, invited_by, added, stylesheet, language) VALUES (".
   //        implode(",", array_map("sqlesc", array($username, $secret, $email, 'pending', $CURUSER["id"]))) . ",'" . get_date_time() . "', $site_config[default_theme], $site_config[default_language])");
               $ret = SQL_Query_exec("INSERT INTO users (username, secret, email, status, invited_by, added, stylesheet, uploaded, downloaded, language, invites) VALUES (".
   implode(",", array_map("sqlesc", array($username, $secret, $email, 'pending', $CURUSER["id"]))) . ",'" . get_date_time() . "', $site_config[default_theme], $site_config[new_member_upload_ratio], 0, $site_config[default_language], $site_config[new_member_invites])");
       }
       show_error_msg(T_("ERROR"), T_("DATABASE_ERROR"), 1);
   }

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