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
User Posts

Go to Profile

"walker1977, post: 44129":
add to the end of admincp.php:


#======================================================================#

# Add Users

#======================================================================#

if ($action == "adduser") {

if ($CURUSER["class"] < "8"){

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("Error", "Missing form data.");

if ($_POST["password"] != $_POST["password2"])

show_error_msg("Error", "Passwords mismatch.");

$username = sqlesc($_POST["username"]);

$password = $_POST["password"];

$email = sqlesc($_POST["email"]);

$secret = mksecret();

$passhash = sqlesc(md5($password));

$secret = sqlesc($secret);

mysql_query("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)") or die(mysql_error());

$res = mysql_query("SELECT id FROM users WHERE username=$username");

$arr = mysql_fetch_row($res);

if (!$arr)

show_error_msg("Erro", "Unable to create the account. The user name is possibly already taken.");

header("Location: /account-details.php?id=$arr[0]");

die;

}



stdhead("Add user");

navmenu();

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>Username</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>Re-type 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="Okay" class=btn></td></tr>

</table>

</form>

</div>

<?

end_frame();

stdfoot();

}

#======================================================================#

# END Add Users

#======================================================================#


For 2..06 it works great.

Only 1 little thing needs to be changed.

Find

header("Location: /account-details.php?id=$arr[0]");

replace with:

header("Location: account-details.php?id=$arr[0]");

If you don't delete the "/" then you get a blanc screen and not the new users account.
"ImYourVirus, post: 58138":
Good idea, but in action failed horribly for me, I did however borrow those little snippets to change the color and that worked fine. The reason it didn't work is because you code like mine is modified to do something different, you from the looks of it have a seed bonus and stuff added to that block, which I don't, I also have a black background and half of the stuff in that block got blacked out...
Something simpler would have been to say

find

$userdownloaded

before add

<font color=\"red\">

example

<font color=\"red\"> $userdownloaded

Mostly because I didn't really want the other text to change colors, but thanks for the insight anyways  <_<

You need to close the tag at the end.

Old

<font color=\"red\"> $userdownloaded

New

<font color=\"red\"> $userdownloaded</font>

If not all other text is red too
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728