I created this stupid thing, and Im sure it will work on TTv3
this is a simple mod and 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
Change to
add to backend/config.php
invite.php will look like this
this is a simple mod and 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 systeminvite.php will look like this
$secret = mksecret();
$username = "invite_".mksecret(20);
$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])");
if (!$ret) {
// 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, 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)
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)
Last edited by MicroMonkey on 2021-05-07 22:36:24
