Korea, Republic of
|
I introduce a useful magic that user can change ID although I don't know the author.
Upload magic_rename.php into source/class/magic folder below code.
and upload two gif file into static/image/magic folder.
- <?php
- /**
- * by Quote
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- class magic_rename {
- var $version = '1.0';
- var $name = 'Rename Card';
- var $description = 'You can change your user name';
- var $price = '20';
- var $weight = '20';
- var $useevent = 1;
- var $targetgroupperm = false;
- var $copyright = '<a href="http://www.lkong.net" target="_blank">copyright</a>';
- var $magic = array();
- var $parameters = array();
- function getsetting(&$magic) {
- }
- function setsetting(&$magicnew, &$parameters) {
- }
- function usesubmit() {
- global $_G;
- if(empty($_G['gp_newusername'])) {
- showmessage("You did not enter a new user!");
- }
- $newusername = trim($_G['gp_newusername']);
- if(strlen($newusername) < 3) {
- showmessage('A new user is too short');
- }
- if(strlen($newusername) > 15) {
- showmessage('A new user name is too long');
- }
- $guestexp = '\xA1\xA1|\xAC\xA3|^Guest|^\xD3\xCE\xBF\xCD|\xB9\x43\xAB\xC8';
- $censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($censoruser = trim($censoruser)), '/')).')$/i';
- if(preg_match("/^\s*$|^c:\\con\\con$|[%,\*"\s\t\<\>\&]|$guestexp/is", $newusername) || ($censoruser && @preg_match($censorexp, $newusername))) {
- showmessage('profile_username_illegal');
- }
- $query = DB::query("SELECT uid FROM ".DB::table('ucenter_members')." WHERE username ='$newusername'");
- if(DB::num_rows($query)) {
- showmessage('This username is already taken!');
- } else {
- $tables = array(
- 'ucenter_members' => array('id' => 'uid', 'name' => 'username'),
- 'common_block' => array('id' => 'uid', 'name' => 'username'),
- 'common_invite' => array('id' => 'fuid', 'name' => 'fusername'),
- 'common_member' => array('id' => 'uid', 'name' => 'username'),
- 'common_member_security' => array('id' => 'uid', 'name' => 'username'),
- 'common_mytask' => array('id' => 'uid', 'name' => 'username'),
- 'common_report' => array('id' => 'uid', 'name' => 'username'),
- 'forum_thread' => array('id' => 'authorid', 'name' => 'author'),
- 'forum_post' => array('id' => 'authorid', 'name' => 'author'),
- 'forum_activityapply' => array('id' => 'uid', 'name' => 'username'),
- 'forum_groupuser' => array('id' => 'uid', 'name' => 'username'),
- 'forum_pollvoter' => array('id' => 'uid', 'name' => 'username'),
- 'forum_postcomment' => array('id' => 'authorid', 'name' => 'author'),
- 'forum_ratelog' => array('id' => 'uid', 'name' => 'username'),
- 'home_album' => array('id' => 'uid', 'name' => 'username'),
- 'home_blog' => array('id' => 'uid', 'name' => 'username'),
- 'home_clickuser' => array('id' => 'uid', 'name' => 'username'),
- 'home_docomment' => array('id' => 'uid', 'name' => 'username'),
- 'home_doing' => array('id' => 'uid', 'name' => 'username'),
- 'home_feed' => array('id' => 'uid', 'name' => 'username'),
- 'home_feed_app' => array('id' => 'uid', 'name' => 'username'),
- 'home_friend' => array('id' => 'fuid', 'name' => 'fusername'),
- 'home_friend_request' => array('id' => 'fuid', 'name' => 'fusername'),
- 'home_notification' => array('id' => 'authorid', 'name' => 'author'),
- 'home_pic' => array('id' => 'uid', 'name' => 'username'),
- 'home_poke' => array('id' => 'fromuid', 'name' => 'fromusername'),
- 'home_share' => array('id' => 'uid', 'name' => 'username'),
- 'home_show' => array('id' => 'uid', 'name' => 'username'),
- 'home_specialuser' => array('id' => 'uid', 'name' => 'username'),
- 'home_visitor' => array('id' => 'vuid', 'name' => 'vusername'),
- 'portal_article_title' => array('id' => 'uid', 'name' => 'username'),
- 'portal_comment' => array('id' => 'uid', 'name' => 'username'),
- 'portal_topic' => array('id' => 'uid', 'name' => 'username'),
- 'portal_topic_pic' => array('id' => 'uid', 'name' => 'username'),
- );
- foreach($tables as $table => $conf) {
- DB::query("UPDATE ".DB::table($table)." SET `$conf[name]`='$newusername' WHERE `$conf[id]`='$_G[uid]'");
- }
- usemagic($this->magic['magicid'], $this->magic['num']);
- updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'uid', $_G['uid']);
- showmessage('Successful in changing the username!', dreferer(), array(), array('showdialog' => 1, 'locationtime' => 1));
- }
- }
- function show() {
- magicshowtype('top');
- magicshowsetting("Please enter your user name:", 'newusername','', 'text');
- magicshowtype('bottom');
- }
- }
- ?>
Copy the Code
|
This post contains more resources
You have to Login for download or view attachment(s). No Account? Register
x
|