<!--<?php print <<<EOT
-->
<style type="text/css">
.Correct{background:#e6ffe6 url($imgpath/post/register/register.png) 5px 3px no-repeat;border:1px solid #00a8ff;margin-left:5px;color:#008800;padding:2px 8px 2px 22px;}
.Wrong{background:#fff2e9 url($imgpath/post/register/register.png) 5px -78px no-repeat;border:1px solid #ff6600;margin-left:5px;color:#8b2b34;padding:2px 8px 2px 22px;}
.Exp{background:#e2f5ff url($imgpath/post/register/register.png) 5px -133px no-repeat;border:1px solid #00a8ff;margin-left:5px;color:#006699;padding:2px 8px 2px 22px;}
.t{margin-top:8px;border:4px solid $forumcolortwo;}
.t table tr td{padding:.8em 0 .8em 3em;}
.t table tr th{text-align:right;font-weight:normal;}
.t table{border:2px solid $tablecolor;}
.t .h{padding-left:1em;}
</style>

<div class="bdbA">
	<div id="breadcrumbs">
		<a class="crumbs-item gray3" href="$db_bfn" title="$db_bbsname">$db_bbsname</a><span class="crumbs-item current"><i> </i><strong>注册</strong></span>
	</div>
</div>
<!--
EOT;
if(!GetGP('step','P') && $rg_reg){print <<<EOT
-->
<form action="$db_registerfile?method=full" method="post" onSubmit="this.regsubmit.disabled=true;">
	<input type="hidden" name="step" value="1" />
	<input type="hidden" value="$forward" name="forward" />
	<input type="hidden" value="$invcode" name="invcode" />
	<div class="t f_one">
		<table width="100%" cellspacing="0" cellpadding="6" style="TABLE-LAYOUT: fixed;WORD-WRAP: break-word">
			<tr>
				<th class="h" style="text-align:left;">注册</th>
			</tr>
			<tr>
	<th style="text-align:left;padding:1em 1.5em 0;line-height:20px;">
					<pre>$rg_rgpermit</pre>
				</td>
			</tr>
			<tr><td><div class="tac">
		<input class="btn" name="regsubmit" type="submit" value="同 意" />
        <input class="btn" type="button" onclick="javascript:history.go(-1);" value="取消" />
	</div>
	</td></tr>
		</table>
	</div>
</form>
<!--
EOT;
}elseif(GetGP('step','P')==1 || !$rg_reg && GetGP('step','P')!=2){print <<<EOT
-->
<form action="$db_registerfile?" method="post" name="register" onSubmit="return checkAll();">
	<div class="t f_one">
		<table width="100%" cellspacing="0" cellpadding="0" align="center">
			<tr><th class="h"><b>必填信息</b></th><th class="h">&nbsp;</th></tr>
<!--
EOT;
if($db_gdcheck & 1){print <<<EOT
-->
			<tr>
				<th width="30%">认证码<font color="red">*</font></th>
				<td>
					<input class="input" type="text" id="gdcode" name="gdcode" size="6" onclick="try{opencode('menu_gd',this)}catch(e){}" /><span style="cursor:pointer; margin-left:3px" onclick="this.previousSibling.focus();">点此显示验证码</span>&nbsp;<span id="gdcode_info"></span>
					<div class="menu" id="menu_gd" style="visibility:hidden;"><img src="ck.php?" align="absmiddle" style="cursor:pointer;" id="ckcode" alt="看不清楚，换一张" /></div>
				</td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
			<tr>
				<th width="30%"> 用户名<font color="red">*</font></th>
				<td>
				    <input class="input" type="text" size="20" maxlength="$rg_regmaxname" name="regname" id="regname" />&nbsp;<span class="span" id="regname_info"></span>
				</td>
			</tr>
			<tr>
				<th> 密&#160;&#160;码<font color="red">*</font></th>
				<td style="vertical-align:middle">
					<input class="input" type="password" size="20" maxlength="$rg_regmaxpwd" name="regpwd" id="regpwd" onKeyUp="CreateRatePasswdReq(this,'$rg_regminname');" />&nbsp;<span id="pwd_info"></span></td>
			</tr>
		    <tr><th>密码强度
					</th><td><div class="fl" style="width:132px;margin-right:1em;">
						<table id="passwdBar" cellSpacing="0" cellPadding="0" border="0" width="132" style="border:0px;margin-top:7px;">
							<tbody>
								<tr>
									<td id="posBar" style="width:0px;padding:0;border-right:0;height:4px;background:#e5e9eb;"></td>
									<td id="negBar" style="padding:0;border-right:0;height:4px;background:#e5e9eb;"></td>					
								</tr>
							</tbody>
						</table>
					</div ><span id="passwdRating" class="fl" style="height:20px;line-height:20px;"></span></td></tr>
				
			<tr>
				<th> 确认密码<font color="red">*</font></th>
				<td>
					<input class="input" type="password" size="20" maxlength="75" name="regpwdrepeat" id="regpwdrepeat" />&nbsp;<span id="pwdrepeat_info"></span>
				</td>
			</tr>
			<tr>
				<th> Email<font color="red">*</font>
<!--
EOT;
if($rg_email){print <<<EOT
-->
					<div style="overflow:hidden;margin:4px auto">为避免无法收取论坛邮件，请使用以下邮箱进行注册：<br>($rg_email)</div>
<!--
EOT;
}print <<<EOT
	-->
				</th>
				<td>
					<input class="input" type="text" size="20" maxlength="75" name="regemail" value="" id="regemail"/>&nbsp;<span id="email_info"></span>
				</td>
			</tr>
<!--
EOT;
if($inv_open){print <<<EOT
-->
			<tr>
				<th> 邀请注册码<font color="red">*</font>
<!--
EOT;
if($inv_price){print <<<EOT
-->
					&nbsp;<a href="hack.php?H_name=invite&action=pay">获取邀请码</a>
<!--
EOT;
}print <<<EOT
-->
				</th>
				<td>
					<input class="input" type="text" value="$invcode" name="invcode" id="invcode" />&nbsp;<span id="invcode_info"></span>
				</td>
			</tr>
<!--
EOT;
}if($regq && $db_question){
$qkey = array_rand($db_question);
print <<<EOT
-->
			<tr>
				<th> 论坛防恶意注册<font color="red">*</font></th>
				<td>
					<input class="input" type="text" name="qanswer" id="qanswer" />&nbsp;<span id="qanswer_info"></span>
					<input type="hidden" id="qkey" name="qkey" value="$qkey" />
				</td>
			</tr>
<!--
EOT;
}if($rg_ifcheck){print <<<EOT
-->
			<tr>
				<th> 注册原因<font color="red">*</font></th>
				<td>
					<textarea name="regreason" rows="4" cols="50"></textarea>
				</td>
			</tr>
<!--
EOT;
}if($customfield){
$fields = array();
print <<<EOT
-->
			<tr><th class="s3"><b>附加信息</b></th><td>&nbsp;</td></tr>
<!--
EOT;
foreach($customfield as $key=>$val){
$field="field_".(int)$val[id];
$fieldinfo = $field."_info";
$required=$val[required]?'<font color="red">*</font>':'';
$editable=(!$userdb[$field]||$val[editable])?'':'disabled';
!$val[editable] && $val[descrip] .='(请认真填写该栏信息，填写后将不允许修改)';
if($val[type]=='1'){
if($val[required]){
$fields[] = array('field'=>$field,'type'=>'text','descrip'=>$val[descrip]);
}
$field_type="<input class=\"input\" type=\"text\" size=\"30\" name=\"$field\" id=\"$field\" />";
}elseif($val[type]=='2'){
if($val[required]){
$fields[] = array('field'=>$field,'type'=>'textarea','descrip'=>$val[descrip]);
}
$field_type="<textarea name=\"$field\" id=\"$field\" rows=\"5\" cols=\"50\"></textarea>";
}elseif($val[type]=='3'){
$field_type="<select name=\"$field\" id=\"$field\">";
$options=explode("\n",$val[options]);
foreach($options as $k=>$v){
list($k,$v)=explode('=',$v);
$field_type.="<option value=\"$k\">$v</option>";
}$field_type.="</select>";
}print <<<EOT
-->
			<tr>
				<th>$val[title] {$required}</th>
				<td>{$field_type} &nbsp;<span id="$fieldinfo">
<!--
EOT;
if(!$val[required]){print <<<EOT
-->
				$val[descrip]
<!--
EOT;
}print <<<EOT
-->	
				</span></td>
			</tr>
<!--
EOT;
}}print <<<EOT
-->
			
<!--
EOT;
if($db_ifsafecv){print <<<EOT
-->
			<tr>
				<th>安全问题</th>
				<td>
					<select name="question" onchange="showcustomquest(this.value)" style="width:130px">
						<option value="0">无安全问题</option>
<option value="1">我爸爸的出生地</option>
<option value="2">我妈妈的出生地</option>
<option value="3">我的小学校名</option>
<option value="4">我的中学校名</option>
<option value="5">我最喜欢的运动</option>
<option value="6">我最喜欢的歌曲</option>
<option value="7">我最喜欢的电影</option>
<option value="8">我最喜欢的颜色</option>
<option value="-1">自定义问题</option>
					</select>
					<input id="customquest" style="display:none" type="text" name="customquest" class="input"> <span class="gray">如果启用了安全问题，需要填写正确的答案才能登录论坛</span>
				</td>
			</tr>
			<tr>
				<th>您的答案</th>
				<td><input type="text" name="answer" class="input" id="answer"></td>
			</tr>
<!--
EOT;
}if($custominfo){
print <<<EOT
-->
			<tr><th class="s3"><b>选填信息</b></th><td>&nbsp;</td></tr>
<!--
EOT;
foreach($custominfo as $key=>$val){
if(substr($val[3],0,1)=='1'){print <<<EOT
-->
			<tr>
				<th>$val[0]</th>
				<td><input class="input" type="text" size="20" name="customdata[$key]" value="" /> $val[1]</td>
			</tr>
<!--
EOT;
}}}if($rg_regdetail){print <<<EOT
	-->
			<tr>
				<th>QQ</th>
				<td>
					<input class="input" type="text" size="20" maxlength="14" name="regoicq" value="" />
				</td>
			</tr>
			<tr>
				<th> 个人主页</th>
				<td>
					<input class="input" type="text" size="20" maxlength="75" name="reghomepage" value="" />
				</td>
			</tr>
			<tr>
				<th> 来自</th>
				<td><input class="input" type="text" size="20" maxlength="20" name="regfrom" /></td>
			</tr>
			<tr>
				<th> 性别</th>
				<td>
					<select name="regsex">
						<option value="1">男</option>
						<option value="2">女</option>
						<option value="0" selected>保密</option>
					</select>
				</td>
			</tr>
			<tr>
				<th> 生日</th>
				<td>
					<select name="regbirthyear">
						<option value=""></option>
<!--
EOT;
for($i=$rg_timestart;$i<=$rg_timeend;$i++){print <<<EOT
-->
						<option value="$i">$i</option>
<!--
EOT;
}print <<<EOT
-->
					</select>年
					<select name="regbirthmonth">
						<option value=""></option>
<!--
EOT;
for($i=1;$i<=12;$i++){print <<<EOT
-->
						<option value="$i">$i</option>
<!--
EOT;
}print <<<EOT
	-->
					</select>月
					<select name="regbirthday">
						<option value=""></option>
<!--
EOT;
for($i=1;$i<=31;$i++){print <<<EOT
-->
						<option value="$i">$i</option>
<!--
EOT;
}print <<<EOT
	-->
					</select>日</font>
				</td>
			</tr>
			<tr>
				<th> 选择您的头像<br /></th>
				<td>
<style type="text/css">
.face{margin:0;padding:0;background:#fff}
.face img{border:1px solid #ccc;margin:.1em;cursor:pointer}
</style>
					<div style="float:left;margin-right:8%;">
						<img src="$imgpath/face/none.gif" name="useravatars" />
						<a id="profile" style="cursor:pointer" onclick="sendmsg('pw_ajax.php','action=showface',this.id);" title="头像列表"><b>[头像列表]</b></a>
					</div>
					<input type="hidden" name="regicon" value="$iconarray[0]" />
				</td>
			</tr>
<script language="JavaScript">
	var stylepath='$stylepath';
</script>
			<tr>
				<th>个性化签名<br> 将附在每篇文章后</th>
				<td><textarea cols="50" name="regsign" rows="4"></textarea></td>
			</tr>
			<tr>
				<th> 自我简介</th>
				<td><textarea name="regintroduce" rows="4" cols="50"></textarea></td>
			</tr>
			<tr>
				<th> 公开邮箱 </th>
				<td>
					<input type="radio" name="regemailtoall" value="1" checked /> 是
					<input type="radio" name="regemailtoall" value="0" /> 否
				</td>
			</tr>
			<tr>
				<th> 是否接受系统邮件</th>
				<td>
					<input type="radio" name="regifemail" value="1" checked /> 是
					<input type="radio" name="regifemail" value="0" /> 否
				</td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
<tr><th></th><td><input type="hidden" value="$forward" name="forward" />
	<input type="hidden" value="2" name="step" />
		<input class="btn" type="submit" name="regsubmit" value="提 交" />
</td></tr>
		</table>
	</div>
	
</form>
<script type="text/javascript" language="JavaScript" src="js/pw_register.js"></script>
<script type="text/javascript" language="JavaScript" src="js/passwordstrength.js"></script>
<script language="JavaScript">
var charset = '$db_charset';
var retminname	= parseInt('$rg_regminname');
var regmaxname	= parseInt('$rg_regmaxname');
var rglower		= parseInt('$rg_rglower');
var regminpwd 	= parseInt('$rg_regminpwd');
var regmaxpwd 	= parseInt('$rg_regmaxpwd');
var regnpdifferf= parseInt('$rg_npdifferf');
var regemail	= parseInt('$rg_emailcheck');
document.getElementById('pwd_info').innerHTML = '';
document.getElementById('pwdrepeat_info').innerHTML = '';
var inticlass 	= "Exp";
var rightclass	= "Correct";
var falseclass	= "Wrong";

var pwdcomplex	= '$rg_pwdcomplex';
var extracheck	= new Array();
var regInfo 	= new Array();

regInfo[0] 		= new Array(
						"恭喜您，该用户名还未被注册，您可以使用这个用户名注册！",
						"用户名长度错误！",
						"此用户名包含不可接受字符或被管理员屏蔽,请选择其它用户名",
						"为了避免论坛用户名混乱,用户名中禁止使用大写字母,请使用小写字母",
						"用户名已经被注册，请选用其他用户名。" ,
						"用户名不能为空！",
						"不能有空格，可以是中文，长度控制在 "+retminname+"-"+regmaxname+" 字节以内 " + (rglower?"区分大小写":"不区分大小写"));
var regname 	= new Element("regname",regInfo[0],"regname_info");

regInfo[1] 		= new Array(
						"填写正确。",
						"密码设置错误。密码中必须包含小写字母。",
						"密码设置错误。密码中必须包含大写字母。",
						"密码设置错误。密码中必须包含数字。",
						"密码设置错误。密码中必须包含符号。",
						"密码设置错误。密码长度过小。",
						"密码设置错误。密码过长。",
						"密码设置错误。密码不允许和用户名相同。",
						"密码设置错误。密码不允以下字符：\\ & ' \" ! / * , < > % # ?。",
						"不允许注册帐号与密码相同。",
                        getPwdRule());
var regpwd 		= new Element("regpwd",regInfo[1],"pwd_info");

regInfo[2] 		= new Array(
						"填写正确。",
						"两次输入的密码不一致。请再输入一次您上面输入的密码。",
						"请再输入一遍您上面填写的密码");
var regpwdrepeat= new Element("regpwdrepeat",regInfo[2],"pwdrepeat_info");

regInfo[3] 		= new Array(
						"填写正确。",
						"您的填写有误。",
						"该邮箱已被注册，请更换别邮箱。",
						"请填写真实并且最常用的邮箱。"+(regemail?"我们需要通过邮箱对您进行认证。":""));
var regemail 	= new Element("regemail",regInfo[3],"email_info");

if(parseInt("$db_gdcheck")&1){
	regInfo[4] 	= new Array(
						"填写正确。",
						"验证码不正确。",
						"登陆已超时,请刷新验证码。",
						"请输入验证码。"	);
	var gdcode 	= new Element("regemail",regInfo[4],"gdcode_info");
}
if(getObj('qkey')){
	regInfo[5] 	= new Array(
						"填写正确。",
						"验证答案错误。",
						"请输入答案：$db_question[$qkey]"	);
	var qanswer = new Element("qanswer",regInfo[5],"qanswer_info");
}
if(parseInt("$inv_open")==1){
	regInfo[6] 	= new Array(
						"填写正确。",
						"邀请码不能为空。",
						"邀请码错误。",
						"本站开启邀请注册,请填写邀请码!"	);
	var invcode = new Element("invcode",regInfo[6],"invcode_info");
}

function getPwdRule(){
	var intiString 	= "";
	if(regminpwd){
		intiString 	+= "最小长度："+regminpwd+" ";
	}
	if(regmaxpwd){
		intiString 	+= "最大长度："+regmaxpwd+" ";
	}
	if(regnpdifferf){
		intiString	+= "密码不能与用户名相同。";
	}
	if(!pwdcomplex){
		return intiString;
	}
	var addString 	= "密码里必须包含以下字符类型：";
	var rule = pwdcomplex.split(',');
	for(var i=0;i<rule.length;i++){
		switch(Number(rule[i])){
			case 1:
				addString += "小写字母 ";
				break;
			case 2:
				addString += "大写字母 ";
				break;
			case 3:
				addString += "数字 ";
				break;
			case 4:
				addString += "符号 ";
				break;
			default:
				break;
		}
	}
	return intiString + addString;
}
<!--
EOT;
if(count($fields)){
print <<<EOT
-->
var keep = 20;
<!--
EOT;
foreach($fields as $field){
print <<<EOT
-->
<!--
EOT;
if($field[type]!='text'){
print <<<EOT
-->
getObj("$field[field]").onfocus 	= onFocus;
getObj("$field[field]").onblur 		= onBlur;
extracheck.push(getObj("$field[field]"));
<!--
EOT;
}print <<<EOT
-->
regInfo[keep] 	= new Array(
						"填写正确。",
						"本选项不能为空。",
						"$field[descrip]"	);
var $field[field] = new Element("$field[field]",regInfo[keep],"$field[field]"+"_info");
keep++;
<!--
EOT;
}}print <<<EOT
-->

function showimage(imgpath,value){
	var path = imgpath + '/face/';
	facepath(path,value,false);
}
function facepath(iconurl,iconfile,showmsg,iconwidth,iconheight){
	if (showmsg) {
		if (showmsg == 'success') {
			ajax.time = setTimeout(function(){
				closep();
				alert('上传成功!');
			},1500);
			getObj('reupload').innerHTML = '<input class="input file" type="file" id="upload" name="upload" /><a class="abtn" unselectable="on" onclick="UpLoadFace()">上传</a>';
		} else if (showmsg == 'undefined_action') {
			ajax.time = setTimeout(function(){
				closep();
				alert('非法操作');
			},1500);
			return false;
		} else {
			ajax.time = setTimeout(function(){
				closep();
				alert(showmsg);
			},1500);
			return false;
		}
	}
	document.images.useravatars.src = iconurl + iconfile + '?' + new Date().getTime();
	if (iconwidth>0) document.images.useravatars.width = iconwidth;
	if (iconheight>0) document.images.useravatars.height = iconheight;
	document.register.regicon.value = iconfile;
	return false;
}

function showcustomquest(qid){
	getObj("customquest").style.display = qid==-1 ? '' : 'none';
}
</script>
<!--
EOT;
}?>-->