<% Dim Action Dvbbs.LoadTemplates("") Dvbbs.Stats = "发表论坛公告" Dvbbs.Nav() Dvbbs.Head_var 0,0,Plus_Popwan.Program,"plus_popwan_ann.asp" Dvbbs.ActiveOnline() action = Request("action") Page_main() If action<>"frameon" Then Dvbbs.Footer End If Dvbbs.PageEnd() '页面右侧内容部分 Sub Page_Center() If Not (Dvbbs.master Or Dvbbs.GroupSetting(70)="1") Then Dvbbs.AddErrcode(28) Dvbbs.ShowErr() End If Select Case action Case "addann" AddAnn() Case "SaveAnn" SaveAnn() Case Else AddAnn() End Select End Sub Sub SaveAnn() Dim rs,sql If Request.form("submit")="" Then Exit Sub If Not Dvbbs.ChkPost() Then Dvbbs.AddErrCode(16):Exit sub Dim username,title,content,bgs If request("username")="" then Response.redirect "showerr.asp?ErrCodes=
  • 请输入您的用户名,请确认您输入的用户名长度是否符合论坛标准。&action=OtherErr" Else username=Dvbbs.MemberName End if '防止标题被插入脚本和出现不规范代码。 Dim checkinfo checkinfo=checkXHTML(request("title")) If checkinfo<>"" Then Response.redirect "showerr.asp?ErrCodes=
  • "&checkinfo&"&action=OtherErr" End If If request("title")="" then Response.redirect "showerr.asp?ErrCodes=
  • 数据中含有非法字符。&action=OtherErr" Else title=request("title") End If If Dvbbs.strLength(title)>250 Then Response.redirect "showerr.asp?ErrCodes=
  • 标题不能多于250个字符&action=OtherErr" If request("content")="" Then Response.redirect "showerr.asp?ErrCodes=
  • 您输入的用户名包含系统禁止注册字符。&action=OtherErr" Else content=Dvbbs.CheckStr(request("content")) End If bgs=Dv_FilterJS(request("bgs")) 'Dvbbs.Execute("Alter Table Dv_bbsnews Alter Column title varchar(250) null") Set Rs=Dvbbs.iCreateObject("adodb.recordset") Sql="select * from Dv_bbsnews" If Not IsObject(Conn) Then ConnectionDatabase Rs.open sql,conn,1,3 Rs.addnew Rs("username")=username Rs("title")=title Rs("content")=content Rs("addtime")=Now() Rs("boardid")=Dvbbs.BoardID If bgs<>"" Then Rs("bgs")=bgs End If Rs.update rs.close:Set rs=Nothing Dvbbs.Name = "Dv_news_"&Dvbbs.boardid Dvbbs.RemoveCache Dvbbs.Dvbbs_suc("
  • 您已经成功的发布了公告。") If Dvbbs.BoardID=0 Then Dvbbs.Execute("Insert Into Dv_Log (l_AnnounceID,l_BoardID,l_touser,l_username,l_content,l_ip,l_type) values (0,"&Dvbbs.BoardID&",'论坛公告','" & Dvbbs.MemberName & "','发布新公告','" & Dvbbs.userTrueIP & "',3)") Else Dvbbs.Execute("Insert Into Dv_Log (l_AnnounceID,l_BoardID,l_touser,l_username,l_content,l_ip,l_type) values (0,"&Dvbbs.BoardID&",'论坛公告','" & Dvbbs.MemberName & "','在 "&Dvbbs.boardtype&"发布新公告','" & Dvbbs.userTrueIP & "',3)") End If End Sub Sub AddAnn() %>
    发布论坛公告
    用户名
    版 面
    背景乐  支持MID或WAV文件,此项非必填。
    标 题
    内 容
    <% End Sub %>