<!--#include file="user_top.asp"-->
<!--#include file="inc/class_blog.asp"-->
<%
Dim DivId
DivId=Request("div")
If DivId="" Then DivId=11
DivId=Cint(DivId)
'没有出现编辑器的情况下进行脚本保护
If DivId="15" Or DivId="16" Then
'	Call oblog.makeEditorJs()
End If
%>
<style type="text/css">
<!--
html {height:auto;}
-->
</style>
</head>
<body style="overflow:auto!important;overflow:hidden;" scroll="no" style="background:#fff">
	
<ul class="user_setting_title" id="TabPage1">
    <li id="Tab11" <%If divId=11 Then%>class="Selected"<%End If%>><a href="user_setting.asp?action=0&div=11" title="站点设置">站点设置</a></li>
    <li id="Tab12" <%If divId=12 Then%>class="Selected"<%End If%>>
	<%IF HLIntegration = True Then'====恒浪整合开始2007-2-27====%>
	<a href="<%=HowaveChangePasswordUrl%>" title="密码设置">密码设置</a></li>
	<%Else%>
	<a href="user_setting.asp?action=userpassword&div=12" title="密码设置">密码设置</a></li>
	<%End IF'====恒浪整合结束2007-2-27====%>	
    <li id="Tab13" <%If divId=13 Then%>class="Selected"<%End If%>><a href="user_setting.asp?action=userinfo&div=13" title="个人资料">个人资料</a></li>
    <li id="Tab14" <%If divId=14 Then%>class="Selected"<%End If%>><a href="user_setting.asp?action=blogpassword&div=14" title="加密整站">加密整站</a></li>
    <li id="Tab15" <%If divId=15 Then%>class="Selected"<%End If%>><a href="user_friendurl.asp" title="友情连接">友情连接</a></li>
    <li id="Tab16" <%If divId=16 Then%>class="Selected"<%End If%>><a href="user_setting.asp?action=placard&div=16" title="博客公告">博客公告</a></li>
    <li id="Tab17" <%If divId=17 Then%>class="Selected"<%End If%>><a href="user_setting.asp?action=blogstar&div=17" title="博客之星">博客之星</a></li>
    <li id="Tab18" <%If divId=18 Then%>class="Selected"<%End If%>><a href="user_setting.asp?action=blogteam&div=18" title="共同撰写">共同撰写</a></li>
</ul>

<div id="user_setting_content">
    <div id="cnt">
<%
Dim action
action = request("action")
Select Case action
    Case "blogteam"
        Call blogteam
    Case "links"
        Call links
    Case "savelinks"
        Call savelinks
    Case "placard"
        Call placard
    Case "saveplacard"
        Call saveplacard
    Case "blogpassword"
        Call blogpassword
    Case "addblogpassword"
        Call addblogpassword
    Case "unblogpassword"
        Call unblogpassword
    Case "savesitesetup"
        Call savesitesetup
    Case "blogstar"
        Call blogstar
    Case "saveblogstar"
        Call saveblogstar
    Case "saveuserlostpass"
        Call saveuserlostpass
    Case "userpassword"
        Call userpassword
    Case "saveuserpassword"
        Call saveuserpassword
    Case "saveuserinfo"
        Call saveuserinfo
    Case "userinfo"
        Call userinfo
    Case Else
        Call sitesetup
End Select
%>
    </div>
</div>
</body>
</html>
<%
Sub blogteam()
%>
<div id="dTab18" class="Box">
		<iframe class="FrmID" src="user_blogteam.asp" name="content2" frameborder="0" scrolling="auto"></iframe>
</div>
<%
End Sub

Sub saveplacard()
    Dim rs, userplacard
    userplacard = oblog.filt_astr(request.Form("edit"), 20000)
	If oblog.l_Group(15,0)=0 Then userplacard = FilterJS(userplacard)
	If oblog.chk_badword(userplacard) >0 Then
		oblog.adderrstr ("站点公告中存在系统不允许的字符!")
		oblog.showusererr
		Exit Sub
	End if
    Set rs = server.CreateObject("adodb.recordset")
    rs.open "select user_placard from [oblog_user] where userid=" & oblog.l_uid, conn, 1, 3
    rs(0) = oblog.filtpath(userplacard)
    rs.Update
    rs.Close
    Dim blog
    Set blog = New class_blog
    blog.userid = oblog.l_uid
    blog.update_placard oblog.l_uid
    Set rs = Nothing
    oblog.showok "修改公告成功", ""
End Sub

Sub placard()
Dim rs
Set rs = oblog.execute("select user_placard from [oblog_user] where userid=" & oblog.l_uid)
%>

<div id="dTab12" class="Box">	
	<table  class="dTab12_body" align="center" border="0" cellpadding="0" cellspacing="1">
	  <form name="oblogform" method="post" action="user_setting.asp?action=saveplacard">
	  <tr>
		<td colspan="2" class="dTab12_body_top">博客公告</td>
	  </tr>
	  <tr>
		<td class="dTab12_body_td">你可以在这里放置你的照片，关于你的介绍，或者你愿意放上去的任何信息。
		</td>
	 </tr>
	 <tr>
		<td>
		<span id="loadedit" style="font-size:12px"><img src='images/loading.gif' align='absbottom'> 正在载入编辑器...</span>
		 <textarea id="edit" name="edit" style="width:60%;height:220px; display:none"><%=Server.HtmlEncode(OB_IIF(rs(0),""))%></textarea >
  		</td>
  	</tr>
   <tr><td>
    <input name="Action" type="hidden" id="Action" value="saveplacard" />
    &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="提交修改" />
     </td>
	  </tr>
    </form>
  </table>
</div>
<%oblog.MakeEditorText "",1,"535","240"%>
<%
Set rs = Nothing
End Sub

Sub savelinks()
    Dim rs, links
    links = oblog.filt_astr(request.Form("edit"), 20000)
	If oblog.l_Group(15,0)=0 Then links = FilterJS(links)
	If oblog.chk_badword(links) >0 Then
		oblog.adderrstr ("友情链接中存在系统不允许的字符!")
		oblog.showusererr
		Exit Sub
	End if
    Set rs = server.CreateObject("adodb.recordset")
    rs.open "select user_links from [oblog_user] where userid=" & oblog.l_uid, conn, 1, 3
    rs(0) = oblog.filtpath(links)
    rs.Update
    rs.Close
    Dim blog
    Set blog = New class_blog
    blog.userid = oblog.l_uid
    blog.update_links oblog.l_uid
    Set rs = Nothing
    oblog.showok "修改友情连接成功", ""
End Sub

Sub links()
Dim rs
Set rs = oblog.execute("select user_links from [oblog_user] where userid=" & oblog.l_uid)
%>
<div id="dTab12" class="Box">	
	<table  class="dTab12_body" align="center" border="0" cellpadding="0" cellspacing="1">
		<form name="oblogform" method="post" action="user_setting.asp">
	  <tr>
		<td colspan="2" class="dTab12_body_top">友情连接</td>
	  </tr>
	  <tr>
		<td class="dTab12_body_td">你可以先输入文字或者图片，然后用 <image src="images/wlink.gif" /> 按钮插入超级连接，推荐使用<a href="user_friendurl.asp">友情连接管理</a>。
		</td>
	 </tr>
	 <tr>
	 	<td> 
		<span id="loadedit" style="font-size:12px"><img src='images/loading.gif' align='absbottom'> 正在载入编辑器...</span>
		<textarea id="edit" name="edit" style="width:60%;height:220px; display:none"><%=Server.HtmlEncode(OB_IIF(rs(0),""))%></textarea >
		</td>
	  </tr>
	<tr>
	 	<td>
    <input name="Action" type="hidden" id="Action" value="savelinks" />
    &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="提交修改" />
    </td>
	  </tr>
    </form>
  </table>
</div>
<%oblog.MakeEditorText "",1,"535","240"%>
<%
Set rs = Nothing
End Sub



Sub blogpassword()
%>
<div id="dTab14" class="Box">
	<table  class="dTab14_body" align="center" border="0" cellpadding="0" cellspacing="1">
	  	<%
	  	If oblog.l_Group(26,0)=1 Then
	  	%>
	  <tr>
		<td class="dTab14_body_td">整个blog站点的密码设定
		<p>全站加密后，你所有日志都需要通过密码验证后才能访问。</br>
	注意：设置完密码以后，需要<a href="user_update.asp">重新发布全站</a>！</p></td>
		<td> <form name="form1" method="post" action="user_setting.asp?action=addblogpassword" >密码：<input type="password" name="password" /> <input type="submit" name="Submit" value="全站加密" /></form></td>
	  </tr>
	  <%Else%>
	   <tr>
		<td class="dTab14_body_td">系统禁止进行整站加密</td>
		<td>如果之前您启用了整站加密功能，之前加密的内容仍能通过原来的方式访问.</td>
	  </tr>
	  <%End If%>
	  <tr>
		<td class="dTab14_body_td">解除我站点的密码保护</td>
		<td><form name="form2" method="post" action="user_setting.asp?action=unblogpassword" /><input type="submit" name="Submit" value="解除我站点的密码保护" /></form></td>
	  </tr>
	</table>
</div>
<%end sub

