📄 mypanel.asp
字号:
document.form.UserMail.focus();
return false;
}
if (document.form.Userpass.value != document.form.Userpass2.value)
{
alert("您二次键入的新密码不同!");
document.form.Userpass.focus();
return false;
}
return true;
}
</script>
<%
end sub
sub add
if UserName="" then Error2("请输入您要添加的好友名字!")
if LCase(UserName)=LCase(CookieUserName) then Error2("不能添加自己!")
if Conn.Execute("select id from [WxUsers] where UserName='"&UserName&"'" ).Eof Then Error2("该用户不存在")
sql="select UserFriend from [WxUsers] where Username='"&CookieUserName&"'"
Rs.Open sql,Conn,1,3
master=split(""&Rs("UserFriend")&"","|")
if UBound(master) > 15 then Error2("系统允许最多添加15个好友,您已经达到上限")
if instr(Rs("UserFriend"),"|"&UserName&"|")>0 then Error2("此好友已经添加!")
Rs("UserFriend")=Rs("UserFriend")&UserName&"|"
Rs.update
Rs.close
Response.redirect "MyPanel.asp?menu=Friend"
end sub
sub Del
sql="select UserFriend from [WxUsers] where Username='"&CookieUserName&"'"
Rs.Open sql,Conn,1,3
Rs("UserFriend")=Replace(Rs("UserFriend"),"|"&UserName&"|","|")
Rs.update
Rs.close
Response.redirect "MyPanel.asp?menu=Friend"
end sub
sub Post
top "发送短讯",false%>
<iframe class="frame" src="" name="Temp"></iframe>
<form name="PostSms" action="MyPanel.asp" method="post" target="Temp">
<input type="hidden" name="menu" value="addPost" />
<input type="hidden" name="ParentID" value="<%=ParentID%>" />
<div class="tc b cb">
<div class="fl r w2 si">收件人</div>
<div class="fl si"><input type="text" name="incept" size="20" value="<%=incept%>" />
</div>
</div>
<div class="tc b cb">
<div class="fl r w2 t">内容<br />内容限制200字</div>
<div class="fl t"><textarea name="content" rows="1" cols="1" style="width:300px;"><%=HTMLEncode(Request("body"))%></textarea></div>
</div>
<div class="tc b cb">
<div class="fl r w2 t">聊天记录</div>
<div class="fl t">
<%
sql="select * from [WxSms] where (UserName='"&CookieUserName&"' and incept='"&incept&"') or (UserName='"&incept&"' and incept='"&CookieUserName&"') order by id Desc"
Set Rs=Conn.Execute(sql)
do while Not Rs.Eof
content=content&"<font color=red>("&Rs("DateCreated")&") "&Rs("UserName")&"</font><br /><font color=0000FF>"&Rs("content")&"</font><br />"
Rs.MoveNext
loop
Rs.close
if content="" then content="(空)"
Response.write content
%>
</div>
</div>
<div class="tc ac"><input type="submit" id="submit" value=" 确 定 " /></div>
</form>
<%
CloseDataBase
end sub
sub addPost
top "发送短讯",false
if incept="" then Alert("请输入收件人")
if Len(Request.Form("content"))<2 then Alert("内容不能小于 2 字符")
if Conn.Execute("select id from [WxUsers] where UserName='"&incept&"'" ).Eof Then Alert("用户 "&incept&" 不存在")
AcceptNum=Conn.Execute("select count(Incept) from [WxSms] where Incept='"&incept&"'")(0)
if AcceptNum>MaxSms then Alert("对方的收件箱已满!\n\n请以其他方式告知对方清理收件箱!")
SendNum=Conn.Execute("select count(Incept) from [WxSms] where Incept='"&CookieUserName&"'")(0)
if SendNum>MaxSms Then Alert("您的收件箱已满!\n\n请清理收件箱后再使用本功能!")
sql="insert into [WxSms](UserName,incept,content,ParentID) values ('"&CookieUserName&"','"&incept&"','"&HTMLEncode(Request.Form("content"))&"',"&ParentID&")"
Conn.Execute(SQL)
if LCase(incept)<>LCase(CookieUserName) then Conn.Execute("update [WxUsers] set NewMessage=NewMessage+1 where UserName='"&incept&"'")
Response.write "<script type='text/javascript'>alert('您的短讯发送成功!');parent.ShadeDiv.Close();</script>"
CloseDataBase
end sub
sub Friendindex
sql="select UserName from [WxUsersOnline] where Eremite=0"
Set Rs=Conn.Execute(sql)
Do While Not Rs.Eof
OnlineUserList=OnlineUserList&""&Rs("UserName")&"|"
Rs.MoveNext
loop
Rs.close
%>
<script type="text/javascript">
var Onlinelist= "<%=Onlinelist%>";
function add(){
var id=prompt("请输入您要添加的好友名称!","");
if(id){
document.location='MyPanel.asp?menu=add&UserName='+id+'';
}
}
</script>
<div class="tb dt">
<form method="post" action="MyPanel.asp?menu=Del">
<div id="tt">我的好友</div>
<div class="intro cb">
<div class="fl r w2">昵称</div>
<div class="fl r w2">Email</div>
<div class="fl r w0">主页</div>
<div class="fl r w0">个人帖子</div>
<div class="fl r w0">短讯</div>
<div class="fl r w0">状态</div>
<div class="fl w0">操作</div>
</div>
<%
On Error Resume Next '找不到好友资料时候忽略错误
sql="select UserFriend,Userface from [WxUsers] where Username='"&CookieUserName&"'"
Set Rs=Conn.Execute(sql)
master=split(Rs("UserFriend"),"|")
for i = 1 to UBound(master)-1
Set Rs1=Conn.Execute("[WxUsers] where UserName='"&master(i)&"'")
Usermail=Rs1("Usermail")
Userhome=Rs1("Userhome")
Set Rs1 = Nothing
%>
<div class="tc b cb">
<div class="fl ac r w2 si"><a href="User.asp?Name=<%=master(i)%>"><%=master(i)%></a></div>
<div class="fl ac r w2 si"><a href="Mailto:<%=Usermail%>"><%=Usermail%></a></div>
<div class="fl ac r w0 si"><a href="<%=Userhome%>" target="_blank"><img alt='' src="Images/home.gif" /></a></div>
<div class="fl ac r w0 si"><a href="View.asp?menu=5&UserName=<%=master(i)%>" target=_blank><img alt='' src="Images/finds.gif" /></a></div>
<div class="fl ac r w0 si"><a onclick="return ShowModal('发送讯息','MyPanel.asp?menu=Post&incept=<%=master(i)%>');"><img alt='' src="Images/message.gif" /></a></div>
<div class="fl ac r w0 si"><%if instr("|"&OnlineUserList&"","|"&master(i)&"|")>0 then%> 在 线 <%else%> 离 线 <%end if%></div>
<div class="fl ac w0 si"><input type="radio" name="UserName" value="<%=master(i)%>" /></div>
</div>
<%
next
Rs.close
%>
<div class="tc"><input type="button" id="submit" onclick="javascript:add();" value="添加好友" /><input type="submit" id="cancel" onclick="return confirm('确定删除选定的好友吗?');" value="删除" /></div>
</form>
</div>
<%HtmlEnd
end sub
sub UpFiles
sql="[WxUpFiles] where UserName='"&CookieUserName&"'"
Rs.Open ""&sql&" order by id Desc",Conn,1
TotalCount=Conn.Execute("select count(ID) From "&sql&"")(0) '获取数据数量
PageSetup=20 '设定每页的显示数量
TotalPage=Abs(Int(TotalCount/PageSetup*(-1))) '总页数
PageCount = cint(Request.QueryString("PageIndex")) '获取当前页
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if TotalPage>1 then Rs.Move (PageCount-1) * pagesetup
TotalUserPostAttachments=Conn.Execute("select sum(ContentSize) from "&sql&"")(0)
if Cache("Maxup") then
MaxAffixSize=Conn.Execute("select Maxup from [WxRoles] where id="&UserRoleID)(0)
else
MaxAffixSize=int(Cache("MaxAffixSize"))
end if
if ""&TotalUserPostAttachments&""="" then TotalUserPostAttachments=0
BytesUsed=int(TotalUserPostAttachments/MaxAffixSize*100)
%>
<div class="tb">
<div id="tt">您的上传空间使用情况:已使用 <%=BytesUsed%>% 共 <%=CheckSize(""&TotalUserPostAttachments&"")%>,剩余 <%=CheckSize((MaxAffixSize-TotalUserPostAttachments))%></div>
<form method="post" name="form" action="?menu=DelPostAttachment">
<div class="intro cb">
<div class="fl ac r w0a"><input type="checkbox" name="chkall" onclick="CheckAll(this.form)" value="ON" /></div>
<div class="fl ac r w1a">文件名称</div>
<div class="fl ac r w0">文件大小</div>
<div class="fl ac r w2">文件类型</div>
<div class="fl ac r w2">上传时间</div>
<div class="fl ac r w1a">描述</div>
<div class="fl ac w0c">来源</div>
</div>
<%
i=0
Do While Not Rs.Eof and i<PageSetup
i=i+1
%>
<div class="tc b cb">
<div class="fl ac r i w0a"><input type="checkbox" name="ID" value="<%=Rs("id")%>" /></div>
<div class="fl ac r i w1a"><a target="_blank" href="<%=Rs("FilePath")%>"><%=Rs("FileName")%></a></div>
<div class="fl ac r i w0 small"><%=CheckSize(Rs("ContentSize"))%></div>
<div class="fl ac r i w2 small"><%=Rs("ContentType")%></div>
<div class="fl ac r i w2 small"><%=Rs("Created")%></div>
<div class="fl ac r i w1a small"><%=Rs("Description")%></div>
<div class="fl ac i w0c small"><%=Rs("Class")%></div>
</div>
<%
Rs.MoveNext
loop
Rs.Close
%>
<div class="tc cb">
<div class="fl"><input type="submit" id="submit" value="删 除" /></div>
<div class="fr ar"><%ShowPage()%></div>
</div>
</form>
</div>
<%
end sub
sub MsgManage
sql="select * from [WxSms] where incept='"&CookieUserName&"' order by id Desc"
sqls="select * from [WxSms] where UserName='"&CookieUserName&"' order by id Desc"
UseInBox=Conn.Execute("select count(ID) from [WxSms] where incept='"&CookieUserName&"'")(0)
UseOutBox=Conn.Execute("select count(ID) from [WxSms] where UserName='"&CookieUserName&"'")(0)
UsePercent=int((UseInBox+UseOutBox)/MaxSms*100)
%>
<div class="cb">
<div id="sidebar" class="fl tb w1a">
<div id="tt">信箱</div>
<div class="tc"><img alt='' src="Images/i_inbox.gif" align="absmiddle" /> <a href="MyPanel.asp?menu=Msg">收件箱</a>[<b><%=UseInBox%></b>]</div>
<div class="tc"><img alt='' src="Images/i_sent.gif" align="absmiddle" /> <a href="MyPanel.asp?menu=Msg&send=1">已发送</a>[<b><%=UseOutBox%></b>]</div>
</div>
<div id="mainarea" class="fl">
<%
IsSend=ChkNumeric(Request.QueryString("send"))
if ChkNumeric(Request("read"))=1 Then
id=ChkNumeric(Request("id"))
if NewMessage>0 then Conn.Execute("update [WxUsers] set NewMessage=0 where Username='"&CookieUserName&"'")
sqlr="select * from [WxSms] where id="&id
Rs.Open sqlr,Conn,1
if LCase(Rs("UserName"))=LCase(CookieUserName) Then
UserName=CookieUserName
Incept=Rs("Incept")
ElseIf LCase(Rs("Incept"))=LCase(CookieUserName) Then
UserName=Rs("UserName")
Incept=CookieUserName
Else
Error 6,"<li>非法操作</li>"
end if
%>
<div class="tb">
<div id="tt"><a onclick="return ShowModal('发送讯息','MyPanel.asp?menu=Post&FriendList=1');"><img alt="" src="Images/i_new_msg.gif" align="absmiddle" />新建</a> <a href="?menu=DelMsg&id=<%=id%>" onclick="return window.confirm('您确定执行本次操作?');"><img alt="" src="Images/i_delete.gif" align="absmiddle" />删除</a><%if LCase(UserName)<>LCase(CookieUserName) then%> <img alt="" src="Images/i_reply.gif" align="absmiddle" /><a onclick="return ShowModal('回复讯息','MyPanel.asp?menu=Post&Incept=<%=UserName%>&id=<%=id%>');">回复</a><%end if%></div>
<div class="tc b cb">
<div class="fl i">
发件人:<%=Rs("UserName")%><%if LCase(Rs("UserName"))<>LCase(CookieUserName) then%> [<a href="MyPanel.asp?menu=add&UserName=<%=Rs("UserName")%>" target=_blank>+添加好友</a>]<%end if%><br />
收件人:<%=Rs("Incept")%><%if LCase(Rs("Incept"))<>LCase(CookieUserName) then%> [<a href="MyPanel.asp?menu=add&UserName=<%=Rs("Incept")%>" target=_blank>+添加好友</a>]<%end if%><br />
</div>
<div class="fr i">
<%=Rs("DateCreated")%>
</div>
</div>
<div class="tc cb">
<%=Rs("Content")%>
</div>
</div>
<%else%>
<div class="tb">
<form method="post" name="showMessage" action="?menu=DelMsg">
<div id="tt"><a onclick="return ShowModal('发送讯息','MyPanel.asp?menu=Post&FriendList=1');"><img alt="" src="Images/i_new_msg.gif" align="absmiddle" />新建</a> <a onclick="if(window.confirm('您确定执行本次操作?')){document.showMessage.submit();}"><img alt="" src="Images/i_delete.gif" align="absmiddle" />删除</a></div>
<div class="intro cb">
<div class="fl ac r w0c"><input type="checkbox" name="chkall" onClick="CheckAll(this.form)" value="ON" /></div>
<div class="fl ac r w1a"><%if IsSend=1 Then%>收件人<%else%>发件人<%end if%></div>
<div class="fl ac r w4">主题</div>
<div class="fl ac r w2">日期</div>
<div class="fl ac w0">大小</div>
</div>
<%
if IsSend=1 then
Rs.Open sqls,Conn,1
UserRec="incept"
Else
Rs.Open sql,Conn,1
UserRec="UserName"
end if
PageSetup=10 '设定每页的显示数量
Rs.Pagesize=PageSetup
TotalPage=Rs.Pagecount '总页数
PageCount = cint(Request.QueryString("PageIndex"))
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if TotalPage>0 then Rs.absolutePage=PageCount '跳转到指定页数
i=0
Do While Not Rs.Eof and i<PageSetup
i=i+1%>
<div class="tc b cb">
<div class="fl ac r si w0c"><input type="checkbox" value="<%=Rs("ID")%>" name="ID" /></div>
<div class="fl ac r si w1a"><%=Rs(UserRec)%></div>
<div class="fl r si w4 small"><a href="MyPanel.asp?menu=Msg&read=1&ID=<%=Rs("ID")%>"><%=Rs("Content")%></a></div>
<div class="fl ac r si w2 small"><%=Rs("DateCreated")%></div>
<div class="fl ac si w0 small"><%=CheckSize(Len(Rs("Content")))%></div>
</div>
<%
Rs.MoveNext
loop
Rs.Close%>
<div class="tc"><%ShowPage()%></div>
</form><%end if%>
</div>
<%
end sub
HtmlEnd%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -