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
Name Nick change in staff in all users a
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2012-07-13 22:46:21
merci cela fonctionne

thank's
Unknown User
2012-07-23 14:08:55
I think my way is very easy:

find in account-details.php



print("<tr><td>".T_("TITLE").": </td><td align='left'><input type='text' size='67' name='title' value="$user[title]" /></td></tr>n");

add before




print("<tr><td class=tableb>Username &auml;ndern</td><td colspan=2 class=tablea align=left><input type=text size=60 name=username value="" . htmlspecialchars($user[username]) . ""></tr>n");






find in account-modtask.php





if ($action == 'edituser')




add

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





find in account-modtask.php





SQL_Query_exec("UPDATE users SET email='$email', title=$title, downloaded='$downloaded', uploaded='$uploaded', signature=$signature, avatar=$avatar, ip=$ip, donated=$donated, forumbanned=$forumbanned, downloadbanned='$downloadbanned', warned=$warned, modcomment=$modcomment, enabled=$enabled, invites=$invites, seedbonus=$seedbonus WHERE id=$userid");





before email='$email',

add username='$username',
Unknown User
2012-07-23 15:38:55
"Woodstock, post: 84325":
I think my way is very easy:

find in account-details.php



print("<tr><td>".T_("TITLE").": </td><td align='left'><input type='text' size='67' name='title' value="$user[title]" /></td></tr>n");

add before




print("<tr><td class=tableb>Username &auml;ndern</td><td colspan=2 class=tablea align=left><input type=text size=60 name=username value="" . htmlspecialchars($user[username]) . ""></tr>n");






find in account-modtask.php





if ($action == 'edituser')




add

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





find in account-modtask.php





SQL_Query_exec("UPDATE users SET email='$email', title=$title, downloaded='$downloaded', uploaded='$uploaded', signature=$signature, avatar=$avatar, ip=$ip, donated=$donated, forumbanned=$forumbanned, downloadbanned='$downloadbanned', warned=$warned, modcomment=$modcomment, enabled=$enabled, invites=$invites, seedbonus=$seedbonus WHERE id=$userid");








before email='$email',

add username='$username',





You should really check that the username doesn't exist... on account-login look at this







If there multiple users with the same username then it will end up that one of those users cannot login.



  $res = SQL_Query_exec("SELECT id, password, secret, status, enabled FROM users WHERE username = " . sqlesc($_POST["username"]) . "");

Unknown User
2012-07-23 18:01:35
It works fine without checking the username for double entries. If the username exist the name will not be changed.
Unknown User
2012-07-23 18:13:28
well you should have in index like



username UNIQUE 22154 username


but again its still better of to check to make sure the username dont exist 1st lol, most staff should have enought common sense to check to see if the username is avail but its still nice to be forced to in the code.
Unknown User
2012-07-23 18:24:45
Well assuming you haven't dropped the unique from username then yes the username wont be changed but i still say by not checking the username is wrong, on a normal mysql_query that would of returned an error but in TT duplicate key errors are suppressed... it may be fine for you but if your going to go by the same principles all way through TT then your going to be repeating yourself telling moderators "if it already exists it wont update" if i send this to your application testuser's then its going to break out of the single quotes you should use sqlesc and lastly where is validusername? TT only allows ^a-z0-9 so u could use -_ in your username, you may think your smart but don't get a head of your self.
Unknown User
2013-01-15 14:15:06
"ArcticWolf, post: 84159":
not tried this version.. i got an custom 1 i use inside account-details, before people ask no its not avail..

but anyway looks like $reciever is not defined in 2.08 due to no global vars.

changing this in admincp should work in thery





if($do == "change_username")

{

stdhead();

navmenu();

if ($CURUSER["edit_users"]!="yes")

show_error_msg("STOP", "you Cannot access this function");

begin_frame("Changes have been successful");

$current_username = $receiver;

$new_username=$_POST['new_username'];

$q = mysql_query("UPDATE users SET username = '$new_username' WHERE username = '$current_username'");

echo '<b> Changes have been successful</b>';



end_frame();

stdfoot();

}



to






if($do == "change_username")

{

stdhead();

navmenu();

if ($CURUSER["edit_users"]!="yes")

show_error_msg("STOP", "you Cannot access this function",1);

begin_frame("Changes have been successful");

$current_username = $_POST['receiver'];

$new_username=$_POST['new_username'];

$q = SQL_Query_exec("UPDATE users SET username = '$new_username' WHERE username = '$current_username'");

if ($q)

echo '<b> Changes have been successful, User: '.$current_username.' is now '.$new_username.'</b>';

else

echo '<b> Changes <font size=1 face=Verdana color=red>not</font> been successful</b>';

end_frame();

stdfoot();

}





