Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

关于注册页面register.php的修改

[复制链接]
拒买日本货 发表于 2005-6-24 18:19:51 | 显示全部楼层 |阅读模式
本人的论坛,在注册页面register.php添加了"只能用简体中文注册会员名字"的指令,但现在想删除它,又忘记了增加了那一些

那位高人能给予指点,好让我删除它

谢谢

:')


<?php

/*
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [DISCUZ!]  Crossday Discuz! Board                                    ::
:: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com)                ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Author:  Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
:: Version: 2.5F   2004/10/01 05:15                                     ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*/
//fix:  BY pk0909
/*
1 用户名限制的问题
*/
require './include/common.php';

$discuz_action = 5;

if($discuz_uid) {
        showmessage('login_succeed', 'index.php');
}

if(!$regstatus) {
        showmessage('register_disable');
}

$query = $db->query("SELECT * FROM $table_settings WHERE variable IN ('censoruser', 'doublee', 'bbrules', 'bbrulestxt', 'welcomemsg', 'welcomemsgtxt')");
while($setting = $db->fetch_array($query)) {
        $$setting['variable'] = $setting['value'];
}

$query = $db->query("SELECT groupid, allowcstatus, allowavatar, allowsigbbcode, allowsigimgcode, maxsigsize FROM $table_usergroups WHERE ".($regverify == 1 ? "groupid='8'" : "creditshigher<=0 AND 0<creditslower LIMIT 1"));
$groupinfo = $db->fetch_array($query);
if(!submitcheck('regsubmit')) {

        if($bbrules && !submitcheck('rulesubmit')) {
                $bbrulestxt = nl2br("\n$bbrulestxt\n\n");
        } else {

                $enctype = NULL;

                $styleselect = $dayselect = '';
                $query = $db->query("SELECT styleid, name FROM $table_styles WHERE available='1'");
                while($styleinfo = $db->fetch_array($query)) {
                        $styleselect .= '<option value="'.$styleinfo['styleid'].'">'.$styleinfo['name'].'</option>'."\n";
                }

                for($num = 1; $num <= 31; $num++) {
                        $dayselect .= '<option value="'.$num.'">'.$num.'</option>';
                }

                $bbcodeis = $groupinfo['allowsigbbcode'] ? 'On' : 'Off';
                $imgcodeis = $groupinfo['allowsigimgcode'] ? 'On' : 'Off';
                $check24 = $check12 = '';
                $timeformat == 'H:i' ? $check24 = 'checked' : $check12 = 'checked';
                $toselect = array((float)strval($_DCACHE['settings']['timeoffset']) => 'selected="selected"');

                $dateformatorig = $dateformat;
                $dateformatorig = str_replace('n', 'mm', $dateformatorig);
                $dateformatorig = str_replace('j', 'dd', $dateformatorig);
                $dateformatorig = str_replace('y', 'yy', $dateformatorig);
                $dateformatorig = str_replace('Y', 'yyyy', $dateformatorig);

        }

        include template('register');

} else {

        require DISCUZ_ROOT.'./include/discuzcode.php';

        $email = trim($email);
        $username = trim($username);
        if (!preg_match("/^[".chr(0xa1)."-".chr(0xff)."]+$/", $username)) {
                showmessage ('作为中国人,请在注册用户名时便用中文,不便之处,敬请您能愿解,谢谢!');
        }

        if(strlen($username) > 15) {
                showmessage('profile_username_toolang');
        }

        if($password != $password2) {
                showmessage('profile_passwd_notmatch');
        }


        if(preg_match("/^\s*$|^c:\\con\\con$|?|[%,\*\"\s\t\<\>\&]|^游客|^Guest/is", $username) || @preg_match('/^'.str_replace(array('\\*', ',', ' '), array('.*', '|', ''), preg_quote($censoruser, '/')).'$/i', $username)) {
                showmessage('profile_username_illegal');
        }

        if(!$password || $password != addslashes($password)) {
                showmessage('profile_passwd_illegal');
        }

        if(!isemail($email)) {
                showmessage('profile_email_illegal');
        }

        $emailadd = !$doublee ? "OR email='$email'" : '';
        $regctrladd = $regctrl ? "OR (regip='$onlineip' AND regdate>$timestamp-'$regctrl'*3600)" : '';
        $query = $db->query("SELECT username, email, regip FROM $table_members WHERE username='$username' $emailadd $regctrladd LIMIT 1");
        if($member = $db->fetch_array($query)) {
                if(addslashes($member['email']) == $email) {
                        showmessage('profile_email_duplicate');
                } elseif($regctrl && $member['regip'] == $onlineip) {
                        showmessage('register_ctrl');
                } else {
                        showmessage('profile_username_duplicate');
                }
        }

        $password = md5($password);
        $secques = quescrypt($questionid, $answer);

        $dateformatnew = str_replace('mm', 'n', $dateformatnew);
        $dateformatnew = str_replace('dd', 'j', $dateformatnew);
        $dateformatnew = str_replace('yyyy', 'Y', $dateformatnew);
        $dateformatnew = str_replace('yy', 'y', $dateformatnew);
        $timeformatnew = $timeformatnew == '24' ? 'H:i' : 'h:i A';

        $tppnew = intval($tppnew);
        $pppnew = intval($pppnew);
        $tppnew = ($tppnew > 30 || $tppnew < 0) ? 0 : $tppnew;
        $pppnew = ($pppnew > 15 || $pppnew < 0) ? 0 : $pppnew;

        $year=intval($year);$month=intval($month);$day=intval($day);
        $bday = ($month && $day && $year) ? "$year-$month-$day" : '';

        $msn = isemail($msn)? $msn : '';
        $oicq = intval($oicq) ? intval($oicq) : '';
        $icq = intval($icq) > 5000 && strlen($icq) < 16 ?intval($icq) : '';
        $yahoo = dhtmlspecialchars($yahoo);

        $site = trim(str_replace('http://', '', $site));
        $site = $site ? dhtmlspecialchars('http://'.$site) : '';

        $bio = cutstr(censor(dhtmlspecialchars($bio)),800);
        $locationnew = cutstr(censor(dhtmlspecialchars($locationnew)), 28);

        $idstring = random(6);
        $identifyingnew = $regverify == 1 ? "$timestamp\t2\t$idstring" : '';

        $db->query("INSERT INTO $table_members (username, password, secques, gender, adminid, groupid, regip, regdate, lastvisit, lastactivity, postnum, credit, email, site, icq, oicq, yahoo, msn, location, bday, bio, signature, customstatus, tpp, ppp, styleid, dateformat, timeformat, showemail, newsletter, invisible, timeoffset, identifying )
                VALUES ('$username', '$password', '$secques', '$gendernew', '0', '$groupinfo[groupid]', '$onlineip', '$timestamp', '$timestamp', '$timestamp', '0', '0', '$email', '$site', '$icq', '$oicq', '$yahoo', '$msn', '$locationnew', '$bday', '$bio', '', '', '$tppnew', '$pppnew', '$styleidnew', '$dateformatnew', '$timeformatnew', '$showemail', '$newsletter', '0', '$timeoffsetnew', '$identifyingnew' )");
        $uid = $db->insert_id();

        if($welcomemsg && !empty($welcomemsgtxt)) {
                $welcomtitle = "Welcome to $bbname!";
                $welcomemsgtxt = addslashes($welcomemsgtxt);
                $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message)
                        VALUES ('System Message', '0', '$uid', 'inbox', '1', '$welcomtitle', '$timestamp','$welcomemsgtxt')");
                $db->query("UPDATE $table_members SET newpm='1' WHERE uid='$uid'");
        }

        require DISCUZ_ROOT.'./include/cache.php';
        updatecache('settings');

        $discuz_uid = $uid;
        $discuz_user = $username;
        $discuz_userss = stripslashes($discuz_user);
        $discuz_pw = $password;
        $discuz_secques = $secques;
        $groupid = $groupinfo['groupid'];
        $styleid = $styleid ? $styleid : $_DCACHE['settings']['styleid'];

        setcookie('cookietime', 2592000, $timestamp + 86400 * 365, $cookiepath, $cookiedomain);
        setcookie('_discuz_uid', $discuz_uid, $timestamp + 2592000, $cookiepath, $cookiedomain);
        setcookie('_discuz_pw', $discuz_pw, $timestamp + 2592000, $cookiepath, $cookiedomain);
        setcookie('_discuz_secques', $discuz_secques, $timestamp + 2592000, $cookiepath, $cookiedomain);
        if($regverify == 1){
                sendmail($email, 'email_verify_subject', 'email_verify_message');
                showmessage('profile_email_verify');
        } else {
                showmessage('register_succeed', dreferer());
        }

}

?>
tomsina 发表于 2005-6-24 18:24:39 | 显示全部楼层
用原版的不就行了么?
回复

使用道具 举报

fazai168 发表于 2005-6-24 18:38:56 | 显示全部楼层
重新一下个2.5的 对照一下。。。

或者覆盖 也行。。
回复

使用道具 举报

 楼主| 拒买日本货 发表于 2005-6-24 18:54:41 | 显示全部楼层
原帖由 fazai168 于 2005-6-24 18:38 发表
重新一下个2.5的 对照一下。。。

或者覆盖 也行。。


有理!!

但能指点一下不?
回复

使用道具 举报

hxw555 发表于 2014-8-30 01:14:23 | 显示全部楼层
com/member.php?mod=register这是论坛注册时的链接

我想点击注册打开的页面时com/register.php请处理过此问题或是有高见的帮帮忙。先谢谢了

不要跳转的那种,有高手没有
回复

使用道具 举报

vhche.com 发表于 2014-8-30 07:48:25 | 显示全部楼层
技术人才啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-18 09:39 , Processed in 0.032994 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表