<% if Request.Cookies("username")=empty then error2("请登录后才能使用此功能!") incept=HTMLEncode(Request("incept")) username=HTMLEncode(Request("username")) select case Request("menu") case "add" add case "bad" bad case "del" del case "post" post case "look" look case "loadlog" loadlog case "addpost" addpost case "" index end select sub add if username="" then error2("请输入您要添加的好友名字!") if username=Request.Cookies("username") then error2("不能添加自己!") If conn.Execute("Select id from user where username='"&username&"'" ).eof Then error2("数据库不存在此用户的资料!") sql="select username,friend from user where username='"&Request.Cookies("username")&"'" rs.Open sql,Conn,1,3 if instr(rs("friend"),"|"&username&"|")>0 then error2("此好友已经添加!") rs("friend")=""&rs("friend")&""&username&"|" rs.update rs.close error2("已经成功添加好友!") end sub sub bad if Request.Cookies("username")=username then error2("不能把过滤自己!") Response.Cookies("badlist")=""&Request.Cookies("badlist")&""&username&"|" error2("已经成功将 "&username&" 过滤了!") end sub sub del sql="select username,friend from user where username='"&Request.Cookies("username")&"'" rs.Open sql,Conn,1,3 rs("friend")=replace(rs("friend"),"|"&username&"|","|") rs.update rs.close index end sub sub look top conn.execute("update user set newmessage=0 where username='"&Request.Cookies("username")&"'") page=Request("page") if page<1 then disabled="disabled=true" page=0 end if count=CInt(conn.execute("Select count(id)from message where incept='"&Request.Cookies("username")&"'")(0)) sql="select author,content from message where incept='"&Request.Cookies("username")&"' order by time Desc" Set Rs=Conn.Execute(sql) if Count-page<2 then disabled2="disabled=true" if rs.eof then error2("您没有短讯息!") RS.Move page %> 查看消息 -重症肌无力病友之家
 昵称:" size="8"> Email:" size="10"> >" width="32" height="32" alt=用户详细资料>
','_top','width=320,height=170')> onclick=javascript:open('friend.asp?menu=look&page=<%=page-1%>','_top','')> onclick=javascript:open('friend.asp?menu=look&page=<%=page+1%>','_top','')>
<% htmlend end sub sub loadlog sql="select * from message where (author='"&Request.Cookies("username")&"' and incept='"&incept&"') or (author='"&incept&"' and incept='"&Request.Cookies("username")&"') order by time Desc" Set Rs=Conn.Execute(sql) do while not rs.eof content=content&"("&rs("time")&")  "&rs("author")&"
"&rs("content")&"
" rs.movenext loop rs.close if content="" then content="(空)" %> <% end sub sub post top if incept="" then error2("对不起,您没有输入用户名称!") sql="select username,userface,usermail from user where username='"&incept&"'" Set Rs=Conn.Execute(sql) if rs.eof then error2("系统不存在该用户的资料") %> 发送消息 - 共享康复体验 ">
 昵称:" size="8"> Email:" size="10"> >" width="32" height="32" alt=用户详细资料>
<% rs.close htmlend end sub sub addpost if Len(Request.Form("content"))<2 then error2("内容不能小于 2 字符") if incept=Request.Cookies("username") then error2("不能给自己发送讯息!") If conn.Execute("Select id from user where username='"&incept&"'" ).eof Then error2("系统不存在"&incept&"的资料") sql="insert into message(author,incept,content,time) values ('"&Request.Cookies("username")&"','"&incept&"','"&HTMLEncode(Request.Form("content"))&"',now())" conn.Execute(SQL) conn.execute("update user set newmessage=newmessage+1 where username='"&incept&"'") %> 发送成功! <% end sub sub index top sql="select username from online where username<>''" Set Rs=Conn.Execute(sql) Do While Not RS.EOF onlinelist=""&onlinelist&""&rs("username")&"|" rs.movenext loop rs.close %> align=center cellspacing=1 cellpadding=4 class=a2>
   <%ClubTree%> → 控制面板

align=center border=0 class=a2>

<% on error resume next '找不到好友资料时候忽略错误 sql="select friend,userface from user where username='"&Request.Cookies("username")&"'" Set Rs=Conn.Execute(sql) master=split(rs("friend"),"|") for i = 1 to ubound(master)-1 usermail=Conn.Execute("Select usermail from user where username='"&master(i)&"'")(0) userhome=Conn.Execute("Select userhome from user where username='"&master(i)&"'")(0) %> <% next rs.close %>
昵称 邮件 主页 状态 发短信 操作
><%=master(i)%> ><%=usermail%> target=_blank><%=userhome%> 发送 name=username>
 
<% htmlend end sub responseend %>