<% Dim Action If Not BBS.Founduser Then BBS.GoToerr(10) IF SESSION(CacheName& "MyGradeInfo")(37)="0" Then BBS.GoToErr(67) Action=Lcase(Request.querystring("Action")) If Len(Action)>10 then BBS.GoToerr(1) Select Case Action Case"del" DelPlacard Case Else Placard() End Select BBS.Footer() Set BBS =Nothing Sub DelPlacard() Dim ID ID=BBS.Checknum(request.querystring("ID")) IF BBS.MyAdmin=7 Then BBS.execute("Delete From [Placard] where ID="&ID&" and Name='"&BBS.MyName&"'") Else BBS.execute("Delete From [Placard] where ID="&ID&"") End IF BBS.Cache.clean("Placard") BBS.NetLog "删除公告" Response.redirect "Placard.asp" End Sub Sub Placard() Dim Caption,Content,Temp,TmpBoardID,S,Title,Rs,ID If BBS.BoardID>0 Then BBS.CheckBoard() IF BBS.MyAdmin=7 And BBS.IsBoardAdmin=False Then BBS.GoToErr(68) ID=BBS.Checknum(request("ID")) BBS.Head"Placard.asp?Action=Say&BoardID="&BBS.BoardID,BBS.BoardName,"发布公告" Caption=BBS.Fun.Checkbad(BBS.Fun.GetStr("caption")) Content=BBS.Fun.Checkbad(BBS.Fun.GetStr("Content")) IF Caption="" And Content="" Then Title="发布公告" TmpBoardID=BBS.BoardID If ID<>0 Then Set Rs=BBS.execute("select BoardID,Caption,Content,AddTime,Name,hits from [Placard] where ID="&ID&"") IF Not rs.eof Then Title="编辑公告" TmpBoardID=Rs(0) Caption=Rs(1) Content=Rs(2) If BBS.MyAdmin=7 Then If Lcase(BBS.MyName)<>Lcase(Rs(4)) Then BBS.GotoErr(73) End If Else BBS.Gotoerr(69) End If End If S="
" If BBS.MyAdmin=7 Then Temp=BBS.BoardName&"" Else Temp="" End If S=S&BBS.Row("公告标题:","","75%","") S=S&BBS.Row("所在版块:",Temp,"75%","") If BBS.Info(60)="1" Then Temp="UbbEdit()" Else Temp="HtmlEdit()" Temp="" S=S&BBS.Row("公告内容:",Temp,"75%","") S=S&"
" BBS.ShowTable Title,S AdminPlacard() Else TmpBoardID=BBS.Checknum(request("BoardID")) IF len(Content)>16200 or Len(Caption)>250 Then BBS.GoToErr(18) If BBS.Fun.CheckIsEmpty(Content) Then BBS.GoToErr(50) If BBS.Info(60)="1" Then Content=BBS.Fun.Replacehtml(Content) Temp=BBS.Fun.UbbString(Content) If ID<>0 Then Title="编辑公告" BBS.Execute("update [Placard] Set Caption='"&Caption&"',Content='"&Content&"',BoardID="&TmpBoardID&",UbbString='"&Temp&"' where ID="&ID) Else BBS.execute("insert into[Placard](Caption,Content,AddTime,Name,BoardID,UbbString)values('"&Caption&"','"&Content&"','"&BBS.NowBbsTime&"','"&BBS.MyName&"',"&TmpBoardID&",'"&Temp&"')") Title="发布公告" End If Content="
  • "&Title&"成功!
  • 返回首页
  • " IF TmpBoardID>0 Then Content=Content&"
  • "&BBS.BoardName&"" Content="
    "&Content&"
    " BBS.Cache.clean("Placard") BBS.NetLog Title BBS.ShowTable Title,Content End If End Sub Sub AdminPlacard() Dim P,arr_Rs,i,Temp,S,PInfo,Sqlwhere,Title If BBS.MyAdmin=7 Then Sqlwhere="Name='"&BBS.MyName&"'" Title="我发表的公告" Else Title="公告列表" End If Set P = New Cls_PageView P.strTableName = "[Placard]" P.strPageUrl = "?Action="&Action P.strFieldsList = "ID,Caption,BoardID,Name,AddTime,hits" P.strPrimaryKey ="ID" p.strCondiction=Sqlwhere P.strOrderList = "BoardID,ID desc" P.intPageSize = Request.QueryString("page") P.strCookiesName = "Placard_List" P.strPageVar = "page" P.InitClass Arr_Rs = P.arrRecordInfo PInfo = P.strPageInfo Set P = nothing S="
    公告标题
    所在版块
    作者
    时间
    管理
    " If IsArray(Arr_Rs) Then For i = 0 to UBound(Arr_Rs, 2) S=S&"
    "&Arr_Rs(1,i)&"
    "&Replace(BBS.GetBoardName(Arr_Rs(2,i)),"所有版块","论坛首页")&"
    "&Arr_Rs(3,i)&"
    "&Arr_Rs(4,i)&"
    修改 删除
    " Next S=S&"
    "&PInfo&"
    " End If BBS.ShowTable Title,S End Sub %>