欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2022-05-16 18:30:10
...
对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 {
对discuz二次开发遇到的小疑点

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频