action=request.QueryString("action")
bbsID=request("bbsID")
if action"" then%>
case "del"
if bbsID"" then conn.execute "delete from filmbbs where bbsID in ("&bbsID&")"
case "delmonth"
conn.execute ("delete from filmbbs where addtime < "&(now()-30)&"")
case "delyear"
conn.execute ("delete from filmbbs where addtime < "&(now()-365)&"")
end select
end if
%>
影视留言板管理
影视留言板管理
Const MaxPerPage=40
dim totalPut,bbsRS,str
dim CurrentPage
dim TotalPages
dim j
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set bbsRS=server.createobject("adodb.recordset")
userinfoSQL="select * from filmbbs order by addtime DESC"
bbsRS.open userinfoSQL,conn,1,1
if err.number0 then
response.write "数据库中无数据"
end if
if bbsRS.eof And bbsRS.bof then
Response.Write " 目前还没有任何留言!"
else
totalPut=bbsRS.recordcount
if currentpage currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"managebbs.asp"
else
if (currentPage-1)*MaxPerPage bbsRS.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=bbsRS.bookmark
showContent
showpage totalput,MaxPerPage,"managebbs.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"managebbs.asp"
end if
end if
end if
sub showContent
dim i
i=0
response.write ""
%>
操 作
来 自
简单内容
日 期
do while not bbsRS.eof%>
str=bbsRS("bbscont")
str=replace(str,"<"," str=replace(str," "," ")
str=replace(str,"",chr(13))
response.Write(left(str,25)&"…")%>
if i>=MaxPerPage then Exit Do
bbsRS.movenext
loop
bbsRS.close
set bbsRS=nothing
set conn=nothing
%>
选中所显示留言
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write ""
Response.Write " "
If CurrentPage Response.Write "首页 上一页 "
Else
Response.Write "首页 "
Response.Write "上一页 "
End If
If n-currentpage Response.Write "下一页 尾页"
Else
Response.Write ""
Response.Write "下一页 尾页"
End If
Response.Write " 页次:"&CurrentPage&"/"&n&"页 "
Response.Write " 共有"&totalnumber&"条记录 "
Response.Write ""
Response.Write ""
End Function
%>
function CheckAll(form)
{
for (var i=0;i {
var e = form.elements[i];
if (e.name != 'checkbox')
e.checked = form.checkbox.checked;
}
}
function test(n,s)
{
var copula,msg;
copula=n;
msg=s;
switch(copula)
{
case 1:
document.delform.action="managebbs.asp?action=delmonth";
break;
case 2:
document.delform.action="managebbs.asp?action=delyear"
break;
}
if(!confirm(msg)) return false;
}