Sub addblogpassword()
	If oblog.l_Group(26,0)=0 Then
		oblog.showok "系统不允许整站加密!",""
		Response.End
	End If	
    Dim password, strtmp, upath, blog
	password=Trim(request("password"))
	if password="" then
		oblog.showok "密码不能为空!",""
		Response.End
	end if
    password = md5(password)
    oblog.execute("update [oblog_user] set blog_password='"&password&"' where userid="&oblog.l_uid)
    oblog.execute ("update [oblog_log] set blog_password=1 where userid=" & oblog.l_uid)
    'strtmp="<script language=javascript>"&vbcrlf
    'strtmp=strtmp&"var blogpassword=GetCookie('blogpassword')"&vbcrlf
    'strtmp=strtmp&"if (blogpassword != '"&password&"')"&vbcrlf
    'strtmp=strtmp&"{ window.location.replace('"&blogdir&"chkblogpassword.asp?userid="&oblog.l_uid&"');}"&vbcrlf
    'strtmp=strtmp&"<script>"&vbcrlf
    upath = server.MapPath(oblog.l_udir)
    Call oblog.BuildFile(upath&"\"&oblog.l_ufolder&"\inc\chkblogpassword.htm","")
    Set blog = New class_blog
    blog.userid = oblog.l_uid
    blog.update_index 0
    blog.update_message 0
    Set blog = Nothing
    oblog.showok "设置整站密码成功,请重新更新全站才可获得安全的加密保护！", ""
End Sub

Sub unblogpassword()
    Dim upath, blog
    oblog.execute ("update [oblog_user] set blog_password='' where userid=" & oblog.l_uid)
    oblog.execute ("update [oblog_log] set blog_password=0 where userid=" & oblog.l_uid)
    upath = server.MapPath(oblog.l_udir)
    Set blog = New class_blog
    blog.userid = oblog.l_uid
    blog.update_index 0
    blog.update_message 0
    Set blog = Nothing
    oblog.showok "取消密码成功,请重新更新全站才可全部解密！", ""
End Sub

Sub sitesetup()
Dim rs, sstr, sublist, us, i,sstr1
If oblog.l_Group(6,0) = 0 Then sstr = "disabled"
If oblog.l_Group(7,0) = 0 Then sstr1 = "disabled"
Set rs = oblog.execute("select * from oblog_user where userid=" & oblog.l_uid)
us = rs("user_info")
If us = "" Or IsNull(us) Then
    sublist = 0
Else
    us = Split(us, "$")
    If us(0) <> "" Then sublist = CInt(us(0)) Else sublist = 0
End If
%>
<div id="dTab11" class="Box">
    <form name="oblogform" action="user_setting.asp" method="post">
	<table  class="dTab11_body" align="center" border="0" cellpadding="0" cellspacing="1">
    <%if trim(oblog.cacheConfig(4))<>"" and oblog.cacheConfig(5)=1 then%>
	  <tr>
		<td class="dTab11_body_td" >域名：
		<p>请根据自己的喜好设置域名。</p></td>
		<td><input name="user_domain" type="text" value="<%=oblog.filt_html(trim(rs("user_domain")))%>" size=10 maxlength=20 <%=sstr%> /> <select name="user_domainroot" <%=sstr%>><%=oblog.type_domainroot(rs("user_domainroot"))%></select><input type="hidden" name="old_userdomain" value="<%=oblog.filt_html(rs("user_domain"))%>"></td>
	  </tr>
    <%end if%>
    <%if true_domain=1 and oblog.l_Group(7,0)=1 then%>
	  <tr>
		<td class="dTab11_body_td">绑定我的顶级域名：
		<p>绑定前需确认域名ip已经解析到博客服务器。</p></td>
		<td><input name="custom_domain" type="text" value="<%=oblog.filt_html(trim(rs("custom_domain")))%>" size=20 maxlength=50 <%=sstr1%> /></td>
	  </tr>
    <%end if%>
	  <tr>
		<td class="dTab11_body_td">站点名称：
		<p>博客站点的名称。</p></td>
		<td><input name="blogname" type="text" value="<%=oblog.filt_html(rs("blogname"))%>" size="30" maxlength="20" /></td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">站点类别：
		<p>你博客站点的类别，便于别人查找。</p></td>
		<td><select name="user_classid" ><%=oblog.show_class("user",rs("user_classid"),0)%></select></td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">允许将我加入博客团队：
		<p>允许别人将自己加入他创建的团队。</p></td>
		<td><input type="radio" value="1" name="en_blogteam" <%if rs("en_blogteam")<>0 then response.write "checked"%> />
        是 &nbsp;&nbsp; <input type=radio value="0" name="en_blogteam" <%if rs("en_blogteam")=0 then response.write "checked"%> />否</td>
	  </tr>
  <tr>
		<td class="dTab11_body_td">是否隐藏转向url：
		<p>开启后别人将看不到你的真实域名，只能看到你选择的二级域名。</p></td>
		<td><input type="radio" value="1" name="hideurl" <%if rs("hideurl")=1 then response.write "checked"%> />
        是 &nbsp;&nbsp; <input type="radio" value="0" name="hideurl" <%if rs("hideurl")=0 Or  OB_IIF(rs("hideurl"),"")="" then response.write "checked"%> />否</td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">分类日志是否以列表显示：
		<p>开启后打开你的分类导航将看到日志标题的排列，关闭则显示日志内容。</p>
		<span>(需要更新首页后才会生效)</span></td>
		<td><input type="radio" value="1" name="sublist" <%if sublist=1 then response.write "checked"%> />
        是 &nbsp;&nbsp; <input type="radio" value="0" name="sublist" <%if sublist=0 then response.write "checked"%> />否</td>
	  </tr>
	    <tr>
		<td class="dTab11_body_td">首页日志是否以列表显示：
		<p>开启后打开你的首页将看到最新日志标题的排列。</p>
		<span>(需要更新首页后才会生效)</span></td>
		<td><input type="radio" value="1" name="indexlist" <%if rs("indexlist")=1 then response.write "checked"%> />
        是 &nbsp;&nbsp; <input type="radio" value="0" name="indexlist" <%if rs("indexlist")=0 then response.write "checked"%> />否</td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">日志默认部分显示字数：
		<p>首页文章列表页面显示的字数。设置成0可显示全文。</p>
		<span>(需要更新首页后才会生效)</span></td>
		<td><input name="user_showlogword_num" type="text"  value="<%=rs("user_showlogword_num")%>" size="5" /></td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">每页显示日志篇数：
		<p>首页显示日志数量，请不要设置为0或者太大的数字。</p>
		<span>(需要更新首页后才会生效)</span></td>
		<td><input name="user_showlog_num" type="text" id="user_showlog_num" value="<%=rs("user_showlog_num")%>" size="5" /></td>
	  </tr>
	 <!-- <tr>
		<td class="dTab11_body_td">每行显示相片数：
		<p>相册页面没行显示照片数，建议设置成2。</p>
		<span>(需要更新首页后才会生效)</span></td>
		<td><input name="user_photorow_num" type="text" id="user_photorow_num" value="<%=rs("user_photorow_num")%>" size="5" /></td>
	  </tr>-->
	  <tr>
		<td class="dTab11_body_td">显示最新回复条数：
		<p>博客首页显示回复标题条数。</p>
		<span>(需要更新首页后才会生效)</span></td>
		<td><input name="user_shownewcomment_num" type="text" value="<%=rs("user_shownewcomment_num")%>" size="5" /></td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">显示最新日志条数：
		<p>博客首页显示最新日志条数。</p>
		<span>(需要更新首页后才会生效)</span></td>
		<td><input name="user_shownewlog_num" type="text" value="<%=rs("user_shownewlog_num")%>" size="5" /></td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">显示最新留言条数：
		<p>博客首页显示最新留言条数。</p>
		<span>(需要更新首页后才会生效)</span></td>
		<td><input name="user_shownewmessage_num" type="text" value="<%=rs("user_shownewmessage_num")%>" size="5" /></td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">日志评论排列顺序：
		<p>日志页面评论排列顺序，建议选择时间倒序。</p></td>
		<td><input type="radio" value="1" name="comment_isasc" <%if rs("comment_isasc")=1 then response.write "checked"%> />时间顺序 &nbsp;&nbsp; <input type="radio" value="0" name="comment_isasc" <%if rs("comment_isasc")=0 then response.write "checked"%> />时间倒序</td>
	  </tr>
	  <tr>
		<td class="dTab11_body_td">站点简介：
		<p>写一点关于您博客站点的介绍。</p></td>
		<td><textarea name="siteinfo" cols="40" rows="5"><%=oblog.filt_html(rs("siteinfo"))%></textarea></td>
	  </tr>
	  <tr>
		<td colspan="2" class="dTab11_body_end"><input name="action" type="hidden" value="savesitesetup" /> <input type="submit" value=" 更新 " />
		</td>
	  </tr>
	</table>
  </form>
</div>
<%
Set rs = Nothing
End Sub

Sub savesitesetup()
    Dim user_domain, user_domainroot, blogname, user_classid, en_blogteam, user_showlogword_num, user_showlog_num, user_shownewcomment_num, user_shownewlog_num, user_shownewmessage_num, hideurl, comment_isasc, siteinfo, user_photorow_num, custom_domain
    Dim rs, blog
    user_domain = LCase(Trim(request("user_domain")))
    user_domainroot = Trim(request("user_domainroot"))
    blogname = EncodeJP(Trim(request("blogname")))
    user_classid = Trim(request("user_classid"))
    en_blogteam = Trim(request("en_blogteam"))
    user_showlogword_num = Trim(request("user_showlogword_num"))
    user_showlog_num = Trim(request("user_showlog_num"))
    'user_photorow_num = Trim(request("user_photorow_num"))
    user_shownewcomment_num = Trim(request("user_shownewcomment_num"))
    user_shownewlog_num = Trim(request("user_shownewlog_num"))
    user_shownewmessage_num = Trim(request("user_shownewmessage_num"))
    hideurl = Trim(request("hideurl"))
    comment_isasc = Trim(request("comment_isasc"))
    siteinfo = EncodeJP(Trim(request("siteinfo")))
    custom_domain = Trim(request("custom_domain"))
    If Trim(oblog.CacheConfig(4)) <> "" And oblog.CacheConfig(5) = 1 And oblog.l_Group(6,0) = 1 Then
        If user_domain = "" Or oblog.strLength(user_domain) > 20 Then oblog.adderrstr ("域名不能为空(不能大于14个字符)！")
        If user_domain <> request("old_userdomain") And oblog.strLength(user_domain) < 4 Then oblog.adderrstr ("域名不能小于4个字符！")
        'If oblog.chk_regname(user_domain) Then oblog.adderrstr ("此域名系统不允许注册！")
        If oblog.chk_badword(user_domain) > 0 Then oblog.adderrstr ("域名中含有系统不允许的字符！")
        If oblog.chkdomain(user_domain) = False Then oblog.adderrstr ("域名不合规范，只能使用小写字母，数字！")
        If user_domainroot = "" Then oblog.adderrstr ("域名根不能为空！")
		If oblog.CheckDomainRoot(user_domainroot) = False Then oblog.adderrstr  ("域名根不合法！")
    End If
    If oblog.strLength(siteinfo) > 255 Then oblog.adderrstr ("站点简介不能大于255个字符！")
    If oblog.chk_badword(blogname) > 0 Then oblog.adderrstr ("blog名中含有系统不允许的字符！")
    If Not IsNumeric(user_showlogword_num) Then
        oblog.adderrstr ("日志默认部分显示字数必须为数字！")
    End If
	If oblog.CacheConfig(48)="1" Then
		Dim rsreg
		Set rsreg=oblog.execute("select Count(userid) From oblog_user Where blogname='" & ProtectSQL(blogname) & "' and userid<> " & oblog.l_uid)
    	If rsreg(0)>0 Then
    		oblog.adderrstr  ("您使用的博客名称: " & blogname & " 已被他人使用，请更换博客名称")
    	End If
    	rsreg.Close
	End If
    If Not IsNumeric(user_showlog_num) Then
        oblog.adderrstr ("每页显示日志数量必须为数字！")
    Else
        user_showlog_num = CLng(user_showlog_num)
        If user_showlog_num > 50 Then oblog.adderrstr ("每页显示日志数量必须小于50！")
    End If
    'If Not IsNumeric(user_photorow_num) Then
'        oblog.adderrstr ("每行显示相片数量必须为数字！")
'    Else
'        user_photorow_num = CLng(user_photorow_num)
'        If user_photorow_num > 50 Then oblog.adderrstr ("每行显示相片数量必须小于50！")
'    End If

    If Not IsNumeric(user_shownewcomment_num) Then
        oblog.adderrstr ("显示最新回复条数必须为数字！")
    Else
        user_shownewcomment_num = CLng(user_shownewcomment_num)
        If user_shownewcomment_num > 50 or user_shownewcomment_num<1 Then oblog.adderrstr ("显示最新回复条数不能大于50或者小于1！")
    End If

    If Not IsNumeric(user_shownewlog_num) Then
        oblog.adderrstr ("显示最新日志条数必须为数字！")
    Else
        user_shownewlog_num = CLng(user_shownewlog_num)
        If user_shownewlog_num > 50 or user_shownewlog_num<1 Then oblog.adderrstr ("显示最新日志条数不能大于50或者小于1！")
    End If

    If Not IsNumeric(user_shownewmessage_num) Then
        oblog.adderrstr ("显示最新留言条数必须为数字！")
    Else
        user_shownewmessage_num = CLng(user_shownewmessage_num)
        If user_shownewmessage_num > 50 or user_shownewmessage_num<1 then oblog.adderrstr ("显示最新留言条数不能大于50或者小于1！")
    End If
   If Trim(oblog.CacheConfig(4)) <> "" And oblog.CacheConfig(5) = 1 And oblog.l_Group(6,0) = 1 Then
        Set rs = oblog.execute("select userid from oblog_user where user_domain='" & oblog.filt_badstr(user_domain) & "' and user_domainroot='" & oblog.filt_badstr(user_domainroot) & "' and userid<>" & oblog.l_uid)
        If Not rs.EOF Or Not rs.bof Then oblog.adderrstr ("系统中已经有这个域名存在，请更改域名！")
    End If
    If true_domain = 1 And custom_domain <> "" Then
        If oblog.chk_badword(custom_domain) > 0 Then oblog.adderrstr ("绑定的顶级域名中含有系统不允许的字符！")
        Set rs = oblog.execute("select userid from oblog_user where custom_domain='" & oblog.filt_badstr(custom_domain) & "'" & " and userid<>" & oblog.l_uid)
        If Not rs.EOF Or Not rs.bof Then oblog.adderrstr ("系统中已经有其他人绑定了这个顶级域名，请更改域名或者联系管理员！")
    End If
    If oblog.errstr <> "" Then oblog.showusererr: Exit Sub
    If hideurl = "" Or IsNull(hideurl) Then hideurl = 0
    Set rs = server.CreateObject("adodb.recordset")
    rs.open "select * from oblog_user where userid=" & oblog.l_uid, conn, 1, 3
    If Not rs.EOF Then
        rs("blogname") = oblog.filt_astr(blogname, 50)
       If Trim(oblog.CacheConfig(4)) <> "" And oblog.CacheConfig(5) = 1 And oblog.l_Group(6,0) = 1 Then
            rs("user_domain") = user_domain
            rs("user_domainroot") = user_domainroot
        End If
        If oblog.l_Group(7,0) = 1 Then
            If true_domain = 1 Then
                rs("custom_domain") = custom_domain
            End If
        End If
        rs("user_classid") = user_classid
        rs("en_blogteam") = en_blogteam
        rs("user_showlogword_num") = user_showlogword_num
        rs("user_showlog_num") = user_showlog_num
        'rs("user_photorow_num") = user_photorow_num
        rs("user_shownewcomment_num") = user_shownewcomment_num
        rs("user_shownewlog_num") = user_shownewlog_num
        rs("user_shownewmessage_num") = user_shownewmessage_num
        rs("hideurl") = hideurl
        rs("comment_isasc") = comment_isasc
        rs("siteinfo") = siteinfo
        rs("isubbedit") = OB_IIF(request.Form("isubbedit"),0)
        rs("user_info") = CInt(request.Form("sublist")) & "$0"
		rs("indexlist")=cint(request.Form("indexlist"))
        rs.Update
        rs.Close
    End If
    Set rs = Nothing
    Set blog = New class_blog
    blog.userid = oblog.l_uid
    blog.update_blogname
    Set blog = Nothing
    oblog.showok "保存设置成功!", ""
End Sub

Sub saveblogstar()
    Dim rs, picurl, bloginfo, blogname
    picurl = Trim(request("picurl"))
    bloginfo = Trim(request("bloginfo"))
    blogname = Trim(request("blogname"))
    If picurl = "" Or oblog.strLength(picurl) > 250 Then oblog.adderrstr ("图片连接地址不能为空,且不能大于250个字符！")
    If bloginfo = "" Or oblog.strLength(bloginfo) > 250 Then oblog.adderrstr ("站点介绍不能为空,且不能大于250个字符！")
    If blogname = "" Or oblog.strLength(blogname) > 250 Then oblog.adderrstr ("博客名不能为空,且不能大于50个字符！")
    If oblog.errstr <> "" Then oblog.showusererr: Exit Sub
    Set rs = server.CreateObject("adodb.recordset")
    rs.open "select top 1 * from oblog_blogstar Where userid=" & oblog.l_uid, conn, 1, 3
    If rs.EOF Then
        rs.addnew
        rs("userid") = oblog.l_uid
    End If
    rs("picurl") = picurl
    rs("info") = bloginfo
    If Trim(oblog.CacheConfig(4)) <> "" And oblog.CacheConfig(5) = 1  Then
		If oblog.l_Group(6,0) = 0 Then 
			rs("userurl") = "http://" & oblog.l_udomain
		Else 
			rs("userurl")=oblog.CacheConfig(3)&oblog.l_udir&"/"&oblog.l_ufolder&"/index."&f_ext
		End if
    Else
        rs("userurl")=oblog.CacheConfig(3)&oblog.l_udir&"/"&oblog.l_ufolder&"/index."&f_ext
    End If
    rs("blogname") = blogname
    rs.Update
    rs.Close
    Set rs = Nothing
    oblog.showok "提交完成，请等待管理员审核通过。", ""
End Sub

Sub blogstar()
    Dim rs, strTitle, strBlogName, strPicUrl, strBlogInfo, intState
    Set rs = server.CreateObject("ADODB.RecordSet")
    rs.open "select * from oblog_blogstar Where userid=" & oblog.l_uid, conn, 1, 1
    If rs.EOF Then
        strTitle = "你目前还没有申请"
        intState = -1
    Else
        strPicUrl = rs("picurl")
        strBlogName = rs("blogname")
        strBlogInfo = rs("info")
        intState = rs("ispass")
        If intState = 1 Then
            strTitle = "你目前已经是博客之星，资料不可更改"
        Else
            strTitle = "你目前正在等待审核中，可以修改之前提交的资料"
        End If
    End If
    rs.Close
    Set rs = Nothing
%>
<div id="dTab17" class="Box">
    <form  method="post" action="user_setting.asp?action=saveblogstar">
	<table  class="dTab17_body" align="center" border="0" cellpadding="0" cellspacing="1">
	  <tr>
		<td colspan="2" class="dTab17_body_top" style="width:100%;">申请博客之星: <%=strTitle%></td>
	  </tr>
	  <tr>
		<td class="dTab17_body_td">博客名字：
		<p>blog介绍请不要超过50字。</p></td>
		<td><input type="text" maxlength="50" size="60" name="blogname" value="<%=strBlogname%>" /></td>
	  </tr>
	  <tr>
		<td class="dTab17_body_td">图片地址：
		<p>图片地址可以放上你的照片，站点logo或者站点缩略图。(图片尺寸最好缩小到130*100左右，以便管理员操作。)</p></td>
		<td><input type="text" maxlength="250" size="60" name="picurl" value="<%=strPicUrl%>" /></td>
	  </tr>
	  <tr>
		<td class="dTab17_body_td">blog介绍：
		<p>图片地址可以放上你的照片，站点logo或者站点缩略图。</p></td>
		<td><textarea name="bloginfo" cols="60" rows="5"><%=strBlogInfo%></textarea></td>
	  </tr>
	  <tr>
	  <td></td>
		<td>
    <%
    Select Case intState
        Case -1
    %>
        <input type="submit" value="提交申请资料"></ul>
        <%
        Case 0
        %>
        <input type="submit" value="修改申请资料"></ul>
        <%
        Case 1
        %>
        已经被确认为博客之星，资料不可更改，如果需要修改或撤销请与管理员联系。
    <%End Select%>
		</td>
	  </tr>
	</table>
    </form>
</div>
<%
End Sub
Sub userpassword()
if is_ot_user=1 then
	response.Redirect(ot_modifypass1)
end if
Dim rs
Set rs = oblog.execute("select question from oblog_user where userid=" & oblog.l_uid)
%>
<div id="dTab12" class="Box">
    <form name="oblogform" action="user_setting.asp" method="post">
	<table  class="dTab12_body" align="center" border="0" cellpadding="0" cellspacing="1">
	  <tr>
		<td colspan="2" class="dTab12_body_top">修改密码</td>
	  </tr>
	  <tr>
		<td class="dTab12_body_td">原密码：</td>
		<td><input name="oldpassword" type="password" size="30" maxlength="20" /><font color="#FF0000"> *</font></td>
	  </tr>
	  <tr>
		<td class="dTab12_body_td">新密码：</td>
		<td><input name="newpassword"  type="password" size="30" maxlength="20" /><font color="#FF0000"> *</font></td>
	  </tr>
	  <tr>
		<td class="dTab12_body_td">重复密码：</td>
		<td><input name="newpassword1" type="password" size="30" maxlength="20" /><font color="#FF0000"> *</font></td>
	  </tr>
	  <tr>
		<td colspan="2" class="dTab12_body_end"><input name="action" type="hidden" value="saveuserpassword" /> <input type=submit value=" 修改密码 " /></td>
	  </tr>
	</table>
    </form>
<br />
    <form name="oblogform" action="user_setting.asp" method="post">
	<table  class="dTab12_body" align="center" border="0" cellpadding="0" cellspacing="1">
	  <tr>
		<td colspan="2" class="dTab12_body_top">更改找回密码设置</td>
	  </tr>
	  <tr>
		<td class="dTab12_body_td">登录密码：</td>
		<td><input name="password"  type="password" size="30" maxlength="20" /><font color="#FF0000"> *</font></td>
	  </tr>
	  <tr>
		<td class="dTab12_body_td">密码提示问题：</td>
		<td><input name="question"  type="text" size="30" maxlength="20" value="<%=oblog.filt_html(rs(0))%>"><font color="#FF0000"> *</font></td>
	  </tr>
	  <tr>
		<td class="dTab12_body_td">找回密码答案：</td>
		<td><input name="answer" type="text" size="30" maxlength="20"><font color="#FF0000"> *</font></td>
	  </tr>
	  <tr>
		<td colspan="2" class="dTab12_body_end"><input name="action" type="hidden" value="saveuserlostpass"> <input type="submit" value=" 更新 "></td>
	  </tr>
	</table>
    </form>
</div>
<%
End Sub

Sub saveuserlostpass()
    Dim password, question, answer, rs
    password = Trim(request("password"))
    question = Trim(request("question"))
    answer = Trim(request("answer"))
    If password = "" Then oblog.adderrstr ("错误：登录密码不能为空!")
    If question = "" Then oblog.adderrstr ("错误：提示问题不能为空！")
    If oblog.errstr <> "" Then oblog.showusererr: Exit Sub
    Set rs = server.CreateObject("adodb.recordset")
    rs.open "select question,answer from oblog_user where userid="&oblog.l_uid&" and password='"&md5(password)&"'",conn,1,3
    If rs.EOF Then
        rs.Close
        Set rs = Nothing
        oblog.adderrstr ("错误：登录密码输入错误!")
        oblog.showusererr
        Exit Sub
    Else
	    If API_Enable Then 
	          Dim blogAPI
              Set blogAPI = New DPO_API_OBLOG
			  blogAPI.LoadXmlFile True
              blogAPI.UserName=oblog.l_uName
              blogAPI.PassWord=password
			  blogAPI.Question=Question
              blogAPI.Answer=Answer
		      Call blogAPI.ProcessMultiPing("update")
			  Set blogAPI=Nothing
		End If

        rs("question") = question
        If answer <> "" Then rs("answer") = md5(answer)
        rs.Update
        rs.Close
        Set rs = Nothing
        oblog.showok "修改找回密码资料成功！", ""
    End If

End Sub

Sub saveuserpassword()
    Dim oldpassword, newpassword, rs
    oldpassword = Trim(request("oldpassword"))
    newpassword = Trim(request("newpassword"))
    If oldpassword = "" Then oblog.adderrstr ("错误：原密码不能为空!")
    If newpassword = "" Or oblog.strLength(newpassword) > 14 Or oblog.strLength(newpassword) < 4 Then oblog.adderrstr ("错误：新密码不能为空(不能大于14小于4)！")
    If newpassword <> Trim(request("newpassword1")) Then oblog.adderrstr ("错误：重复密码输入错误!")
    If oblog.errstr <> "" Then oblog.showusererr: Exit Sub
    Set rs = server.CreateObject("adodb.recordset")
    rs.open "select password from oblog_user where userid="&oblog.l_uid&" and password='"&md5(oldpassword)&"'",conn,1,3
    If rs.EOF Then
        rs.Close
        Set rs = Nothing
        oblog.adderrstr ("错误：原密码输入错误!")
        oblog.showusererr
        Exit Sub
    Else

	    If API_Enable Then 
			Dim blogAPI,j
			Set blogAPI = New DPO_API_OBLOG
			blogAPI.LoadXmlFile True
			blogAPI.UserName=oblog.l_uName
			blogAPI.PassWord=newpassword
			Call blogAPI.ProcessMultiPing("update")
			Set blogAPI=Nothing
			For j=0 To UBound(aUrls)
				strUrl=Lcase(aUrls(j))
				If Left(strUrl,7)="http://" Then
					Response.write("<script src="""&strUrl&"?syskey="&MD5(oblog.l_uName&oblog_Key)&"&username="&oblog.l_uName&"&password="&MD5(newpassword)&"&savecookie=0""></script>")
				End If
			Next
		End If

        rs("password") = md5(newpassword)
        rs.Update
        rs.Close
        Set rs = Nothing
        oblog.savecookie oblog.l_uname, MD5(newpassword), 0, ""
        oblog.showok "修改密码成功,下次需要重新登录！", ""
    End If
End Sub

Sub userinfo()
Dim rs
Set rs = oblog.execute("select * from oblog_user where userid=" & oblog.l_uid)
%>
<script language="javascript">
	function getImg(){
		if (document.oblogform.ico.value==""){
			document.oblogform.imgIcon.src="images/ico_default.gif";
		}
		else{
			document.oblogform.imgIcon.src=document.oblogform.ico.value;
			}
		
		}
	
</script>

<div id="dTab13" class="Box">
<form name="oblogform" action="user_setting.asp" method="post">
	<table  class="dTab13_body" align="center" border="0" cellpadding="0" cellspacing="1">
	  <tr>
		<td class="dTab13_body_td">用户id：</td>
		<td><span class="user_id"><%=rs("userName")%></span></td>
		<td class="dTab13_body_td">等级</td>
		<td class="userlevel"><font color=red><%=oblog.l_Group(1,0)%></font>
		</td>
	  </tr>
	  <tr>
		<td class="dTab13_body_td">选择头像：</td>
		<td colspan="3"><div class="user_face"><img src="<%=Ob_IIF(rs("user_icon1"),"images/ico_default.gif")%>" id="imgIcon" width=<%=C_UserIcon_Width%> height=<%=C_UserIcon_Width%>>
		只支持jpg、gif、png，小于50k，默认尺寸为48*48
		<p><iframe id="d_file" frameborder="0" src="upload.asp?tMode=9&re=" width="300" height="60" scrolling="no"></iframe></p>
		<p>图片地址：<input name="ico"  type="text" value="<%=oblog.filt_html(rs("user_icon1"))%>" size="50" maxlength="200"  onblur="getImg();"></p></div></td>
	  </tr>
	  <tr>
		<td class="dTab13_body_td">昵称</td>
		<td colspan="3"><input name="nickname" type="text" value="<%=oblog.filt_html(rs("nickname"))%>" size="30" maxlength="20" /><input type="hidden" name="o_nickname" value="<%=oblog.filt_html(rs("nickname"))%>" /></td>
	  </tr>
	  <tr>
		<td class="dTab13_body_td">真实姓名</td>
		<td><input name="truename"   type="text" value="<%=oblog.filt_html(rs("truename"))%>" size="30" maxlength="20" /></td>
		<td class="dTab13_body_td">性别</td>
		<td><input type="radio" value="1" name="sex" <%if rs("Sex")=1 then response.write "checked"%> />
        男 &nbsp;&nbsp; <input type="radio" value="0" name="sex" <%if rs("Sex")=0 then response.write "checked"%> />女</td>
	  </tr>
	  <tr>
		<td class="dTab13_body_td">出生日期</td>
		<td>
        <input value="<%=year(rs("birthday"))%>" name="y" size="4" maxlength="4" />年
        <input value="<%=month(rs("birthday"))%>" name="m" size="2" maxlength="2" />月
        <input value="<%=day(rs("birthday"))%>"  name="d" size="2" maxlength="2" />日
		</td>
		<td class="dTab13_body_td">省/市</td>
		<td><%=oblog.type_city(rs("province"),rs("city"))%></td>
	  </tr>
	  <tr>
		<td class="dTab13_body_td">职业</td>
		<td><%oblog.type_job(rs("job"))%></td>
		<td class="dTab13_body_td">Email</td>
		<td><input name="Email" value="<%=oblog.filt_html(rs("userEmail"))%>" size="30" maxlength="50" /></td>
	  </tr>
	  <tr>
		<td class="dTab13_body_td">主页</td>
		<td colspan="3"><input maxlength="100" size="30" name="homepage" value="<%=oblog.filt_html(rs("Homepage"))%>" /></td>
	  </tr>
	  <tr>
		<td class="dTab13_body_td">QQ号码</td>
		<td><input name="qq" value="<%=oblog.filt_html(rs("qq"))%>" size="30" maxlength="20" /></td>
		<td class="dTab13_body_td">MSN</td>
		<td><input name="msn" value="<%=oblog.filt_html(rs("Msn"))%>" size="30" maxlength="50" /></td>
	  </tr>
	  <tr>
		<td class="dTab13_body_td">电话</td>
		<td><input name="tel" value="<%=oblog.filt_html(rs("tel"))%>" size="30" maxlength="50" /></td>
		<td class="dTab13_body_td">通信地址</td>
		<td><input name="address" value="<%=oblog.filt_html(rs("address"))%>" size="40" maxlength="250" /></td>
	  </tr>
	<%
	If oblog.cacheconfig(51)="1" Then
	
	If oblog.l_Group(34,0)=1 Then%>
		<tr>
			<td colspan="4"><font color=red><b>本站允许通过邮件和手机发布日志</b></font><BR/>在此处设置的邮箱或手机后,您可以通过这两种方式将需要发布的内容发送到<font color=red><%=oblog.CacheConfig(52)%></font>,系统将自动解析内容并进行发布
				<br/>此处的邮箱地址与手机号码均不在站点公开显示，手机号码目前只支持中国移动GSM号码,即135~139号段
				</td>
		  </tr>
		  <tr>
			<td class="dTab13_body_td">邮箱地址：</td>
			<td><input name="postmail" value="<%=oblog.filt_html(rs("postmail"))%>" size="40" maxlength="100" /></td>
			<td class="dTab13_body_td">手机号码：</td>
			<td><input name="postmobile" value="<%=oblog.filt_html(rs("postmobile"))%>" size="40" maxlength="13" /></td>
		  </tr>
	<%End If
	End If%>
	  <tr>
		<td colspan="4" align="center"><input name="action" type="hidden" value="saveuserinfo" />
        <input type="submit" value=" 更 新 " /></td>
	  </tr>
	</table>
     </form>
</div>

<%
Set rs = Nothing
End Sub

Sub saveuserinfo()
    Dim rs, nickname, email, birthday,usericon
    nickname = Trim(request("nickname"))
    email = Trim(request("email"))
    birthday = Trim(request("y")) & "-" & Trim(request("m")) & "-" & Trim(request("d"))
    usericon=Trim(request("ico"))
	If InStr(nickname,"$$$") > 0 Then oblog.adderrstr ("此昵称系统不允许注册！")
    'If oblog.chk_regname(nickname) Then oblog.adderrstr ("此昵称系统不允许注册！")
    If oblog.chk_badword(nickname) > 0 Then oblog.adderrstr ("昵称中含有系统不允许的字符！")
    If oblog.strLength(nickname) > 50 Then oblog.adderrstr ("昵称不能不能大于50字符！")
    '昵称唯一性判断
    If oblog.cacheConfig(47) = 1 And nickname <> "" And nickname <> Trim(request("o_nickname")) Then
        Set rs = oblog.execute("select userid from oblog_user where nickname='" & ProtectSQL(nickname) & "'")
        If Not rs.EOF Or Not rs.bof Then oblog.adderrstr ("系统中已经有这个昵称存在，请更改昵称！")
    End If
    If birthday = "--" Then
        birthday = ""
    Else
        If Not IsDate(birthday) Then oblog.adderrstr ("生日日期格式错误！")
        If CLng(Trim(request("y"))) > 2060 Then oblog.adderrstr ("生日年份过大！")
        If CLng(Trim(request("y"))) < 1900 Then oblog.adderrstr ("生日年份过小！")
    End If
    If email = "" Then oblog.adderrstr ("电子邮件地址不能为空！")
    If Not oblog.IsValidEmail(email) Then oblog.adderrstr ("电子邮件地址格式错误！")
    If oblog.cacheConfig(22) = "1" Then
        Set rs = oblog.execute("select COUNT(userid) from oblog_user where useremail='" & ProtectSQL(email) & "' and userid<>" & oblog.l_uid)
        If rs(0) > 0 Then 
			oblog.adderrstr ("系统中已经有这个Email存在，请更改Email！")
		End If
		rs.close
    End If
    Dim rsreg
'	If oblog.CacheConfig(47)="1" Then
'    	Set rsreg=oblog.execute("select Count(userid) From oblog_user Where nickname='" & nickname & "' and userid<>" & oblog.l_uid)
'    	If rsreg(0)>0 Then
'    		oblog.adderrstr  ("您使用的昵称: " & nickname & " 已被他人使用，请更换其他昵称")
'    	End If
'    	rsreg.Close
'	End If
	Set rsreg=Nothing
	'---------------------------------------
		'Plus: Mail to Blog Start
		Dim sMail,sMobile,rstMail
		If oblog.cacheconfig(51)="1" Then
			If oblog.l_Group(34,0)="1" Then
				sMail=Trim(Request("postmail"))
				If  sMail<>"" Then
					if not oblog.IsValidEmail(sMail) then oblog.adderrstr("发布邮箱地址格式错误！")
				End If
				sMobile=Trim(Request("postmobile"))
				If  sMobile<>"" Then
					If Len(sMobile) = 11 And IsNumeric(sMobile) Then
						If CInt(Left(sMobile, 3)) >= 134 And CInt(Left(sMobile, 3)) <= 139 Or CInt(Left(sMobile, 3)) = 159 Then
							'bMobile = True
						Else
							oblog.adderrstr("您输入的手机号码错误或者系统暂不支持！")
						End If
					Else
						oblog.adderrstr("您输入的手机号码错误或者系统暂不支持！")
					End If
				End If
				
				set rstMail=server.CreateObject("adodb.recordset")
				'判断Mail是否重复
				If  sMail<>"" Then
					rstMail.open "select * from oblog_user where postmail='" & LCase(Trim(sMail)) & "' And Userid<>" & oblog.l_uid,conn,1,1
					If Not rstMail.Eof Then
						oblog.adderrstr(sMail & " 已经被使用,请更换发布邮箱!" )
					End If
					rstMail.Close
				End If
				'判断手机号码是否重复
				If  sMobile<>"" Then
					rstMail.open "select * from oblog_user where postMobile='" & sMobile & "' And Userid<>" & oblog.l_uid,conn,1,1
					If Not rstMail.Eof Then
						oblog.adderrstr(sMobile & " 已经被使用,请更换发布号码!" )
					End If
					rstMail.Close
				End If
			End If
		End if
		Set rstMail=Nothing
		'Plus: Mail to Blog End
		'---------------------------------------
    If oblog.errstr <> "" Then oblog.showusererr: Exit Sub
    Set rs = server.CreateObject("adodb.recordset")
    rs.open "select * from oblog_user where userid=" & oblog.l_uid, conn, 1, 3
    If Not rs.EOF Then
		If API_Enable Then 
			  Dim blogAPI
			  Set blogAPI = New DPO_API_OBLOG
			  blogAPI.LoadXmlFile True
			  blogAPI.UserName=rs("UserName")
			  blogAPI.EMail=Email
			  blogAPI.Sex=clng(request("sex"))
			  blogAPI.QQ=oblog.filt_astr(request("qq"),20)
			  blogAPI.MSN=oblog.filt_astr(request("msn"),50)
			  blogAPI.truename=oblog.filt_astr(request("truename"),20)
			  If birthday <> "" Then blogAPI.birthday=birthday
			  blogAPI.telephone=oblog.filt_astr(request("tel"),50)
			  blogAPI.homepage=oblog.filt_astr(request("homepage"),100)
			  blogAPI.province=oblog.filt_astr(request("province"),18)
			  blogAPI.city=oblog.filt_astr(request("city"),18)
			  blogAPI.address=oblog.filt_astr(request("address"),250)
			  Call blogAPI.ProcessMultiPing("update")
			  Set blogAPI=Nothing
		End If
        rs("nickname") = oblog.filt_astr(nickname, 50)
        rs("truename") = oblog.filt_astr(request("truename"), 20)
        rs("sex") = CLng(request("sex"))
        rs("province") = oblog.filt_astr(request("province"),20)
        rs("city") = oblog.filt_astr(request("city"),20)
        If birthday <> "" Then rs("birthday") = oblog.filt_astr(birthday,20)
        rs("job") = oblog.filt_astr(request("job"),20)
        rs("useremail") = oblog.filt_astr(email, 50)
        rs("homepage") = oblog.filt_astr(request("homepage"), 100)
        rs("qq") = oblog.filt_astr(request("qq"), 20)
        rs("msn") = oblog.filt_astr(request("msn"), 50)
        rs("tel") = oblog.filt_astr(request("tel"), 50)
        rs("address") = oblog.filt_astr(request("address"), 250)
        rs("user_icon1") = RemoveHtml(oblog.filt_html(oblog.filt_astr(request("ico"),200)))
		If oblog.cacheconfig(51)="1" Then
			If oblog.l_Group(34,0)="1" Then
				rs("postmail")=oblog.filt_astr(request("postmail"),100)
				rs("postmobile")=oblog.filt_astr(request("postmobile"),13)
			End If
		End if
        rs.Update
        rs.Close
    End If
    Set rs = Nothing
	Session ("CheckUserLogined") = ""
    oblog.showok "保存资料成功!", ""
End Sub
%>