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
2009-02-05 19:39:59
Hello
Name Nick change in staff in all users and pm notice
Create file and put in the root site

namechanger.php

<?php
require_once("backend/functions.php");
dbconn(false);
loggedinonly();
if (get_user_class() < 7)
hacker_dork("Name Changer - Nosey Cunt !");

$act = unesc($_GET['act']);
if (isset($act) && $act == 'change')
{
$uid = $uid = (int)$_POST["uid"];
$uname = sqlesc($_POST["uname"]);

if ($_POST["uname"] == "" || $_POST["uid"] == "")
stderr("Error", "UserName or ID missing");

$change = mysql_query("UPDATE users SET username=$uname WHERE id=$uid") or sqlerr(__FILE__, __LINE__);
//mysql_affected_rows($change);

$added = sqlesc(get_date_time());
$changed = sqlesc("Your Username Has Been Changed To $uname");

if (!$change) {
if (mysql_errno() == 1062)
bark("Username already exists!");
bark("borked");
}

mysql_query("INSERT INTO messages (sender, receiver, msg, added) VALUES(0, $uid, $changed, $added)") or sqlerr(__FILE__, __LINE__);

//header('Location: '.$BASEURL.'/userdetails.php?id='.$uid);
}

stdhead("UserName Changer");

?>
<h1>Change UserName</h1>
<form method=post action="namechanger.php?act=change">
<table border=1 cellspacing=0 cellpadding=3>
<tr><td class=rowhead>ID: </td><td><input type=text name=uid size=10></td></tr>
<tr><td class=rowhead>New Username: </td><td><input type=uploaded name=uname size=20></td></tr>
<tr><td colspan=2 align=center>If You Are Sure Then: <input type=submit value="Change Name!" class=btn></td></tr>
</table>
</form>
<?

stdfoot();

?>
And put the admin cp link

<td align="center"><a href="namechanger.php"<img src="images/admin/mail.gif" border="0" width="32" height="32"><br>Nick name change</a><BR></td>

Working 100%

[size=14px]UPDATE[/size]
Unknown User
2009-02-05 19:58:43
nice job but error with link in admincp

this is the correct link in admincp

<td align="center"><a href=namechanger.php ><img src=images/admin/mail.gif border=0 width=32 height=32><BR>Nick name change</a><BR></td>
Unknown User
2009-02-05 20:10:03
this is not a torrent trader 2 mod
Unknown User
2009-02-05 20:12:04
put this code in admincp

<td align="center"><a href=namechanger.php><img src="images/admin/faqstaff.png" border=0 width=32 height=32><br>Nick name change</a></td>

and code working with torrent trader 2 try it
Unknown User
2009-02-05 20:31:18
it wont work correctly because of

where the userdetails.php is

replace

header('Location: '.$BASEURL.'/userdetails.php?id='.$uid);
with




header('Location: '.$site_config[SITEURL].'/account-details.php?id='.$uid);





replace





bark





with





show_error_msg



and no not working for me
Unknown User
2009-02-05 20:34:51
thanks djhowarth and me working full 100%...try it put your ID and nick and check your profile (nick)
Unknown User
2009-02-05 21:16:02
+1 DJ not write for v2 and need to be corrected

$BASEURL
is for v1, in v2 must be
$site_config[SITEURL]

bark("....","....")

is for v1, in v2 must be

show_error_msg(".....","......",1)

get_user_class() < 7

should be

$CURUSER["class"] < 7





function



hacker_dork()
is not in v2

not complete mod, need some corrections, but good code  :D

Thanks for it
Unknown User
2009-02-05 21:23:59
Good code, but this way is better:

edit admincp.php

Put this code where you want the link appear:

<td align="center"><a href=admincp.php?action=nick_change><img src="images/admin/changenick.gif" border=0 width=32 height=32><br>Change NickName</a><BR></td>
Find:


if ($action=="avatars"){

stdhead("Avatar Log");

navmenu();





Add before:



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

# 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=\"java script: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>

  <?

  end_frame();

stdfoot();

}



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

}

///////////////////////////////////////////END CODE CHANGE NICKNAME//////////////////////////////////////////////////



Upload attached file to your root directory.

Screen:



[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=3489"]userfind_to_nick.php[/url]
userfind_to_nick.php
Download
Unknown User
2009-02-05 21:57:56
i tested the orignal code in v2.05 and it works well...
Unknown User
2009-02-07 19:31:01
2.04, dosnt pop out
Unknown User
2009-02-08 11:29:09
"daffy, post: 53416":
2.04, dosnt pop out

with 2.02 works fine!

But with 2.05 same problem whats daffy.
Unknown User
2009-02-08 13:09:48
remove space in java script in admincp part

<a href=\"java script:popusers('userfind_to_nick.php');\">Find a NickName</a>");
little error in userfind_to_nick


<div vlign="bottom">



change to



<div valign="bottom">



works fine in v2.05, thanks nightmare ;)
Unknown User
2009-02-08 14:26:31
lol i make a typoooo
Unknown User
2009-02-08 14:48:34
now it
Unknown User
2009-02-08 14:56:55
Yep is the forum protection system, it don't like the word JavaScript ;)
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728