📄 admin_index.asp
字号:
end if
rs.close
set rs=nothing
case 11
conn.Execute ("delete * FROM 友情链接 where id="&cint(Request.QueryString("id"))&"")
Application(BBSname&"link")=""
Response.Write "删除成功"
case 12
%><table border="0" cellspacing="1" cellpadding="5" height="1" align=center width="95%" class="tableBorder">
<form action="admin_index.asp?admin=12" method="post" id=form1 name=form1>
<tr>
<td class="forumrow" height=25><b>注意:</b><br>输入数据库所在相对路径,并且输入数据库名称(正在使用中数据库不能压缩,请选择备份数据库进行压缩操作) </td>
</tr>
<tr>
<td class="forumrow">压缩数据库:<input type="text" name="dbpath" value=..\Data\BTbbs.MDB>
<input type="submit" value="开始压缩" id=submit1 name=submit1></td>
</tr>
<tr>
<td class="forumrow"><input type="checkbox" name="boolIs97" value="True">如果使用 Access 97 数据库请选择
(默认为 Access 2000 数据库)<br><br></td>
</tr>
<form id=form2 name=form2>
</table><%
dim dbpath,boolIs97
dbpath = request("dbpath")
boolIs97 = request("boolIs97")
If dbpath <> "" Then
dbpath = server.mappath(dbpath)
conn.close
set conn=nothing
response.write(CompactDB(dbpath,boolIs97))
End If
Function CompactDB(dbPath, boolIs97)
Dim fso, Engine, strDBPath,JET_3X
strDBPath = left(dbPath,instrrev(DBPath,"\"))
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(dbPath) Then
fso.CopyFile dbpath,strDBPath & "temp.mdb"
Set Engine = CreateObject("JRO.JetEngine")
If boolIs97 = "True" Then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp1.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp1.mdb"
End If
fso.CopyFile strDBPath & "temp1.mdb",dbpath
fso.DeleteFile(strDBPath & "temp.mdb")
fso.DeleteFile(strDBPath & "temp1.mdb")
Set fso = nothing
Set Engine = nothing
CompactDB = "你的数据库, " & dbpath & ", 已经压缩成功!" & vbCrLf
Else
CompactDB = "数据库名称或路径不正确. 请重试!" & vbCrLf
End If
End Function
case 13
%>
<blockquote>
<br>
数据库的占用空间: <%SysDataInfo("../data")%><br><br>
系统程序加静态帖子占用空间: <%SysDataInfo("../Board")%><br><br>
INC模板文件目录占用空间: <%SysDataInfo("../inc")%><br><br>
CSS样式文件目录占用空间: <%SysDataInfo("../css")%><br><br>
系统图片占用空间: <%SysDataInfo("../images")%><br><br>
上传文件占用空间: <%SysDataInfo("../upload")%><br><br>
系统占用空间总计(包括根目录下的文件): <%SysDataInfo("../")%>
</blockquote>
<%Sub SysDataInfo(drvpath)
dim fso,d,size,showsize
set fso=server.createobject("scripting.filesystemobject")
drvpath=server.mappath(drvpath)
set d=fso.getfolder(drvpath)
size=d.size
showsize=size & " Byte"
if size>1024 then
size=(Size/1024)
showsize=size & " KB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " MB"
end if
if size>1024 then
size=(size/1024)
showsize=formatnumber(size,2) & " GB"
end if
response.write "<font face=verdana>" & showsize & "</font>"
End Sub
case 14
%>
<form action="admin_index.asp?admin=14&cz=1" method="post" id=form1 name=form1>
<br><br> <b>注意:如果帖子数量比较多的话,下面程序的运行将是比较缓慢的,如果你的程序没有发现<br> 链接错误,那么请尽量不要运行检测帖子链接的程序,由于服务器可能的不稳定因素可能造成,<br> 没有检测到而被删除,以下程序最好在访问人数较少的时候运行!</b><br><br>
<table>
<tr><td height=35 width=180>
重新计算各个论坛的帖子数</td><td> <input type="submit" value="开始计算" id=submit1 name=TitleNum>
</td><td> (对于可能造成的帖子数量的错误,运行它来重新计算)</td></tr>
</form>
<form action="admin_index.asp?admin=14&cz=2" method="post" id=form1 name=form1>
<tr><td height=35 width=180>
检测静态帖子链接错误</td><td> <input type="submit" value="开始检测" id=submit1 name=LinkCheck>
</td><td> (如果发现帖子文件不存在,将在数据库中删除链接,运行此项后,必须再运行一次计算帖子数)</td></tr>
</table></center>
</form>
<%
if Request.QueryString("cz")=1 then
Response.Write "<center>正在计算..."
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select id,所属分类ID,所属分类,版面名称,版面状态,访问控制,版面介绍,版主,主题总数,回复总数,版面标记图片,版面最后发帖,认证论坛用户 from 版面分类 "
rs.open sql,conn,1,3
Set rs1 = Server.CreateObject("ADODB.Recordset")
sql1="select BoardName,PostNum from BT_Topic "
rs1.open sql1,conn,1,1
if not(rs.bof and rs.eof) and not(rs1.BOF and rs1.EOF) then
rs.movefirst
rs1.MoveFirst
i=0:j=0
while not rs.eof
rs("主题总数")=0
rs("回复总数")=0
rs1.MoveFirst
while not rs1.EOF
if rs("版面名称")=rs1("boardname") then rs("主题总数")=rs("主题总数")+1:rs("回复总数")=rs("回复总数")+rs1("PostNum") end if
rs1.MoveNext
wend
i=i+rs("主题总数")
j=j+rs("回复总数")
rs.movenext
wend
rs.movefirst
rs.update
Application(BBSname&"BT_Board")=rs.GetRows(-1)
Response.Write "<br><br>计算完成,其中主题帖子总数:"&cstr(i)&",回复帖子总数:"&cstr(j)&",总帖子数:"&cstr(i+j)&""
else
Response.Write "没有找到任何论坛或帖子"
end if
Response.Write "</center>"
rs.close
rs1.Close
conn.close
set rs=nothing
set rs1=nothing
set conn=nothing
end if
if Request.QueryString("cz")=2 then
Response.Write "<center>正在检测...<br>"
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select BoardID,FileName from BT_Topic "
rs.open sql,conn,1,3
if not (rs.bof and rs.eof) then
rs.movefirst
i=0
while not rs.eof
myFile="../board/bbs"+cstr(rs("boardid"))+"/"+rs("FileName") myFile = Server.MapPath(myFile) set fileStreamObj = CreateObject("Scripting.FileSystemObject") if not(fileStreamObj.FileExists(myFile)) then Response.Write "bbs"&cstr(rs("boardid"))&"/"&rs("FileName")&" 没有找到该帖子,在数据库中的记录被删除<br>" rs.delete
i=1 end if
rs.movenext
wend
if not(rs.bof and rs.eof) then
rs.movefirst
rs.update
end if
if i=0 then Response.Write "没有找到错误的链接<br>" end if
else
Response.Write "没有任何记录<br>"
end if
Response.Write "</center>"
Application.Lock
Application(BBSname&boardname+"bs")=Application(BBSname&boardname+"bs")+1
Application(BBSname&"index")=""
Application(BBSname&boardname)=""
Application.UnLock
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
case 15
'DIM myFile 'Const ForReading = 1 myFile = Server.MapPath("../board/UserPost_Const.ASP")
SET fileStreamObj = CreateObject("Scripting.FileSystemObject") SET textStream = fileStreamObj.OpenTextFile(myFile,ForReading,False) filenl=textStream.ReadAll() textStream.Close()
set textStream=nothing
set fileStreamObj=nothing
Response.Write "<form name=filexg action=admin_index.asp?admin=16 method=post>"
Response.Write "<table border=0 width=600>"
Response.Write "<tr><td width=600><TEXTAREA class=fminpt rows=25 cols=90 name=filex>"&filenl&"</textarea></td></tr>"
Response.Write "<tr><td align=center><input type=Submit value=完成 name=add></td>"
Response.Write "</table>"
case 16
if Request.Form("filex")<>"" then
filex=Request.Form("filex")
'Const Forwriting = 2
'Const ForAppending = 8 myFile = Server.MapPath("../board/UserPost_Const.ASP")
SET fileStreamObj = CreateObject("Scripting.FileSystemObject") SET textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False) textStream.Write(filex) textStream.Close()
set textStream=nothing
set fileStreamObj=nothing
Response.Write "修改完成"
else
Response.Write "意外错误"
end if
case 17
myFile = Server.MapPath("../board/xy.ASP")
SET fileStreamObj = CreateObject("Scripting.FileSystemObject") SET textStream = fileStreamObj.OpenTextFile(myFile,ForReading,False) filenl=textStream.ReadAll() textStream.Close()
set textStream=nothing
set fileStreamObj=nothing
Response.Write "<form name=filexg action=admin_index.asp?admin=18 method=post>"
Response.Write "<table border=0 width=600>"
Response.Write "<tr><td width=600><TEXTAREA class=fminpt rows=25 cols=90 name=filex>"&filenl&"</textarea></td></tr>"
Response.Write "<tr><td align=center><input type=Submit value=完成 name=add></td>"
Response.Write "</table>"
case 18
if Request.Form("filex")<>"" then
filex=Request.Form("filex")
'Const Forwriting = 2
'Const ForAppending = 8 myFile = Server.MapPath("../board/xy.ASP")
SET fileStreamObj = CreateObject("Scripting.FileSystemObject") SET textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False) textStream.Write(filex) textStream.Close()
set textStream=nothing
set fileStreamObj=nothing
Response.Write "修改完成"
else
Response.Write "意外错误"
end if
case 19
%>
<br><br>
<form name=userzl method=post action=admin_index.asp?admin=20&cz=1>
<b>输入下面论坛的名称,此操作将删除这个论坛下所有的帖子</b><br>
请输入论坛名称
<INPUT class=fminpt name=deltopic_boardname type=text size=10>
<input type=Submit value="确定" name=add> 删除此论坛下的所有帖子
</form>
<form name=userzl method=post action=admin_index.asp?admin=20&cz=2>
<b>下面的操作将删除某个论坛在某个时间以前的所有帖子,时间按主题发布的时间<br> 下面日期输入的格式为(例如:04-6-10 9:19:44)注意空格</b><br>
请输入论坛名称 <INPUT class=fminpt name=deltopic_boardname type=text size=10> 删除此论坛 <INPUT class=fminpt name=deltime type=text size=20> 以前发布的所有帖子
<input type=Submit value="确定" name=add>
</form>
<%
case 20
deltopic_boardname=Request.Form("deltopic_boardname")
if Request.QueryString("cz")=1 then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -