<% if isnull(lguserid) or lguserid="" then Response.Redirect"login.asp" dim action,toname,bad,b action=request.querystring("action") select case action case"" conn.execute("update sms set new=false where touserid="&lguserid&"") %>
个人留言板
<%dim sql,pagesetup,usern,userinfo,topicuserid,sms,smsuserid dim wzcount,wzrep,wzpagecount,wzpage,pagestr,urlstr id=false urlstr="action=" sql="select*from sms where touserid="&lguserid&" order by id desc" wzrep=5 set rs = server.createobject("adodb.recordset") rs.Open sql,conn,1 if rs.eof or rs.bof then response.write"
暂无记录
" else wzcount=rs.recordcount wzpagecount = abs(int(-abs(wzcount/wzrep))) wzpage = clng(request.querystring("page")) if len(wzpage) = 0 or wzpage = 0 then wzpage = 1 rs.absoluteposition=rs.absoluteposition+((abs(wzpage)-1)*wzrep) pagestr="每页"&wzrep&"条 共"&wzpagecount&"页 ["&pagination(wzpagecount,urlstr)&"] " response.write"
"&pagestr&"
" for i = 0 to wzrep-1 if rs.eof then exit for smsuserid=rs("fromuserid") sms=rs("content") sms=split(sms,"|") set usern=conn.execute("select top 1 name,userinfo from [user] where userid="&smsuserid&"") userinfo=usern("userinfo") userinfo=split(userinfo,"|") %>

<%=checktitle(usern("name"))%>

<%response.write""%>

留言时间:<%=checktitle(sms(1))%> >信息  >留言  >删除
<%=ubb(sms(0))%>
<% set usern=nothing rs.movenext next end if rs.Close set rs=nothing response.write"
"&pagestr&"
" %> <%case"write" toname=replace(request.querystring("toname"),"'","") %>
发送留言

留言对象:

留言内容:
使用Html编辑器
使用UBB编辑器

             [ 按 Ctrl+Enter 直接发送 ]
<%case"savesms" dim content,cansend,touserid,content2,mymark,contentok cansend=true function checkbad(str) if isnull(str) then exit function bad=split(application(prefix&"badcontent"), "|") for b=0 to ubound(bad) str=Replace(str,bad(b),string(len(bad(b)),"*")) next checkbad=str end function toname=Replace(Request.Form("toname"),"'","") content=checkbad(left(Request.Form("content"),15000)) content=replace(content,"|","│") content=replace(content,"'","''") contentok=Replace(content," ","") contentok=Replace(content," ","") if toname="" or contentok="" then cansend=false mes="·请填写完整留言对象和留言内容。
" else if lcase(toname)=lcase(lgname) then cansend=false mes="·不能给自己留言。
" else if checkname(toname)=false then cansend=false mes="·论坛不存在 "&checktitle(toname)&" 这个用户。
" else ''''''限制1分钟只能留一次言 if session("mailtime")+1/1440>now() then cansend=false mes="·论坛目前限定一分钟只能留一次言。
" else session("mailtime")=now '''''''''''''''结束 set rs=conn.execute("select top 1 userid from [user] where name='"&toname&"'") if rs.eof then cansend=false mes="·论坛不存在 "&checktitle(toname)&" 这个用户。
" else touserid=rs("userid") end if set rs=nothing end if'添加 end if end if end if mymark=conn.execute("select top 1 mark from [user] where userid="&lguserid&"")("mark") if mymark<5 then cansend=false mes=mes&"·你的论坛积分为 "&mymark&" ,不足够发送留言。
" end if if cansend=false then tl=" 发 送 失 败" mes="对不起!留言发送失败,可能存在以下问题。
"&mes&"· 返回重新填写" elseif cansend=true then content2=content&"|"&now()+timeset/24 conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&touserid&",'"&content2&"')") conn.execute("update [user] set mark=mark-5 where userid="&lguserid&"") tl=" 发 送 成 功" mes="已经成功的给 "&checktitle(toname)&" 留言。
论坛收取了你 5 点积分。" end if call sendinfo(tl,mes) %> <%case"del" if conn.execute("select top 1 id from sms where id="&id&" and touserid="&lguserid&"").eof then tl=" 删 除 失 败" mes="你的留言板不存在你所要删除的留言。" else conn.execute("delete*from sms where id="&id&" and touserid="&lguserid&"") conn.execute("update [user] set mark=mark+1 where userid="&lguserid&"") tl=" 删 除 成 功" mes="已经删除了选中的留言。" end if call sendinfo(tl,mes) %><%case"delall" dim delnum,addmark delnum=conn.execute("select count(id) from sms where touserid="&lguserid&"")(0) addmark=1*int(delnum) conn.execute("update [user] set mark=mark+"&int(addmark)&" where userid="&lguserid&"") conn.execute("delete*from sms where touserid="&lguserid&"") tl=" 清 空 成 功" mes="已经成功的清空留言板。你获得了 "&addmark&" 点积分。" call sendinfo(tl,mes)%><%end select call down %>