⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delpost.asp

📁 仿雅虎论坛静态生成html版 后台管理:admin/admin.asp 用户名:admin 密码:admin TOP/top.htm 顶部模板 left.htm 左边树形菜单模板
💻 ASP
字号:
<!--#include file="../conn.asp"-->
<!--#include file="../board/Const.asp"-->
<!--#include file="BtBBS_Fun.asp"-->
<!--#include file="../board/UserPost_Const.asp"-->
<%
 Dim FileName,Post,FileNl,aRS,i,j
 StarTime = Timer():AccessNum=0
 
 Login=Request.Cookies("Login")
 FileName=Request.QueryString("File")
 FileName=replace(replace(replace(replace(FileName,"'","‘"),"<","&lt;"),">","&gt;")," ","&nbsp;")
 Post=Request.QueryString("Post")
 Post=replace(replace(replace(replace(Post,"'","‘"),"<","&lt;"),">","&gt;")," ","&nbsp;")
 BoardID=Request.QueryString("BoardID")
 BoardID=replace(replace(replace(replace(BoardID,"'","‘"),"<","&lt;"),">","&gt;")," ","&nbsp;")
 PostUser=Request.QueryString("PostUser")
 PostUser=replace(replace(replace(replace(PostUser,"'","‘"),"<","&lt;"),">","&gt;")," ","&nbsp;")
 
 BT_Board()
 aRS=Application(BBSname&"BT_Board")
  J=-1
 If not (aRS(0,0)=-1 or VarType(aRS)=0) Then
  For I=0 To UBound(aRS,2)
    If Cint(BoardID)=aRS(0,I) then J=I End If
  Next
 End If
  
 If Login="Y" and j>=0 Then                               '---------身份确认,如果sf=1,那么登陆者是版主或管理员,如果是0,则是其它用户
  If (instr(1,aRS(7,J),Request.Cookies("Username"))<>0 and Request.Cookies("bbsgl")="bbsadmin") or Request.Cookies("bbsgl")="admin" Then sf=1 Else sf=0 End If
 Else             '匿名用户
  sf=0
 End If
 
 DIM myFile
 Const ForReading = 1 Const Forwriting = 2
 Const ForAppending = 8 myFile = Server.MapPath("../board/BBS"&BoardID&"/"&FileName)
 SET fileStreamObj = CreateObject("Scripting.FileSystemObject")
 if not(fileStreamObj.FileExists(myFile)) then 
  FileName=""
 end if 
 if FileName<>"" and Post<>"" and sf=1 then
   SET textStream = fileStreamObj.OpenTextFile(myFile,ForReading,False)
   while not textStream.AtEndOfStream    FileNl=FileNl+textStream.ReadLine()
   wend   textStream.Close()
   set fileStreamObj=nothing
   EndPost="<!--EndPost"&Post&"-->"
   i=Instr(1,Filenl,"<!--BeginPost"&Post&"-->")
   j=Instr(1,Filenl,EndPost)
   Left_NL=left(FileNl,i-1)
   Right_NL=right(FileNl,len(FileNl)-(j+len(EndPost)-1))
   
   SET fileStreamObj = CreateObject("Scripting.FileSystemObject")
   SET textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False)
   textStream.Write(left_nl+right_nl)   textStream.Close()
   set fileStreamObj=nothing
   
   conn.execute("update 用户资料 set 声望=声望-"&Usersw_dp&",积分=积分-"&Userjf_dp&",经验=经验-"&Userjy_dp&",金钱=金钱-"&UserMoney_dp&" where 用户名='"&PostUser&"' ")
   conn.execute("update BT_Topic set PostNum=PostNum-1 where FileName='"&FileName&"' ")
   conn.execute("update 版面分类 set 回复总数=回复总数-1 where ID="&cint(BoardID)&" ")
   Set rs=conn.execute("select id,所属分类ID,所属分类,版面名称,版面状态,访问控制,版面介绍,版主,主题总数,回复总数,版面标记图片,版面最后发帖,认证论坛用户 from 版面分类 ")
   if not (rs.bof and rs.eof) then Application(BBSname&"BT_Board")=rs.GetRows(-1) end if
   rs.close
   set rs=nothing
   aRS=Application(BBSname&"BT_Board")
   For i=0 to UBound(aRS,2)
    If Cint(BoardID)=aRS(0,i) then BoardName=aRS(3,i) end if
   Next
   Application.Lock
   Application(BBSname&boardname+"bs")=Application(BBSname&boardname+"bs")+1
   Application(BBSname&"index")=""
   Application(BBSname&boardname)=""
   Application.UnLock

   Response.Redirect "JtoF/JtoF.asp?BoardID="&BoardID&"&File="&FileName&""
 else
   %>
   <!--#include file="../inc/top1_FT.inc"-->
   <%Login_EN():EndTime = Timer()%>
   <table width=743><tr><td><a href=../index.asp><font class=NavColor>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -