<!--#include file="../setting/conn.asp"--><%:act=SoonBiz.ract:Select Case act:Case "readed" : readed :Case "del_s" : del_s:Case "del_r" : del_r:Case "slist" : slist :Case "rlist" : rlist :Case "creatnew", "", "isgood", "isbad", "reisgood", "reisbad" : creatnew :Case "remessage" : remessage :Case "savenew" : savenew :Case "recycle" : recycle :Case "remove" : remove :Case "removeall" : removeall :Case "restore" : restore :End Select:SoonBiz.adfoot:Setallnothing:Sub slist() :Dim readed:Dim shujun,astr,sql:Dim myfield :myfield=Trim(Request.QueryString("myfield"))
If Not SoonBiz.ins("title,nickname,content",myfield) Then
myfield="content"
End If:readed=SoonBiz.rid("readed"):sql="select * from ["& sheethead &"_shortmessage] where suid="& SoonBiz.user_id &" and isdel=0 and del_s=0 ":astr=SoonBiz.PlusSQL(sql,"?act=slist")
If readed>=0 Then 
astr(0)=astr(0) & " and readed="&readed:astr(1)=astr(1) & "&amp;readed="&readed:astr(2)=astr(2) & "CheckSel(""readed"","& readed &");"
End If:astr(0)=astr(0) & " order by id desc ":SoonBiz.title="我发送的短消息":SoonBiz.adhead:SoonBiz.nstate("我发送的短消息"):listfilter:shujun="<tr onmouseover=""this.style.backgroundColor='#e2e8f4';"" onmouseout=""this.style.backgroundColor='';"" align='center'> <td>{$id}</td> <td>{$rnickname}</td> <td align='left'>{$content}</td> <td><script type=""text/javascript"">isright({$readed});</script></td> <td>{$stime_short}</td> <td><input type='checkbox' name='id' value='{$id}'></td></tr>":Response.write "<table cellspacing=1 class=tableborder1>":Response.write "<form method=post action='?' name='myform' id=""myform"">":Response.write "<tr>":Response.Write "<th width=40>ID</th>":Response.write "<th width=80>接收人</th>" :Response.write "<th width='*'>内容</th>" :Response.write "<th width='30'>读</th>" :Response.write "<th width=60>时间</th>" :Response.write "<th width=40>选择</th>" :Response.write "</tr>":Response.Write SoonBiz.ReplaceMdb("",astr(0),shujun,"",0):Response.write "</table>":Response.write SoonBiz.PageList(""):Response.write "<div class='operate'>":Response.write "<input type='button' onClick='CheckAll(myform)' value='全选'> ":Response.write "<input type='button' onClick='ContraSel(myform)' value='反选'> ":Response.write "<input type='button' onClick=""Csubmit('myform','?act=del_s','确认删除吗')"" value='删除'> ":Response.Write "</div>":Response.Write "<script type='text/javascript'>"& astr(2) &"getobj(""myfield"").options[0]=null;</script>":End Sub:Sub rlist():Dim readed:Dim shujun,astr,sql:Dim myfield :myfield=Trim(Request.QueryString("myfield"))
If Not SoonBiz.ins("title,nickname,content",myfield) Then
myfield="content"
End If:readed=SoonBiz.rid("readed"):sql="select * from ["& sheethead &"_shortmessage] where ruid="& SoonBiz.user_id &" and isdel=0 and del_r=0":astr=SoonBiz.PlusSQL(sql,"?act=rlist")
If readed>=0 Then 
astr(0)=astr(0) & " and readed="&readed:astr(1)=astr(1) & "&amp;readed="&readed:astr(2)=astr(2) & "CheckSel(""readed"","& readed &");"
End If:astr(0)=astr(0) & " order by id desc ":SoonBiz.title="我收到的短消息列表":SoonBiz.adhead:SoonBiz.nstate("我收到的短消息列表"):listfilter:shujun="<tr onmouseover=""this.style.backgroundColor='#e2e8f4';"" onmouseout=""this.style.backgroundColor='';"" align='center'> <td>{$id}</td> <td>{$snickname}</td> <td align='left'>{$content}</td> <td><script type=""text/javascript"">isright({$readed});</script></td> <td>{$stime_short}</td> <td><a href='?act=remessage&rnickname={$snickname}&id={$id}' onclick='return showinnew(this,510,350)'>回复</a> </td> <td><input type='checkbox' name='id' value='{$id}'></td></tr>":Response.write "<table cellspacing=1 class=tableborder1>":Response.write "<form method=post action='?' name='myform' id='myform'>":Response.write "<tr>":Response.Write "<th width=40>ID</th>":Response.write "<th width=80>发送人</th>" :Response.write "<th width='*'>内容</th>" :Response.write "<th width='30'>读</th>" :Response.write "<th width=50>时间</th>" :Response.write "<th width=40>操作</th>" :Response.write "<th width=30>选择</th>" :Response.write "</tr>":Response.Write SoonBiz.ReplaceMdb("",astr(0),shujun,"",0):Response.write "</table>":Response.write SoonBiz.PageList(""):Response.write "<div class='operate'>":Response.write "<input type='button' onClick='CheckAll(myform)' value='全选'>&nbsp;":Response.write "<input type='button' onClick='ContraSel(myform)' value='反选'>&nbsp;":Response.write "<input type='button' onClick=""Csubmit('myform','?act=readed','')"" value='已读'>&nbsp;":Response.write "<input type='button' onClick=""Csubmit('myform','?act=del_r','确认删除吗')"" value='删除'>&nbsp;":Response.Write "</div>":Response.Write "<script type='text/javascript'>"& astr(2) &"getobj(""myfield"").options[1]=null;</script>":End Sub:Sub recycle():Dim shujun,astr(2):astr(0)="select * from ["& sheethead &"_shortmessage] where isdel=0 ":astr(0)=astr(0) & " and ((suid="& SoonBiz.user_id &" and del_s=1) or (ruid="& SoonBiz.user_id &" and del_r=1)) ":astr(0)=astr(0) & " order by id desc":SoonBiz.title="我的短消息回收站":SoonBiz.adhead:SoonBiz.nstate("我的短消息回收站"):shujun="<tr onmouseover=""this.style.backgroundColor='#e2e8f4';"" onmouseout=""this.style.backgroundColor='';"" align='center'> <td>{$id}</td> <td>{$snickname}</td> <td align='left'>{$content}</td> <td>{$stime_short}</td> <td><input type='checkbox' name='id' value='{$id}'></td></tr>":Response.write "<table cellspacing=1 class=tableborder1>":Response.write "<form method=post action='?' name='myform' id='myform'>":Response.write "<tr>":Response.Write "<th width=40>ID</th>":Response.write "<th width=80>发送人</th>" :Response.write "<th width='*'>内容</th>" :Response.write "<th width=60>时间</th>" :Response.write "<th width=40>选择</th>" :Response.write "</tr>":Response.Write SoonBiz.ReplaceMdb("",astr(0),shujun,"",0):Response.write "</table>":Response.write SoonBiz.PageList(""):Response.write "<div class='operate'>":Response.write "<input type='button' onClick='CheckAll(myform)' value='全选'> ":Response.write "<input type='button' onClick='ContraSel(myform)' value='反选'> ":Response.write "<input type='button' onClick=""Csubmit('myform','?act=restore','')"" value='恢复'> ":Response.write "<input type='button' onClick=""Csubmit('myform','?act=remove','确认要清楚选定的文件吗!')"" value='清除'> ":Response.write "<input type='button' onClick=""Csubmit('myform','?act=removeall','确定要清空回收站吗!')"" value='清空回收站'>":Response.Write "</div>":End Sub:Sub delshortmessage():Dim ids:ids=SoonBiz.rids():sql="update "& sheethead &"_shortmessage set del_s=1 where suid="& SoonBiz.user_id &" and id in ("&ids&")":SoonBiz.execute(sql):sql="update "& sheethead &"_shortmessage set del_r=1 where ruid="& SoonBiz.user_id &" and id in ("& ids &")":SoonBiz.execute(sql):SoonBiz.ok:End Sub:Sub del_s():Dim sql:SoonBiz.execute("update "& sheethead &"_shortmessage set del_s=1 where suid="& SoonBiz.user_id &" and id in ("&SoonBiz.rids&")"):SoonBiz.ok:End Sub:Sub del_r():SoonBiz.execute("update "& sheethead &"_shortmessage set del_r=1 where ruid="& SoonBiz.user_id &" and id in ("& SoonBiz.rids &")"):SoonBiz.ok:End Sub:Sub readed():Dim ids:Dim sql:ids=SoonBiz.rids:sql="update "& sheethead &"_shortmessage set readed=1 where readed=0 and ruid="&SoonBiz.user_id&" and id in ("&ids&")":SoonBiz.execute(sql):SoonBiz.ok:End Sub:Sub creatnew():Dim rnickname :Dim content:Dim jintong:jintong="<select name='' onchange='rnickname.value=this.value;' style='width:100px;'><option value="""">选择接收人</option>{$trhtml}</select>":Select Case act:Case "isgood","isbad":SoonBiz.Geturl:jintong=Replace(jintong,"{$trhtml}",adoption(classid))':theaftermust:attakemycame:)+'.:::make%
If act="isgood" Then
content="推荐地址:messageread.asp?u="& u &",推荐原因:"
Else:content="举报地址:messageread.asp?u="& u &",举报原因:"
End If:Case "reisgood","reisbad" :SoonBiz.Geturl:jintong=Replace(jintong,"{$trhtml}",adoption(classid))
If act="reisgood" Then
content="推荐地址:messageread.asp?u="& u &","& SoonBiz.rid("floor") &"楼的回复.推荐原因:"'#^*{"it:somebut:"he:'bothmost:":
Else:content="举报地址:messageread.asp?u="& u &","& SoonBiz.rid("floor") &"楼的回复.举报原因:"
End If:Case Else:rnickname=soonbiz.requeststr("收信息人昵称","rnickname","get",1,2,16,40,0):showerr(""):jintong=Replace(jintong,"{$trhtml}",ReceiveOption):End Select:SoonBiz.title="发送短消息":SoonBiz.adhead:SoonBiz.nstate("发送短消息"):Response.Write "<form method=""post"" name=""myform"" action=""?act=savenew"">":Response.Write "<table cellspacing=""1"" class=""tableborder1"">":Response.Write "<tr>":Response.Write "<th colspan=""2"">发送短消息</th>":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td width=""90"">收信息人昵称:</td>":Response.Write "<td>":Response.Write " <input type=""text"" name=""rnickname"" id=""rnickname"" size=""16"" maxlength=""16"" value="""& rnickname &""" />"&jintong:Response.Write "</td>":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td>消息内容:</td>":Response.Write "<td><textarea name=""content"" rows=""5"" cols=""10"" class=""inputtext"">"& content &"</textarea></td>":Response.Write "</tr>":Response.Write "</table>":Response.Write "<div class=""operate""><input type=""submit"" value=""发送"" /><div class=""viemessagehistory""><a href=""../user/user_shortmessage.asp?act=rlist"">查看消息记录</a></div></div>":Response.Write "</form>":End Sub:Sub remessage():SoonBiz.execute("update "& sheethead &"_shortmessage set readed=1 where id="&SoonBiz.rid("id")&" and ruid="&SoonBiz.user_id):creatnew:End Sub:Sub listfilter():Response.Write "<div class=""listfilter"">":Response.Write "<form method=""get"" action=""?"">":Response.Write "<input type=""hidden"" id=""act"" name=""act"" value="""& act &""" />":Response.Write " <input type=""text"" name=""keyword"" class=""inputsearch"" id=""keyword"" value="""">":Response.Write " <select name=""myfield"" id=""myfield"">":Response.Write " <option value=""snickname"">按发送人搜索</option>":Response.Write " <option value=""rnickname"">按接收人搜索</option>":Response.Write " <option value=""content"">按内容搜索</option>":Response.Write " </select>":Response.Write " <select name=""readed"" id=""readed"">":Response.Write " <option value="""">全部消息</option>":Response.Write " <option value=""0"">未读消息</option>":Response.Write " <option value=""1"">已读消息</option>":Response.Write " </select>":Response.Write " <input type='submit' name=""submit"" id=""submit"" value='搜索' class=""submit"">":Response.Write " </form>":Response.Write "</div>":End Sub:Sub remove():Dim sql:sql="update "& sheethead &"_shortmessage set del_s=2 where suid="& SoonBiz.user_id &" and del_s=1 and id in("& SoonBiz.rids &")":SoonBiz.execute(sql):sql="update "& sheethead &"_shortmessage set del_r=2 where ruid="& SoonBiz.user_id &" and del_r=1 and id in("& SoonBiz.rids &")":SoonBiz.execute(sql):SoonBiz.execute("delete from "& sheethead &"_shortmessage where del_r=2 and del_s=2"):SoonBiz.ok:End Sub:Sub removeall() :SoonBiz.execute("update "& sheethead &"_shortmessage set del_s=2 where suid="& SoonBiz.user_id &" and del_s=1"):SoonBiz.execute("update "& sheethead &"_shortmessage set del_r=2 where ruid="& SoonBiz.user_id &" and del_r=1"):SoonBiz.Execute("delete from "& sheethead &"_shortmessage where del_r=2 and del_s=2"):SoonBiz.ok:End Sub:Sub restore() :SoonBiz.execute("update "& sheethead &"_shortmessage set del_r=0 where del_r=1 and ruid="& SoonBiz.user_id&" and id in ("& SoonBiz.rids &")"):SoonBiz.execute("update "& sheethead &"_shortmessage set del_s=0 where del_s=1 and suid="& SoonBiz.user_id&" and id in("& SoonBiz.rids &")"):SoonBiz.ok:End Sub:Function adoption(thisclassid):Dim adlist,adminlist:Dim i,rs:adlist=SoonBiz.Getxmlvalue("class","class[@id='"& thisclassid &"']","adlist"):Set rs=SoonBiz.execute("select user_nickname from "& sheethead &"_user where user_gid=1"):adminlist=rs.GetString(,,"",",",""):rs.close:Set rs=Nothing
If len(adlist)>0 Then
adlist=split(adlist,"|"):For i=0 To UBound(adlist)
If Len(adlist(i))>0 Then
adlist(i)="<option value="""&adlist(i)&""">"&adlist(i)&"[版主]</option>"'their.sincesaid`:)::here:["frombut:'thatme
End If:Next:adoption=Join(adlist,"")
End If:adminlist=split(adminlist,","):For i=0 To ubound(adminlist)
If Len(adminlist(i))>0 Then
adminlist(i)="<option value="""&adminlist(i)&""">"&adminlist(i)&"[管理员]</option>"
End If:Next:adoption=adoption & Join(adminlist,""):End Function:Sub savenew():Dim ruid :Dim rnickname :Dim content:Dim blacklist:Dim rs,sql:Dim id:id=SoonBiz.rid("id"):rnickname=SoonBiz.RequestStr("收信人","rnickname","post",1,2,16,30,1):content=SoonBiz.RequestStr("内容","content","post",1,2,1000,30,1):ShowErr(""):Set rs=SoonBiz.execute("select id,user_blacklist from "& sheethead &"_user where user_nickname='"&SoonBiz.checkStr(rnickname)&"'")
If rs.bof And rs.eof Then'here_how$[:'nowhis"'them'}but)#::
Rs.close:set Rs=nothing:ShowErr("收信人错误")
Else :ruid=rs(0):blacklist=rs(1)&"":Rs.close:set Rs=nothing
If instr(blacklist,SoonBiz.user_nickname&",")>0 Then
ShowErr("收信人拒绝接收您的短消息")
End If
End If:sql="insert into "& sheethead &"_shortmessage (suid,snickname,ruid,rnickname,content,del_s,del_r,stime,readed,isdel) values (":sql=sql & SoonBiz.user_id:sql=sql & ",'"&SoonBiz.Checkstr(SoonBiz.user_nickname)&"'":sql=sql & "," & ruid:sql=sql & ",'"&SoonBiz.checkStr(rnickname)&"'":sql=sql & ",'"&SoonBiz.checkStr(content)&"'":sql=sql & ",0":sql=sql & ",0":sql=sql & ","& soonbizcom:sql=sql & ",0":sql=sql & ",0)":SoonBiz.execute(sql)'::heroftheseasmuchmight::::areofhe*::/
If id>0 Then
sql="update "& sheethead &"_shortmessage set readed=1 where id="&id&" and snickname='"& SoonBiz.user_nickname &"'":SoonBiz.Execute(sql)
End If:SoonBiz.Adsuccess("发送成功!"):End Sub:Function ReceiveOption():Dim rs,i,myfriendlist:Dim jintong:set rs=soonbiz.execute("select user_friend from "& sheethead &"_user where id="&soonbiz.user_id):myfriendlist=rs(0)&"":Rs.close:set Rs=nothing
if myfriendlist<>"" Then
myfriendlist=split(myfriendlist,","):Redim fuyou(ubound(myfriendlist)):for i=0 to ubound(myfriendlist):fuyou(i)="<option value="""&myfriendlist(i)&""">"&myfriendlist(i)&"</option>":next:ReceiveOption=join(fuyou,"")
Else:ReceiveOption=""'::*^:ifif:[get:being:each!|!:
end if:End Function
%>