b_savereply.asp
资源名称:txl.zip [点击查看]
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:4k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
HTML/CSS
- <!--#include file="conn.asp"-->
- <!-- #include file="inc/const.asp" -->
- <!-- #include file="inc/chkinput.asp" -->
- <%
- dim titleimg,title,content,toptitle
- dim signflag,mailflag
- dim rootid
- if request("rootid")="" then
- foundErr=true
- Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
- elseif not isInteger(request("rootid")) then
- foundErr=true
- Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
- else
- rootID=request("rootid")
- end if
- titleimg=Checkstr(Request.Form("Expression"))
- title=Checkstr(trim(request.Form("subject")))
- content=Checkstr(trim(request.form("Content")))
- realname=Checkstr(trim(request.Form("realname")))
- if memberword=trim(request.Form("password")) then
- PassWord=Checkstr(trim(request.Form("password")))
- else
- PassWord=md5(Checkstr(trim(request.Form("password"))))
- end if
- if signflag="yes" then
- signflag=1
- else
- signflag=0
- end if
- if mailflag="yes" then
- mailflag=1
- else
- mailflag=0
- end if
- if chkpost=false then
- ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从外部提交发言。"
- FoundErr=True
- end if
- if realName="" or PassWord="" then
- realname=membername
- PassWord=memberword
- end if
- if realName="" then
- ErrMsg=ErrMsg+"<Br>"+"<li>请输入您的姓名。"
- FoundErr=True
- end if
- if strLength(title)>50 then
- foundErr=True
- ErrMsg=ErrMsg+"<Br>"+"<li>主题长度不能超过50"
- end if
- if request("method")="Topic" then
- if title="" then
- if content="" then
- ErrMsg=ErrMsg+"<Br>"+"<li>主题和内容必须填写其一。"
- foundErr=True
- end if
- end if
- end if
- if request("method")="fastreply" then
- if content="" then
- ErrMsg=ErrMsg+"<Br>"+"<li>快速回复请填写发言内容。"
- foundErr=True
- end if
- end if
- if strLength(content)>Clng(txl_set(22)) then
- ErrMsg=ErrMsg+"<Br>"+"<li>发言内容不得大于" & CSTR(txl_set(22)) & "bytes"
- FoundErr=true
- end if
- if content="" then
- ErrMsg=ErrMsg+"<Br>"+"<li>没有填写内容。"
- foundErr=true
- end if
- 'start
- if founderr then
- stats="错误信息"
- call head()
- call head_var("","")
- call txl_error()
- else
- stats="回复帖子成功"
- call head()
- call head_var("班级论坛","b_index.asp")
- call main()
- if founderr then call txl_error()
- end if
- call foot()
- sub main()
- if Cint(txl_set(14))=1 then
- Errmsg=Errmsg+"<br>"+"<li>班级论坛已经被管理员限制了不允许发帖。"
- founderr=true
- exit sub
- end if
- sql="select islock,Lastuser,title from topic where topicid="&cstr(rootid)
- set rs=conn.execute(sql)
- if not rs.eof and not rs.bof then
- toptitle=rs(2)
- if not master and rs("islock")=1 then
- Errmsg=ErrMsg+"<Br>"+"<li>本主题已经锁定,不能发表回复。"
- founderr=true
- exit sub
- end if
- end if
- set rs=nothing
- '*******************
- rem 保存贴子信息
- sql="insert into bbs (rootid,postuser,postuserid,titleimg,title,content,addtime,isbest,signflag,emailflag) values ("&rootid&",'"&realname&"',"&userid&",'"&titleimg&"','"&title&"','"&content&"',now(),0,"&signflag&","&mailflag&")"
- conn.execute(sql)
- sql="update topic set replys=replys+1,LastTime=Now(),lastuser='"&realname&"' where TopicID="&rootID
- conn.execute(sql)
- conn.execute("update [user] set bbscount=bbscount+1,usermoney=usermoney+"&txl_user(3)&" where userid="&userid)
- %>
- <meta http-equiv=refresh content="3;URL=b_show.asp?id=<%=rootid%>">
- <table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
- <tr>
- <td bgcolor=<%=txl_body(10)%>><br>
- <table cellpadding=3 cellspacing=1 align=center class=tableborder1 style="width:75%">
- <tr align=center>
- <th width="100%">状态:<%=stats%></th>
- </tr>
- <tr>
- <td width="100%" class=tablebody1>本页面将在3秒后自动返回班级你所发表的话题,<b>您可以选择以下操作:</b><br><ul>
- <li><a href="index.asp">返回首页</a></li>
- <li><a href="b_index.asp">班级论坛</a></li>
- <li><a href="b_show.asp?id=<%=rootid%>">您所发表的帖子</a></li>
- </ul></td>
- </tr>
- </table>
- <br>
- </td>
- </tr>
- </table>
- <%
- end sub
- %>
English
