<%inherits "Discuz.Space.Pages.usercpspaceset"%>
<%template _header%>
<!--header end-->
<div id="foruminfo">
	<div id="nav">
		<a href="{config.forumurl}" class="home">{config.forumtitle}</a>  &raquo; <a href="usercp.aspx">用户中心</a>  &raquo; <strong>个人空间基本设置</strong>
	</div>
	<div id="headsearch">
		<div id="search">
			<%template _quicksearch%>
		</div>
	</div>
</div>

<!--主体-->
<div class="controlpannel">
   <%template _menu%>
	<div class="pannelcontent">
		<div class="pcontent">
			<div class="panneldetail">
				<%template _spacemenu%>	
				<div class="pannelbody">
					<div class="pannellist">
					<%if page_err==0%>
						<%if ispost%>
							<%template _msgbox%>
						<%else%>
						<form id="postspaceconfig" name="postspaceconfig" method="post" action="">
							<label for="user">个人空间标题:</label>
							<input name="spacetitle" type="text" id="spacetitle" value="{spaceconfiginfo.Spacetitle}" size="40" maxlength="100"/><br />
							<label for="email">描述:</label>
							<textarea name="_description" cols="50" rows="6" id="_description" style="width:60%; font-size:12px;" maxlength="200">{spaceconfiginfo.Description}</textarea><br />
							<label for="comment">日志显示模式:</label>
							<input type="radio" name="blogdispmode" value="0"  class="radioinput" 
							<%if {spaceconfiginfo.BlogDispMode}==0%>
							 checked="checked"
							<%/if%>
							 ID="Radio1"/>
							摘要
							<input type="radio" name="blogdispmode" value="1"  class="radioinput" 
							<%if {spaceconfiginfo.BlogDispMode}==1%>
							 checked="checked"
							<%/if%>
							 ID="Radio2"/>
							全文
							<input name="blogdispmode" type="radio" value="2"   class="radioinput" 
							<%if {spaceconfiginfo.BlogDispMode}==2%>
							 checked="checked"
							<%/if%>
							 ID="Radio3"/>
							只显示标题
							<br/>
							<label for="bpp">显示日志篇数:</label>
							<input name="bpp" type="text" id="bpp"  value="{spaceconfiginfo.bpp}" size="4" maxlength="3" /><br />
							<%if {spaceactiveconfig.enablespacerewrite}==1%>
								<%if {spaceconfiginfo.rewritename}==""%>
									<label for="rewritename">个性域名:</label>
									<input name="rewritename" type="text" id="rewritename" onblur="checkrewritename(this.value);" value="" size="30" /><span id="checkresult"></span><br />
									<p style="padding-left:110px;">设置此项后您将可以用 http://论坛地址/space/个性域名 形式的地址访问您的个人空间, 设置之后将不可更改</p>
									<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 = "";
												$('submitspaceconfig').disabled = false;
											}
										}

										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")
											{
												$('submitspaceconfig').disabled = true;
												resContainer.innerHTML = "<font color='#009900'>对不起，您输入的个性化名称 \"" + rewritename + "\" 中含有非法字符或被禁用，请选择其他名字后再试。</font>";
											}
											else if (result == "2")
											{
												$('submitspaceconfig').disabled = true;
												resContainer.innerHTML = "<font color='#009900'>个性化名称只能为字母、数字、下划线、减号的组合";
											}
											else if (result == "3")
											{
												$('submitspaceconfig').disabled = true;
												resContainer.innerHTML = "<font color='#009900'>对不起，您输入的个性化名称 \"" + rewritename + "\" 已经被其他会员使用，请选择其他名字后再试。";
											}
											else
											{
												$('submitspaceconfig').disabled = false;
												resContainer.innerHTML = "可用";
											}
										}
									</script>
									<script type="text/javascript" src="javascript/ajax.js"></script>
								<%else%>
									<label for="email">个性域名:</label>
									<p style="padding-top:5px;"><a href="{spaceurl}space/{spaceconfiginfo.rewritename}" target="_blank"><script type="text/javascript">document.write(window.location.toString().replace('usercpspaceset.aspx',''))</script>space/{spaceconfiginfo.rewritename}</a></p>
									<br />
								<%/if%>
							<%/if%>
							<label for="email">默认评论权限:</label>
							<input type="radio" name="commentpref" value="0"  class="radioinput"
							<%if {spaceconfiginfo.Commentpref}==0%>
							 checked="checked"
							<%/if%>
							/>
							允许匿名评论
							<input type="radio" name="commentpref" value="1"  class="radioinput" 
							<%if {spaceconfiginfo.Commentpref}==1%>
							 checked="checked"
							<%/if%>
							 ID="Radio4"/>
							不允许评论
							<input name="commentpref" type="radio" value="2"   class="radioinput" 
							<%if {spaceconfiginfo.Commentpref}==2%>
							 checked="checked"
							<%/if%>
							 ID="Radio5"/>
							仅允许注册用户评论
							<br />
							<label for="email">留言设置:</label>
							<input type="radio" name="messagepref" value="0"  class="radioinput" 
							<%if {spaceconfiginfo.MessagePref}==0%>
							 checked="checked"
							<%/if%>
							 />
							全部允许
							<input type="radio" name="messagepref" value="1"  class="radioinput" 
							<%if {spaceconfiginfo.MessagePref}==1%>
							 checked="checked"
							<%/if%>
							 ID="Radio6"/>
							全部禁止
							<input name="messagepref" type="radio" value="2"   class="radioinput" 
							<%if {spaceconfiginfo.MessagePref}==2%>
							 checked="checked"
							<%/if%>
							 ID="Radio7"/>
							只允许已登录用户
							<br />
							<input id="submitspaceconfig" name="submitspaceconfig" onclick="if ($('_description').value.length > 200) {alert('个人空间描述长度最大为200字'); return false;}"
                                type="submit" value="确定" />
						</form>
						<%/if%>
						</div>
					<%else%>
					<%template _usercperrmsgbox%>
					<%/if%>
			  </div>
			</div>
		</div>
	</div>
</div>
<!--主体-->
</div>
<%template _copyright%>
<%template _footer%>
