<%template _header%>

<div id="foruminfo">
	<div class="userinfo">
		<h2><a href="{config.forumurl}">{config.forumtitle}</a> > 申请个人空间</h2>	</div>
	<div class="forumstats">
		<div id="search">
				<%template _quicksearch%>
			</div>
		</div>
	</div>
</div>
<%if page_err==0%>
<!--body-->
<script type="text/javascript">
	function validatefrom()
	{
		if(document.getElementById("spacetitle").value == "")
		{
			alert("个人空间名称不能为空！");
			document.getElementById("spacetitle").focus();
			return false;
		}
		if(document.getElementById('spacedescription').value.length > 200)
		{
			alert('个人空间描述长度最大为200字');
			return false;
		}
		if(!(/^\d+$/.test(document.getElementById("bpp").value)))
		{
			alert("显示日志篇数必须是数值！");
			document.getElementById("bpp").focus();
			return false;
		}
	}
</script>
<%if ispost%>
	<%template _msgbox%>
<%else%>
	<form id="postpm" name="postpm" method="post" action="">
	<div class="ntforumbox">
			<div class="titlebar">
			     <h3>申请个人空间</h3>
			</div>
			<div class="forumform">
			<table cellpadding="0" cellspacing="0" border="0">
			<tbody>
			<tr class="list">
				<th class="formlabel">个人空间名称:</th>
				<td class="formbody"><input name="spacetitle" type="text" id="spacetitle"  size="40" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" maxlength="100"/>
				</td>
			</tr>
			</tbody>
			<tbody>	
			<tr class="list">
				<th class="formlabel">个人空间描述:</th>
				<td class="formbody"><textarea name="description" cols="50" rows="6" id="spacedescription" class="colorblue" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" style="width:80%;"></textarea>
				</td>
			</tr>
			</tbody>
			<tbody>	
			<tr class="list">
				<th class="formlabel">日志显示模式:</th>
				<td class="formbody">
					<input type="radio" name="blogdispmode" value="0"  class="radioinput" checked="checked"/>摘要
					<input type="radio" name="blogdispmode" value="1"  class="radioinput"/>全文
					<input type="radio" name="blogdispmode" value="2"  class="radioinput"/>只显示标题
				</td>
			</tbody>
			<tbody>	
			<tr class="list">
				<th class="formlabel">显示日志篇数:</th>
				<td class="formbody"><input name="bpp" type="text" class="colorblue" id="bpp" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';" size="30" maxlength="3" /> 
				</td>
			</tr>
			</tbody>
			<%if {spaceactiveconfig.enablespacerewrite}==1%>
			<tbody>	
			<tr class="list">
				<th class="formlabel">个性域名:</th>
				<td class="formbody">
						<input name="rewritename" type="text" class="colorblue" id="rewritename" onfocus="this.className='colorfocus';" onblur="this.className='colorblue';checkrewritename(this.value);" value="" size="30" /><span id="checkresult" style="line-height: 25px;"></span>
						<p>设置此项后您将可以用 http://论坛地址/space/个性域名 形式的地址访问您的个人空间, 设置之后将不可更改</p>
				</td>
				<script type="text/javascript">
					function checkrewritename(rewritename)
					{
						if (rewritename.length > 0)
						{
							ajaxRead("tools/ajax.aspx?t=checkrewritename&rewritename=" + escape(rewritename), "showcheckresult(obj,'" + rewritename + "');");
						}
						else
						{
							$("checkresult").innerHTML = "";
						}
					}

					function showcheckresult(obj, rewritename)
					{
						var res = obj.getElementsByTagName('result');
						var resContainer = $("checkresult");
						var result = "";
						if (res[0] != null && res[0] != undefined)
						{
							if (res[0].childNodes.length > 1) {
								result = res[0].childNodes[1].nodeValue;
							} else {
								result = res[0].firstChild.nodeValue;    		
							}
						}
						if (result == "1")
						{
							resContainer.innerHTML = "<font color='#009900'>对不起，您输入的个性化名称 \"" + rewritename + "\" 中含有非法字符或被禁用，请选择其他名字后再试。</font>";
						}
						else if (result == "2")
						{
							resContainer.innerHTML = "<font color='#009900'>个性化名称只能为字母、数字、下划线、减号的组合";
						}
						else if (result == "3")
						{
							resContainer.innerHTML = "<font color='#009900'>对不起，您输入的个性化名称 \"" + rewritename + "\" 已经被其他会员使用，请选择其他名字后再试。";
						}
						else
						{
							resContainer.innerHTML = "可用";
						}
					}
				</script>
				<script type="text/javascript" src="templates/default/ajax.js"></script>
				</tr>
			</tbody>
			<%/if%>
			<tbody>	
			<tr class="list">
				<th class="formlabel">默认评论权限:</th>
				<td class="formbody">
					<input type="radio" name="commentpref" value="0"  class="radioinput" checked="checked" />允许所有人
					<input type="radio" name="commentpref" value="1"  class="radioinput"/>禁止所有人
					<input type="radio" name="commentpref" value="2"  class="radioinput"/>只有登录用户						
				</td>
			</tr>
			</tbody>
			<tbody>	
			<tr class="list">
				<th class="formlabel">留言设置:</th>
				<td class="formbody">
					<input type="radio" name="messagepref" value="0"  class="radioinput" checked="checked"/>允许所有人
					<input type="radio" name="messagepref" value="1"  class="radioinput"/>禁止所有人
					<input type="radio" name="messagepref" value="2"  class="radioinput"/>只有登录用户													
				</td>
			</tr>
			</tbody>
			<tbody>	
			<tr class="list">
				<th class="formlabel">&nbsp;</th>
				<td class="formbody"><input type="submit" name="Submit" value="确定" class="sbutton" onclick="return validatefrom()" ID="Submit1"/></td>
			</tr>
			</tbody>
			</table>
		</div>
	</div>
  </form>
  <%/if%>
<!--body-->
</div>
<%template _copyright%>
<%else%>
<%template _errmsgbox%>
</div>
<%/if%>