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

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

2021-02-13 18:05:18
link in admincp.php
<td align="center"><a href="admincp.php?action=adduser"><img src="images/admin/adduser.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("ADDUSER"); ?></a><br /></td>

before last ?> add
#======================================================================#
# Add Users
#======================================================================#
if ($action == "adduser") {
if ($CURUSER["class"] < "7") {
       show_error_msg("Error", "Sorry you do not have the rights to view this page!", 1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
   if ($_POST["username"] == "" || $_POST["password"] == "" || $_POST["email"] == "")
       show_error_msg(T_("ERROR"), T_("DONT_LEAVE_ANY_FIELD_BLANK"),1);
   if ($_POST["password"] != $_POST["password2"])
       show_error_msg(T_("ERROR"), T_("PASSWORDS_NOT_MATCH"),1);
       $username = sqlesc($_POST["username"]);
       $password = $_POST["password"];
       $email = sqlesc($_POST["email"]);
       $secret = mksecret();
       $passhash = sqlesc(passhash($password)); // hash the password
       $secret = sqlesc($secret);
       SQL_Query_exec("INSERT INTO users (downloaded, uploaded, invites, added, last_access, secret, username, password, status, email) VALUES($site_config[new_member_upload_ratio], 0, $site_config[new_member_invites], NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");
       $res = SQL_Query_exec("SELECT id FROM users WHERE username=$username");
       $arr = mysqli_fetch_row($res);
if (!$arr)
       show_error_msg(T_("ERROR"), "Unable to create the account. The user name is possibly already taken.",1);
  //     header("Location: account-details.php?id=$arr[0]");
autolink ("account-details.php?id=$arr[0]", "<b><font color='#ff0000'> Account Created...Directing to details page</font></b>");
       die;
}

stdhead("Add user");
begin_frame();
?>
<div align=center>
<h1>Add User</h1>
<form method=post action=admincp.php?action=adduser>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead>Name</td><td><input type=text name=username size=40></td></tr>
<tr><td class=rowhead>Password</td><td><input type=password name=password size=40></td></tr>
<tr><td class=rowhead>Retype password</td><td><input type=password name=password2 size=40></td></tr>
<tr><td class=rowhead>E-mail</td><td><input type=text name=email size=40></td></tr>
<tr><td colspan=2 align=center><input type=submit value="Create" class=btn></td></tr>

</table>
</form>
</div>
<?php
end_frame();
navmenu();
stdfoot();
}
#======================================================================#
# END Add Users
#======================================================================#

in config.php, add
$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.

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)
Last edited by MicroMonkey on 2021-11-12 22:39:29
2021-02-13 18:12:43
Thanks for a fast answer mate


PS
Thanks button on this forum don't work properly


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2021-02-13 18:23:02
2021-02-13 20:26:27
heres an image you can use if you dont have one
adduser.png
File missing

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)
2021-02-14 21:16:16
Something is wrong, dont know what but error comming up after addition of new user

Database Error in admincp.php on line 4837: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' 0, , NOW(), NOW(), 'Nujrtma3jx3SO61Twtf8', 'newuser', '2827e92d0d3558ef15bbdf07...' at line 1. Query was: INSERT INTO users (downloaded, uploaded, invites, added, last_access, secret, username, password, status, email) VALUES(, 0, , NOW(), NOW(), 'Nujrtma3jx3SO61Twtf8', 'newuser', '2827e92d0d3558ef15bbdf076e3518f9e95348c4', 'confirmed', 'newuser@mypage.xyz').


Line 4837:        SQL_Query_exec("INSERT INTO users (downloaded, uploaded, invites, added, last_access, secret, username, password, status, email) VALUES($site_config[new_member_upload_ratio], 0, $site_config[new_member_invites], NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Last edited by Botanicar on 2021-02-14 21:23:09
2021-02-15 20:29:36
try this, mine has a few extra fields that get added to my database
SQL_Query_exec("INSERT INTO users ( added, last_access, secret, username, password, status, email) VALUES( NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");

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)
2021-02-15 21:14:46
This two values cant be approved to implement on database, if I change them to "0" (null/zero) I can make a new user, otherwise is not possible

$site_config[new_member_upload_ratio]
$site_config[new_member_invites]

little bit a confused


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-02-15 21:30:57
hmm, ok, seems we are on different pages. MY config.php has this
$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.

so if you add that, it should work? Since I am unable to know if you used that code in your site
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)
2021-02-15 21:39:50
found the original post here https://torrenttrader.uk/topic?topicid=9818
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)
2021-02-15 21:40:33
also found the mod I thossed together for ratio stuff here https://torrenttrader.uk/topic?topicid=9732
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)
Last edited by MicroMonkey on 2021-11-12 22:37:29
2021-02-16 09:29:01
Yea, my config.php missed that part of configuration:

$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.


and that working now,
one BIG thanks mate


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-11-12 22:40:40
first post fixed
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)
2024-05-03 04:20:25
Just added this and it seems to work nicely.
However, I noticed a change that had to make...
This line...
SQL_Query_exec("INSERT INTO users (downloaded, uploaded, invites, added, last_access, secret, username, password, status, email) VALUES($site_config[new_member_upload_ratio], 0, $site_config[new_member_invites], NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");


should read...
SQL_Query_exec("INSERT INTO users (downloaded, uploaded, invites, added, last_access, secret, username, password, status, email) VALUES(0, $site_config[new_member_upload_ratio], $site_config[new_member_invites], NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");


Originally, it was putting 2GB in the 'download' table...but should be in the 'upload' table.
Last edited by Obiwan on 2024-05-03 04:22:17
2024-05-14 14:05:47
Thankssssss
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