首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

对discuz二次开发遇到的小疑点

2012-12-30 
对discuz二次开发遇到的小问题。我想在discuz中用户注册的时候再加一个字段,现在的问题是我找不到discuz的

对discuz二次开发遇到的小问题。
我想在discuz中用户注册的时候再加一个字段,现在的问题是我找不到discuz的插入语句哦。那位大侠帮忙指点一下呢?
[解决办法]
register.php

语句在register.php里改。
应该在uc_user_register函数后面。

但DZ好象是可以在后台就可以加自定义注册项的。
[解决办法]
$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, 'ENCODE');
}

$_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\n");
if($_G['gp_action'] == 'activation') {
$auth = dhtmlspecialchars($auth);
}

if($seccodecheck) {
$seccode = random(6, 1);
}
if($_G['setting']['secqaa']['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['inajax']) {
showmessage('profile_username_duplicate');
} else {


showmessage('register_activation_message', 'member.php?mod=logging&action=login', array('username' => $username));
}
}

if($_G['gp_password'] !== $_G['gp_password2']) {
showmessage('profile_passwd_notmatch');
}

if(!$_G['gp_password'] 
[解决办法]
 $_G['gp_password'] != addslashes($_G['gp_password'])) {
showmessage('profile_passwd_illegal');
}

$email = trim($_G['gp_email']);
$password = $_G['gp_password'];

}

$censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '
[解决办法]
', ''), preg_quote(($_G['setting']['censoruser'] = trim($_G['setting']['censoruser'])), '/')).')$/i';

if($_G['setting']['censoruser'] && @preg_match($censorexp, $username)) {
showmessage('profile_username_protect');
}

$profile = $verifyarr = array();
foreach($_G['cache']['fields_required'] as $field) {
$field_key = $field['fieldid'];
$field_val = $_G['gp_'.$field_key];
if(!profile_check($field_key, $field_val)) {
showmessage('profile_required_info_invalid');
}
if($field['needverify']) {
$verifyarr[$field_key] = $field_val;
} else {
$profile[$field_key] = $field_val;
}
}

热点排行