📄 usercp.asp
字号:
<%
rs2.movenext
next
End if
rs2.close
set rs2 = nothing
%>
</table></td>
</tr>
</table>
<br>
<br>
<%
End Sub
'============================================
Sub Saveprofile()
if user_group(6) <> True then
ShowMsg "<b>错误:</b>对不起,论坛禁止编辑个人资料,请联系管理员!~<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
'-------------------------------------------------------------
email = Replace(trim(request.Form("email")),"'","")
if Instr(4,Email,".") < 1 then Emailtrue = 1
if Instr(2,Email,"@") < 1 then Emailtrue = 1
if Len(Email) < 9 then Emailtrue = 1
if Emailtrue = 1 then
ShowMsg "<b>错误:</b>请输入正确的 Email<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
'--------------------------------------------------------
if BBS_Config(10)=true then
set rs1 = Conn.ExeCute("select email from JBB_user where email='"& email &"' and userid <> "&userid)
if Not(rs1.Eof and rs1.Bof) then
set rs1 = Nothing
ShowMsg "对不起,本论坛已经限制了一个Email只能一个帐号使用,请重新输入您的Email。<br><br><a href=""javascript:history.back()""><<< 返回上一步</a>~"
Call Bottom
response.End
End if
set rs1 = Nothing
End if
'--------------------------------------------------------
birthday = request.Form("year")&"-"&request.Form("month")&"-"&request.Form("day")
oicq = replace(trim(request.Form("oicq")),"'","")
styleid = trim(request.Form("styleid"))
if trim(request.Form("My_avatars")) = 1 then
avatars2 = replace(trim(request.Form("avatars2")),"'","")
if Len(avatars2) < 5 then
ShowMsg "<b>错误:</b>您选择了自定义头像,请输入头像URL或者上传您的头像!<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
avatars_width = trim(request.form("avatars_width"))
avatars_height = trim(request.form("avatars_height"))
if Not(isNumeric(avatars_width&avatars_height)) then
ShowMsg "<b>错误:</b>头像宽度与高度均只可为数字!<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
if Cstr(avatars_width) > 120 Or Cstr(avatars_width) < 30 or Cstr(avatars_height) > 120 Or Cstr(avatars_height) < 30 then
ShowMsg "<b>错误:</b>头像宽度与高度不可大于120,不可小于30,请重新输入头像宽度与高度!<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
End if
set rs = server.CreateObject("adodb.recordset")
rs.open "select styleid from JBB_user where userid="&userid ,conn,1,1
if Not(rs.eof and rs.bof) then
if styleid <> rtrim(rs("styleid")) then
response.Cookies(JBBMasterCookies)("styleid") = styleid
End if
else
rs.close
set rs = Nothing
loginform "登录信息错误,请重新登录!~"
Call Bottom
response.End
End if
rs.close
set rs = Nothing
sqlStr = "update JBB_user set usertitle='"& replace(trim(request.Form("usertitle")),"'","''") &"'"
sqlStr = sqlStr + ",email='"&email &"'"
sqlStr = sqlStr + ",showemail="& request.Form("showemail")
sqlStr = sqlStr + ",styleid="&styleid
sqlStr = sqlStr + ",homepage='"& replace(trim(request.Form("homepage")),"'","") &"'"
if IsNumeric(oicq) then
sqlStr = sqlStr + ",oicq="& oicq
End if
sqlStr = sqlStr + ",msn='"& replace(trim(request.Form("msn")),"'","") &"'"
if IsDate(birthday) then
sqlStr = sqlStr + ",birthday='"& birthday &"'"
End if
sqlStr = sqlStr + ",usersex="& request.Form("usersex")
sqlStr = sqlStr + ",useradd='"& replace(trim(request.Form("useradd")),"'","''") &"'"
sqlStr = sqlStr + ",signature='"& replace(rtrim(request.Form("signature")),"'","''") &"'"
if trim(request.Form("My_avatars")) = 1 then
sqlStr = sqlStr + ",avatars='"& avatars2 &"'"
sqlStr = sqlStr + ",avatars_width="& avatars_width
sqlStr = sqlStr + ",avatars_height="& avatars_height
else
sqlStr = sqlStr + ",avatars='"& request.Form("avatars") &"'"
End if
sqlStr = sqlStr + ",My_avatars="& request.Form("My_avatars")
sqlStr = sqlStr + " where userid="&cint(userid)
Conn.execute(sqlStr)
ShowMsg "感谢更新,您的个人资料修改成功!~"
End Sub
'============================================
Sub editprofile()
if user_group(6) <> True then
ShowMsg "<b>错误:</b>对不起,论坛禁止编辑个人资料,请联系管理员!~<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
'-------------------------------------------------------------
set rsuser = server.CreateObject("adodb.recordset")
rsuser.open "select usertitle,email,showemail,styleid,homepage,oicq,msn,birthday,usersex,useradd,signature,avatars,My_avatars,avatars_width,avatars_height from JBB_user where username='"& username &"' and userpass = '"& trim(request.Cookies(JBBMasterCookies)("userpass")) &"' and userid="&userid,conn,1,1
if Not(rsuser.eof and rsuser.bof) then
%>
<script language="javascript">
<!--
function isok(theform)
{
if (theform.email.value.length<5|theform.email.value.indexOf("@")==-1|theform.email.value.indexOf(".")==-1)
{alert("请输入正确的Eail地址!");
theform.email.focus( );
return(false);}
return (true);
}
-->
</script>
<form name="myform" method="post" action="?action=Saveprofile" onsubmit="return isok(this)">
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td class="table-dark"><font color="#FF0000">*</font>
Email</td>
<td class="table-dark"><input name="email" type="text" id="email" value="<%=rtrim(rsuser("email"))%>"></td>
</tr>
<tr class="table-light">
<td width="35%">在个人资料中显示Email?</td>
<td>是
<input name="showemail" type="radio" value="1" <%if rsuser("showemail") then response.Write("checked")%>>
否
<input type="radio" name="showemail" value="0" <%if Not(rsuser("showemail")) then response.Write("checked")%>></td>
</tr>
<tr class="table-dark">
<td>用户头衔</td>
<td>
<input name="usertitle" type="text" id="usertitle" value="<%=rtrim(rsuser("usertitle"))%>"></td>
</tr>
<tr class="table-light">
<td valign="top">个性头像</td>
<td>
<table width="400" border="0" cellpadding="4" cellspacing="1">
<tr>
<td width="171"> <select name="avatars" size="8" onChange="document.images['avatars'].src=options[selectedIndex].value;">
<option value="images/avatars/guestavatar.gif">noavatar.gif</option>
<%
set rspic = server.CreateObject("adodb.recordset")
rspic.open "select pic_Name From JBB_avatars order By id asc",conn,1,1
if not rspic.eof then
for pic = 1 to rspic.recordCount
%>
<option value="images/avatars/<%=rspic(0)%>" <%if rtrim(rsuser("avatars")) = "images/avatars/"&rtrim(rspic(0)) then response.Write("selected") %>><%=rspic(0)%></option>
<%
rspic.MoveNext
Next'pic
End if
rspic.close
set rspic = nothing
%>
</select> </td>
<td width="104"><img src="<%=rtrim(rsuser("avatars"))%>" id="avatars"></td>
<td width="73"><a href="allface.asp" target="_blank">查看全部图像</a></td>
</tr>
</table></td>
</tr>
<tr class="table-dark">
<td valign="top">自定义头像</td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="23%">使用自定义头像?</td>
<td width="77%">是
<input name="My_avatars" type="radio" value="1" <%if rsuser("My_avatars") then response.Write("checked")%>>
否
<input type="radio" name="My_avatars" value="0" <%if Not(rsuser("My_avatars")) then response.Write("checked")%>>
</td>
</tr>
<tr>
<td>自定义头像URL</td>
<td>
<%
if rsuser("My_avatars") then
avatars2 = rtrim(rsuser("avatars"))
End if
%>
<input name="avatars2" type="text" id="avatars22" value="<%=avatars2%>" size="28"></td>
</tr>
<tr>
<td>宽度 (30-120)</td>
<td>
<input name="avatars_width" type="text" id="avatars_width2" value="<%=rtrim(rsuser("avatars_width"))%>" size="3" maxlength="3"></td>
</tr>
<tr>
<td>高度 (30-120)</td>
<td>
<input name="avatars_height" type="text" id="avatars_height2" value="<%=rtrim(rsuser("avatars_height"))%>" size="3" maxlength="3"></td>
</tr>
<tr>
<td>上传自定义头像</td>
<td><iframe name="ad" frameborder=0 width=100% height=24 scrolling=no src="up.asp?Folder=avatars&uptype=avatars&bgcolor=<%=replace(table_light_color,"#","")%>"></iframe></td>
</tr>
</table></td>
</tr>
<tr class="table-light">
<td>论坛风格<br>
选择一个你喜欢的配色方案 </td>
<td> <select name="styleid" id="styleid">
<%
set rs = server.CreateObject("adodb.recordset")
rs.open "select styleid,stylename from JBB_style",conn,1,1
if Not(rs.Bof and rs.Eof) then
for s = 1 to rs.recordCount
%>
<option value="<%=rs(0)%>" <%if Cstr(rs(0)) = Cstr(rsuser("styleid")) then response.Write("selected")%>><%=rtrim(rs(1))%></option>
<%
rs.MoveNext
Next's
End if
rs.close
set rs = nothing
%>
</select></td>
</tr>
<tr class="table-title">
<td colspan="2">选填信息 下面这些信息将被 友盟论坛 会员看到.</td>
</tr>
<tr class="table-dark">
<td>生日</td>
<td>
<%
birthday = trim(rsuser("birthday"))
if IsDate(birthday) then
B_year = year(birthday)
B_month = month(birthday)
B_day = day(birthday)
End if
%> <input name="year" type="text" id="year" value="<%=B_year%>" size="5" maxlength="4">
<font size="2">年</font> <input name="month" type="text" id="month" value="<%=B_month%>" size="3" maxlength="2">
<font size="2">月</font> <input name="day" type="text" id="day" value="<%=B_day%>" size="3" maxlength="2">
日</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -