📄 usercp.asp
字号:
</tr>
<tr class="table-light">
<td>姓别</td>
<td class="table-light"><select name="usersex" id="usersex">
<%
usersex = trim(rsuser("usersex"))
%>
<option value="1" <%if usersex = 1 then response.Write("selected")%>>男</option>
<option value="2" <%if usersex = 2 then response.Write("selected")%>>女</option>
<option value="3" <%if usersex = 3 then response.Write("selected")%>>保密</option>
</select></td>
</tr>
<tr class="table-dark">
<td>来自</td>
<td><input name="useradd" type="text" id="useradd" value="<%=rtrim(rsuser("useradd"))%>" size="35"></td>
</tr>
<tr class="table-light">
<td>个人主页</td>
<td><input name="homepage" type="text" id="homepage" value="<%=rtrim(rsuser("homepage"))%>"></td>
</tr>
<tr class="table-dark">
<td>OICQ</td>
<td><input name="oicq" type="text" id="oicq" value="<%=rtrim(rsuser("oicq"))%>"></td>
</tr>
<tr class="table-light">
<td>MSN</td>
<td>
<input name="MSN" type="text" id="MSN" value="<%=rtrim(rsuser("msn"))%>">
</td>
</tr>
<tr class="table-dark">
<td valign="top">个性签名<br>
你可以选择使用个性签名,它将显示在你所发布的信息的底部.<br> </td>
<td>
<textarea name="signature" cols="35" rows="5" id="signature"><%=rtrim(rsuser("signature"))%></textarea>
</td>
</tr>
</table>
<br><center>
<input type="submit" name="Submit" value=" 修 改 ">
<input type="reset" name="Submit2" value="重置">
</center></form>
<br>
<br>
<%
End if
rsuser.close
set rsuser = nothing
End Sub
'============================================
Sub favorites()
set rs2 = server.CreateObject("adodb.recordset")
sql2 = "select JBB_favorite.*,JBB_thread.thread_title,JBB_thread.postuserid,JBB_thread.postusername,JBB_thread.lastpost,JBB_thread.lastposterid,JBB_thread.lastposter from JBB_favorite left join JBB_thread on(JBB_favorite.thread_ID=JBB_thread.threadID) where JBB_favorite.user_ID="&userid &" order BY JBB_thread.lastpost desc"
rs2.open sql2,conn,1,1
%>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td colspan="4" class="table-title"> 查看所有收藏文章 <%=rs2.recordCount&"/50"%></td>
</tr>
<tr>
<td class="table-title">主 题</td>
<td class="table-title">作 者</td>
<td class="table-title">最后回复</td>
<td class="table-title">
<div align="center">删除</div></td>
</tr>
<%
if Not(rs2.bof and rs2.eof) then
for ff = 1 to rs2.recordCount
%>
<tr>
<td class="table-dark"> <%
response.Write "<a href=""showthread.asp?threadid="& rs2("thread_id") &""" target=""_blank"">"& rtrim(rs2("thread_title")) &"</a>"
%> </td>
<td width="108" class="table-dark"> <%
if rs2("postuserID") <> 0 then
response.write"<a href=""user.asp?userID="& rs2("postuserID") &""" target=""_blank"">"& rtrim(rs2("postusername")) &"</a>"
else
response.Write("游客")
End if
%> </td>
<td class="table-dark"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90%"> <div align="right"><%=rs2("lastpost")%></div></td>
<td width="10" rowspan="2"><div align="right"><a href="showthread.asp?threadid=<%=rs2("thread_ID")%>&page=end#end"><img src="images/lastpost.gif" alt="转到最新回复" border="0"></a>
</div></td>
</tr>
<tr>
<td> <div align="right">
<%
if rs2("lastposterid") <> 0 then
response.write "<a href=""user.asp?userID="& rs2("lastposterid") &""" target=""_blank"">"& rtrim(rs2("lastposter")) &"</a>"
else
response.Write("游客")
End if
%>
</div></td>
</tr>
</table></td>
<td class="table-dark">
<div align="center"><a title = "将这篇文章从我的收藏列表中删除" href="Favorite.asp?action=del&Favoriteid=<%=rs2("Favoriteid")%>&threadid=<%=rs2("thread_id")%>" onClick="{if(confirm('您确定将这篇文章从您的收藏夹删除吗?')){return true;}return false;}">╳</a></div></td>
</tr>
<%
rs2.movenext
next
End if
%>
</table>
<br>
<%
rs2.close
set rs2 = nothing
End Sub
'============================================
Sub Savepass()
set rs = server.CreateObject("adodb.recordset")
sql = "select JBB_usergroup.editproinfo,JBB_usergroup.groupID,JBB_user.userid from JBB_usergroup INNER JOIN JBB_user On JBB_usergroup.groupID=JBB_user.usergroup where JBB_user.userid="&Cstr(userid) &" and JBB_user.username='"& username &"' and JBB_user.userpass='"& trim(request.Cookies(JBBMasterCookies)("userpass")) &"'"
rs.open sql,conn,1,1
if rs.eof or rs.bof then
editproinfo = false
else
if rs("editproinfo") then
editproinfo = true
End if
End if
rs.close
set rs = nothing
if editproinfo <> true then
ShowMsg "<b>错误:</b>对不起,论坛禁止编辑个人资料,请联系管理员!~<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
'-------------------------------------------------------------
oldpass = replace(trim(request.Form("oldpass")),"'","")
if oldpass = "" then
ShowMsg "<b>错误:</b>请输入您的原密码~<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
newpass = replace(trim(request.Form("newpass")),"'","")
if len(newpass) < 6 then
ShowMsg "<b>错误:</b>新密码不可为空并且不能少于 6 位!~<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
newpass2 = trim(request.Form("newpass2"))
if newpass2 <> newpass then
ShowMsg "<b>错误:</b>您两次输入的新密码不一致!<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
End if
set rs = server.CreateObject("adodb.recordset")
rs.open "select userpass,usergroup from JBB_user where userid="&Cstr(userid) &" and username='"& username &"' and userpass='"& md5(oldpass) &"'",conn,1,3
if rs.eof or rs.bof then
rs.close
set rs = Nothing
ShowMsg "<b>错误:</b>您输入的原密码不对!~请重新输入!~<br><br><a href=javascript:history.back()><<< 返回上一步</a>"
Call Bottom
response.End
else
rs("userpass") = md5(newpass)
rs.update
if rs("usergroup") = 1 then
Conn.ExeCute("update JBB_admin set adminpass = '"& md5(newpass) &"' where adminname = '"& username &"'")
End if
rs.close
set rs = nothing
response.Cookies(JBBMasterCookies)("userid") = ""
response.Cookies(JBBMasterCookies)("username") = ""
response.Cookies(JBBMasterCookies)("userpass") = ""
response.Cookies(JBBMasterCookies)("usergroup") = ""
ShowMsg "感谢更新,您的密码修改成功,请重新 <a href=""login.asp"">登录</a> 论坛!~"
Call Bottom
response.End
End if
End Sub
'============================================
Sub editpass()
%>
<script language="javascript">
<!--
function isok(theform)
{
if (theform.oldpass.value=="")
{
alert("请输入您的原密码!~");
theform.oldpass.focus();
return (false);
}
if (theform.newpass.value.length<6)
{
alert("新密码不能为空且至少6个字符!");
theform.newpass.focus();
return (false);
}
if (theform.newpass.value!=theform.newpass2.value)
{
alert("您两次输入的新密码不相符!");
theform.newpass2.focus();
return (false);
}
return (true);
}
-->
</script>
<form name="form1" method="post" action="?action=Savepass" onsubmit="return isok(this)">
<table width="400" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
<tr>
<td colspan="2" class="table-title"><strong>修改登录密码</strong></td>
</tr>
<tr>
<td width="117" class="table-light">
<font color="#FF0000">*</font>原密码</td>
<td width="264" class="table-light">
<input name="oldpass" type="password" id="oldpass" size="22" maxlength="16">
</td>
</tr>
<tr>
<td class="table-dark">
<font color="#FF0000">*</font>新密码</td>
<td class="table-dark">
<input name="newpass" type="password" id="newpass" size="22" maxlength="16"></td>
</tr>
<tr>
<td class="table-light">
<font color="#FF0000">*</font>重复新密码</td>
<td class="table-light">
<input name="newpass2" type="password" id="newpass2" size="22" maxlength="16"></td>
</tr>
<tr class="table-dark">
<td colspan="2"><font color="#FF0000"><strong>注意:</strong>密码修改完毕后您需要重新登录论坛!</font></td>
</tr>
</table>
<br><center>
<input type="submit" name="Submit3" value="确定修改">
<input type="reset" name="Submit4" value="重填">
</center>
</form><br>
<%
End Sub
'============================================
Call Bottom()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -