<% IF Request.QueryString("Action")="view" Then call view elseiF Request.QueryString("Action")="del" Then call del elseiF Request.QueryString("Action")="edit" Then call edit elseiF Request.QueryString("Action")="add" Then call add elseiF Request.QueryString("Action")="save" Then call save else call index end if Function index%>

<% Set Rs = Server.CreateObject("Adodb.Recordset") Sql = "SELECT * FROM bbs_vice order by id desc" Rs.Open Sql,conn,1,1 If Not rs.eof Then Dim PageSize,i PageSize=10 Dim Count,page,pagecount,gopage,parent gopage="bbsvice.asp?sid="&sid&"&" Count=rs.recordcount page=int(request.QueryString ("page")) if page<=0 or page="" then page=1 pagecount=(count+pagesize-1)\pagesize if page>pagecount then page=pagecount rs.move(pagesize*(page-1)) For i=1 To PageSize If rs.eof Then Exit For %><%=i+(page-1)*PageSize%>.<%=ubb(rs("name"))%>
<% rs.moveNext Next if page-pagecount<0 then response.write "下页" if page>1 then response.write "上页" if pagecount>1 then response.write "
"&page&"/"&pagecount&"页>>" Else %> (没有公告) <%end if%> <% Rs.close set rs=nothing Response.Write("
[发布公告]
") end Function Function add%>

标题:

内容:(支持UBB)

发布
[公告管理]
<% end Function Function edit id=TRim(Request("id")) if not isnumeric(id) then id="" if id="" then%>

ID无效.
<%else Set Rs = Server.CreateObject("Adodb.Recordset") Sql = "SELECT * FROM bbs_vice where id="&id Rs.Open Sql,conn,1,1 if not (rs.bof and rs.eof) then %>

标题:
" maxlength="255" />
内容:(支持UBB)
" />
修改
[公告管理]
<%else%>

没有该公告!
<%end if Rs.close set rs=nothing end if end Function Function view id=TRim(Request("id")) if not isnumeric(id) then id="" if id="" then%>

ID无效.
<%else%>

<% Set Rs = Server.CreateObject("Adodb.Recordset") Sql = "SELECT * FROM bbs_vice where id="&id Rs.Open Sql,conn,1,1 if not (rs.bof and rs.eof) then %> 标题:<%=ubb(rs("name"))%>
内容:<%=ubb(rs("txt"))%>
时间:<%=ubb(rs("tm"))%>
[编辑] [删除]
[公告管理]
<%else%> 暂无公告!
<%end if Rs.close set rs=nothing end if end Function Function del id=TRim(Request("id")) if not isnumeric(id) then id="" if id="" then%>

ID无效.
<%else if Request("del")="true" then set rs=server.CreateObject("adodb.recordset") Sql = "SELECT * FROM bbs_vice where id="&id rs.open sql,conn,1,3 if not (rs.bof and rs.eof) then rs.delete end if Rs.close set rs=nothing%>

已成功删除该公告!
[公告管理]
<%else%>

是否要删除该公告?
[确定删除]
返回上页
[公告管理]
<%end if end if end Function Function save name=Trim(Request("name")) title=Trim(Request("title")) id=TRim(Request("id")) if not isnumeric(id) then id="" if name="" then errmsg=errmsg&"公告标题不能为空
":flag=0 if title="" then errmsg=errmsg&"公告内容不能为空
":flag=0 if Request("edit")="edit" then if id="" then errmsg=errmsg&"ID无效
":flag=0 if flag<>"0" then set rs=server.CreateObject("adodb.recordset") sql="select * from bbs_vice where id="&id rs.open sql,conn,1,3 rs("name")=name rs("txt")=title rs("tm")=now() rs.update() Rs.close set rs=nothing%>

修改公告成功

[公告管理]
<%else Response.Write("

") Response.Write(""&errmsg&"
[返回修改]
") end if else if flag<>"0" then set rs=server.CreateObject("adodb.recordset") sql="select * from bbs_vice" rs.open sql,conn,1,3 rs.addnew() rs("name")=name rs("txt")=title rs("tm")=now() rs.update() Rs.close set rs=nothing%>

发布公告成功

[公告管理]
<%else Response.Write("

") Response.Write(""&errmsg&"
[返回修改]
") end if END IF end Function %>[后台首页]