side note lol no idea why people changes like this dont need an modcomment.. but what ever lol

works like a charm many thax
Unknown User
2013-01-29 23:35:34
thanks!
2013-02-02 04:41:25
Thanks you!

   <td align="center"><a href="admincp.php?action=nick_change"><img src="images/admin/nick.png" border="0" width="32" height="32">

<?php echo T_("CHANGE_NICKNAME"); ?></a>

</td>


Add Langue:

English

$LANG["CHANGE_NICKNAME"] = "Change Nick";

French

$LANG["CHANGE_NICKNAME"] = "Changer Pseudo";

nick.png
nick.png

Unknown User
2013-02-03 23:26:21
"Tiloup, post: 88597":
Thanks you!

 <td align="center"><a href="admincp.php?action=nick_change"><img src="images/admin/nick.png" border="0" width="32" height="32">

<?php echo T_("CHANGE_NICKNAME"); ?></a>

</td>


Add Langue:

English

$LANG["CHANGE_NICKNAME"] = "Change Nick";

French

$LANG["CHANGE_NICKNAME"] = "Changer Pseudo";

Did you want to post full code for admincp.?
Unknown User
2013-02-04 00:18:30
[No message]
2013-02-04 02:18:17
"zamunda, post: 88627":
Did you want to post full code for admincp.?

yes...

"ArcticWolf, post: 88628":

Unknown User
2013-06-10 03:59:37


[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6774"]admincp.php[/url]
admincp.php
Download
Unknown User
2013-06-15 11:36:29
Yo Tiloup

    <td align="center"><a href="admincp.php?action=nick_change"><img src="images/admin/nick.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("CHANGE_NICKNAME"); ?><br /></a></td>
Unknown User
2013-06-16 03:06:08
Hello i need help me

#======================================================================#
# Nick Name Change
#======================================================================#

if($action == "nick_change")
{
stdhead();
navmenu();
if ($CURUSER["edit_users"]!="yes")
show_error_msg("STOP", "You cannot acces this function");
if (!isset($_GET['what'])) $_GET['what'] = '';
begin_frame("Change Nick Name");
?>
<script type="text/javascript">
<!--

var newwindow;
function popusers(url)
{
newwindow=window.open(url,'popusers','height=70,width=400');
if (window.focus) {newwindow.focus()}
}

// -->
</script>
<form method=post name=edit action=admincp.php>
<input type='hidden' name='sid' value='<?=$sid?>'>
<input type='hidden' name='action' value='sql'>
<input type='hidden' name='do' value='change_username'>
<table border=0 cellspacing=0 cellpadding=5>
<?
print("<tr><td>Nick:</td>");
print("<td>");
if (!$receiver){
print("<input type="text" name="receiver"
value="".($_GET["what"]!="new" ? unesc($result["poster"]):urldecode($_GET["to"]))."" size="40" ".($_GET["what"]!="new" ? "READONLY" : "")." />&nbsp;&nbsp;
<a href="javascript:popusers('userfind_to_nick.php');">Find a NickName</a>");
}
else{
?>
<input type=text name=receiver value="<?=$receiver?>" READONLY>
<?
}
?>
   <tr>
       <td>New Nickname:</td>
       <td><input name='new_username' type='text' id="new_username" size='20' maxlength='20'></td>
   </tr>
   <tr>
       <td colspan='2' align='center'><input type='submit' value='Make changes'>
        </td>
        </tr>
     </form>
   </table>
   <p>
<?php
end_frame();
stdfoot();
}

if($do == "change_username")
{
stdhead();
navmenu();
if ($CURUSER["edit_users"]!="yes")
show_error_msg("STOP", "you Cannot access this function",1);
begin_frame("Changes have been successful");
$current_username = $_POST['receiver'];
$new_username=$_POST['new_username'];
$q = SQL_Query_exec("UPDATE users SET username = '$new_username' WHERE username = '$current_username'");
if ($q)
   echo '<b> Changes have been successful, User: '.$current_username.' is now '.$new_username.'</b>';
else
   echo '<b> Changes <font size=1 face=Verdana color=red>not</font> been successful</b>';
end_frame();
stdfoot();
}

#======================================================================#
# End code change Nick Name
#======================================================================#


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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728