Minor problems encountered during secondary development of discuz. I want to add a field when the user registers in discuz. The problem is that I cannot find the insert statement of discuz. What can the hero do for you? ------ Solution ------------------ modify the register. php statement in register. php. It should be behind the uc_user_register function. However, DZ seems to be a small problem that can be encountered in the secondary development of discuz in the background.
I want to add a field when the user registers in discuz. The problem is that I cannot find the insert statement of discuz. What can the hero do for you?
------ Solution --------------------
Register. php
Modify the statement in register. php.
It should be behind the uc_user_register function.
However, DZ can add custom registration items in the background.
------ Solution --------------------
$ Username = isset ($ _ G ['GP _ username'])? $ _ G ['GP _ username']: '';
$ Bbrulehash = $ bbrules? Substr (md5 (FORMHASH), 0, 8 ):'';
$ Auth = $ _ G ['GP _ auth'];
$ Invite = getinvite ();
If ($ _ G ['setting'] ['regstatus'] = 2 & empty ($ invite )){
Showmessage ('not _ open_registration_invite ');
}
Require_once libfile ('function/profile ');
If (! Submitcheck ('regsubmit ', 0, $ seccodecheck, $ secqaacheck )){
If ($ _ G ['GP _ action'] = 'activation '){
$ Auth = explode ("\ t", authcode ($ auth, 'decode '));
If (FORMHASH! = $ Auth [1]) {
Showmessage ('register _ activation_invalid', 'member. php? Mod = logging & action = login ');
}
$ Username = $ auth [0];
$ Activationauth = authcode ("$ auth [0] \ t". FORMHASH, 'encoding ');
}
$ _ G ['referer'] = isset ($ _ G ['referer'])? Dhtmlspecialchars ($ _ G ['referer']): dreferer ();
$ Fromuser =! Empty ($ fromuser )? Dhtmlspecialchars ($ fromuser ):'';
If ($ fromuid ){
$ Query = DB: query ("SELECT username FROM". DB: table ('Common _ member'). "WHERE uid = '$ fromuid '");
If (DB: num_rows ($ query )){
$ Fromuser = dhtmlspecialchars (DB: result ($ query, 0 ));
} Else {
Dsetcookie ('promotion ');
}
}
$ Bbrulestxt = nl2br ("\ n $ bbrulestxt \ n ");
If ($ _ G ['GP _ action'] = 'activation '){
$ Auth = dhtmlspecialchars ($ auth );
}
If ($ seccodecheck ){
$ Seccode = random (6, 1 );
}
If ($ _ G ['setting'] ['secqa'] ['status'] [1]) {
$ Seccode = random (1, 1) * 1000000 + substr ($ seccode,-6 );
}
$ Username = dhtmlspecialchars ($ username );
$ Htmls = $ settings = array ();
Foreach ($ _ G ['cache'] ['Fields _ required'] as $ field ){
$ Fieldid = $ field ['fieldid'];
$ Html = profile_setting ($ fieldid );
If ($ html ){
$ Settings [$ fieldid] = $ _ G ['cache'] ['profilesetting'] [$ fieldid];
$ Htmls [$ fieldid] = $ html;
}
}
Include template ('Member/register ');
} Else {
If ($ bbrules & $ bbrulehash! = $ _ POST ['agreebbrule']) {
Showmessage ('register _ rules_agree ');
}
$ Activation = array ();
If (isset ($ _ G ['GP _ activationauth ']) {
$ Activationauth = explode ("\ t", authcode ($ _ G ['GP _ activationauth '], 'decode '));
If ($ activationauth [1] = FORMHASH &&! ($ Activation = daddslashes (uc_get_user ($ activationauth [0]), 1 ))){
Showmessage ('register _ activation_invalid', 'member. php? Mod = logging & action = login ');
}
}
If (! $ Activation ){
$ Username = addslashes (trim (dstripslashes ($ username )));
If (uc_get_user ($ username )&&! DB: result_first ("SELECT uid FROM". DB: table ('Common _ member'). "WHERE username = '$ username '")){
If ($ _ G ['Ajax ']) {
Showmessage ('Profile _ username_duplicate ');
} Else {