📄 admin_uploadlist.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="inc/DvADChar.asp" -->
<%
Head()
Dim path
Dim objFSO
Dim uploadfolder
Dim uploadfiles
Dim upname
Dim UpFolder
Dim upfilename
Dim admin_flag
admin_flag=",35,"
Dim sfor(30,2)
Dim seachstr,sqlstr,delsql
Dim currentpage,page_count,Pcount
Dim totalrec,endpage
if Request("path")<>"" then
path=Request("path")
else
path="UploadFile"
end if
If Dvbbs.Forum_Setting(76)="0" Or Dvbbs.Forum_Setting(76)="" Then Dvbbs.Forum_Setting(76)="UploadFile/"
path=Dvbbs.Forum_Setting(76)
currentPage=Request("currentpage")
if currentpage="" or not IsNumeric(currentpage) then
currentpage=1
else
currentpage=clng(currentpage)
if err then
currentpage=1
err.clear
end if
end if
if Request("filesearch")<>"" and IsNumeric(Request("filesearch")) then
seachstr="&filesearch="&Request("filesearch")
end if
'----------------------------------
'多条件查询表单处理开始
'----------------------------------
if Request("filesearch")=7 and IsNumeric(Request("filesearch")) then
'所属版块条件
if Request("class")<>"" and IsNumeric(Request("class")) and Request("class")<>0 then
seachstr=seachstr+"&class="&cint(Request("class"))
sqlstr=" and F_BoardID="&cint(Request("class"))
end if
'附件分类条件
if Request("f_type")<>"" and IsNumeric(Request("f_type")) then
seachstr=seachstr+"&f_type="&cint(Request("f_type"))
sqlstr=sqlstr+" and f_type="&cint(Request("f_type"))
end if
'附件类型条件
if Request("f_filetype")<>"" then
seachstr=seachstr+"&f_filetype="&Request("f_filetype")
sqlstr=sqlstr+" and f_filetype='"&dvbbs.checkstr(Request("f_filetype"))&"'"
end if
'下载次数条件f_downnum
if Request("f_downnum")<>"" and IsNumeric(Request("f_downnum")) then
if Request("downtype")="more" then
sqlstr=sqlstr+" and f_downnum>="&clng(Request("f_downnum"))
else
sqlstr=sqlstr+" and f_downnum<="&clng(Request("f_downnum"))
end if
seachstr=seachstr+"&f_downnum="&cint(Request("f_downnum"))&"&downtype="&Request("downtype")
end if
'浏览次数条件f_viewnum
if Request("f_viewnum")<>"" and IsNumeric(Request("f_viewnum")) then
if Request("viewtype")="more" then
sqlstr=sqlstr+" and f_viewnum>="&clng(Request("f_viewnum"))
else
sqlstr=sqlstr+" and f_viewnum<="&clng(Request("f_viewnum"))
end if
seachstr=seachstr+"&f_viewnum="&cint(Request("f_viewnum"))&"&viewtype="&Request("viewtype")
end if
'附件大小条件f_size
if Request("f_size")<>"" and IsNumeric(Request("f_size")) then
if Request("sizetype")="more" then
sqlstr=sqlstr+" and F_FileSize>="&clng(Request("f_size"))*1024
else
sqlstr=sqlstr+" and F_FileSize<="&clng(Request("f_size"))*1024
end if
seachstr=seachstr+"&f_size="&cint(Request("f_size"))&"&sizetype="&Request("sizetype")
end if
'多少天内发布条件f_adddatenum
if Request("f_adddatenum")<>"" and IsNumeric(Request("f_adddatenum")) then
If IsSqlDataBase=1 Then
if Request("timetype")="more" then
sqlstr=sqlstr+" and datediff(day,F_AddTime,"&SqlNowString&") >= "&clng(Request("f_adddatenum"))
else
sqlstr=sqlstr+" and datediff(day,F_AddTime,"&SqlNowString&") <= "&clng(Request("f_adddatenum"))
end if
Else
if Request("timetype")="more" then
sqlstr=sqlstr+" and datediff('d',F_AddTime,"&SqlNowString&") >= "&clng(Request("f_adddatenum"))
else
sqlstr=sqlstr+" and datediff('d',F_AddTime,"&SqlNowString&") <= "&clng(Request("f_adddatenum"))
end if
End If
seachstr=seachstr+"&f_adddatenum="&cint(Request("f_adddatenum"))&"&timetype="&Request("timetype")
end if
'附件作者:
if Request("f_username")<>"" then
if Request("usernamechk")="yes" then
sqlstr=sqlstr+" and f_username='"&dvbbs.checkstr(Request("f_username"))&"'"
else
sqlstr=sqlstr+" and f_username like '%"&dvbbs.checkstr(Request("f_username"))&"%'"
end if
seachstr=seachstr+"&f_username="&Request("f_username")&"&usernamechk="&Request("usernamechk")
end if
'附件说明:
if Request("f_readme")<>"" then
if Request("f_readmechk")="yes" then
sqlstr=sqlstr+" and f_readme='"&dvbbs.checkstr(Request("f_readme"))&"'"
else
sqlstr=sqlstr+" and f_readme like '%"&dvbbs.checkstr(Request("f_readme"))&"%'"
end if
seachstr=seachstr+"&f_readme="&Request("f_readme")&"&f_readmechk="&Request("f_readmechk")
end if
end if
'----------------------------------
'多条件查询表单处理结束
'----------------------------------
if not Dvbbs.master or instr(","&session("flag")&",",admin_flag)=0 then
Errmsg=ErrMsg + "<BR><li>本页面为管理员专用,请<a href=admin_index.asp target=_top>登录</a>后进入。<br><li>您没有管理本页面的权限。"
dvbbs_error()
else
%>
<table border="0" cellpadding="3" cellspacing="1" width="95%" class=tableborder align=center>
<tr>
<th height="23" colspan="2">论坛上传附件管理</th>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">注意事项:</td>
<td width="80%" class=forumRow>
①、本功能必须服务器支持FSO权限方能使用,FSO使用帮助请浏览微软网站。如果您服务器不支持FSO请手动管理。 <BR>②、新版(DV6)之后的版本上传目录强制定义为UploadFile,只有该目录下文件可进行文件自动清理工作,新版之前的版本上传文件只能手动清除垃圾上传文件;(DV6.1)版后所有上传附件会自动存放到新自定义的文件夹中,文件目录以当年月明名。(需要空间支持FSO读写权限)
<br>③、自动清理文件:将对所有上传文件进行核实,如发现文件没有被相关帖子所使用,将执行自动清除命令
</td>
</tr>
<tr>
<form action="?action=FileSearch" method=post>
<td width="20%" height="23" class="forumRowHighlight">快速查询:</td>
<td width="80%" class=forumRow>
<select size=1 name="FileSearch" onchange="javascript:submit()">
<option value="0">请选择查询条件</option>
<option value="1" <%if Request("FileSearch")=1 then%>selected<%end if%>>列出所有上传附件</option>
<option value="2" <%if Request("FileSearch")=2 then%>selected<%end if%>>最近 24小时内上传的附件</option>
<option value="3" <%if Request("FileSearch")=3 then%>selected<%end if%>>最近1个月内上传的附件</option>
<option value="4" <%if Request("FileSearch")=4 then%>selected<%end if%>>最近3个月内上传的附件</option>
<option value="5" <%if Request("FileSearch")=5 then%>selected<%end if%>>下载前100名的附件</option>
<option value="6" <%if Request("FileSearch")=6 then%>selected<%end if%>>点击前100名的附件</option>
</select>
</td>
</FORM>
</tr>
</table>
<%
if Request("Submit")="清理所有上传记录" then
call delall()
elseif Request("Submit")="清除未记录文件" then
call delall1()
elseif Request("Submit")="清理当前列表记录" then
call delall()
elseif Request("action")="FileSearch" then
call FileSearch()
elseif Request("action")="delfiles" then
call delfiles()
else
call main()
end if
Footer()
end if
sub main()
%>
<br><table border="0" cellpadding="3" cellspacing="1" width="95%" class=tableborder align=center>
<form action="?action=FileSearch" method=post>
<tr>
<th height="23" colspan="2" align=left>高级查询</th>
</tr>
<tr>
<td width=20% class="forumRowHighlight">注意事项</td>
<td width=80% class=forumrow colspan=5>在记录很多的情况下搜索条件越多查询越慢,请尽量减少查询条件;</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">所属版块:</td>
<td width="80%" class=forumRow>
<select name=class>
<option value="0">所有论坛版块</option>
<%
Dim rs_c
set rs_c= server.CreateObject ("adodb.recordset")
sql = "select * from dv_board order by rootid,orders"
rs_c.open sql,conn,1,1
do while not rs_c.EOF%>
<option value="<%=rs_c("boardid")%>" <%if Request("editid")<>"" and clng(Request("editid"))=rs_c("boardid") then%>selected<%end if%>>
<%if rs_c("depth")>0 then%>
<%for i=1 to rs_c("depth")%>
-
<%next%>
<%end if%><%=rs_c("boardtype")%></option>
<%
rs_c.MoveNext
loop
rs_c.Close
set rs_c=nothing
%>
</select>
</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">文件下载次数:</td>
<td width="80%" class=forumRow><input size=45 name="f_downnum" type=text>
<input type=radio value=more name="downtype" checked > 多于
<input type=radio value=less name="downtype" > 少于
</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">附件浏览次数:</td>
<td width="80%" class=forumRow><input size=45 name="f_viewnum" type=text>
<input type=radio value=more name="viewtype" checked > 多于
<input type=radio value=less name="viewtype" > 少于
</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">上传天数:</td>
<td width="80%" class=forumRow><input size=45 name="f_adddatenum" type=text>
<input type=radio value=more name="timetype" checked > 多于
<input type=radio value=less name="timetype" > 少于
</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">附件作者:</td>
<td width="80%" class=forumRow><input size=45 name="f_username" type=text>
<input type=checkbox name="usernamechk" value="yes" checked>用户名完整匹配
</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">附件说明:</td>
<td width="80%" class=forumRow><input size=45 name="f_readme" type=text>
<input type=checkbox name="f_readmechk" value="yes" checked>说明内容完整匹配
</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">附件大小:</td>
<td width="80%" class=forumRow><input size=45 name="f_size" type=text> (单位:K)
<input type=radio value=more name="sizetype" checked > 大于
<input type=radio value=less name="sizetype" > 小于
</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">附件分类:</td>
<td width="80%" class=forumRow>
<select name="f_type">
<option value="all">所有分类</option>
<option value="1">图片集分类</option>
<option value="2">FLASH集分类</option>
<option value="3">音乐集分类</option>
<option value="4">电影集分类</option>
<option value="0">文件集分类</option>
</select>
</td>
</tr>
<tr>
<td width="20%" height="23" class="forumRowHighlight">附件类型:</td>
<td width="80%" class=forumRow>
<select name="f_filetype">
<option value="">所有文件类型</option>
<option value="gif">gif</option><option value="jpg">jpg</option>
<option value="bmp">bmp</option><option value="zip">zip</option>
<option value="rar">rar</option><option value="exe">exe</option>
<option value="swf">swf</option><option value="swi">swi</option>
<option value="mid">mid</option><option value="mp3">mp3</option>
<option value="rm">rm</option><option value="txt">txt</option>
<option value="doc">doc</option><option value="exl">exl</option>
</select>
</td>
</tr>
<tr>
<th height="23" colspan="2"><input name="submit" type=submit value="开始搜索"></th>
</tr>
<input type=hidden value="7" name="FileSearch">
</form>
</table>
<%
end sub
sub FileSearch()
%>
<form method=post action="?action=delfiles" name="formpost">
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
<tr>
<th colspan=8 align=left height=23 ID=TableTitleLink><a href=admin_uploadlist.asp>上传文件管理</a> -->搜索结果</th>
</tr>
<tr>
<td class=forumRowHighlight align=center><B>类型</B></td>
<td class=forumRowHighlight height=23 align=center><B>用户名</B></td>
<td class=forumRowHighlight align=center><B>文 件 名</B></td>
<td class=forumRowHighlight align=center><B>所属版块</B></td>
<td class=forumRowHighlight align=center><B>大小</B></td>
<td class=forumRowHighlight align=center><B>时间/点击/下载</B></td>
<td class=forumRowHighlight align=center><B>分类</B></td>
<td class=forumRowHighlight align=center><B>删除</B></td>
</tr>
<%
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select F_ID,F_AnnounceID,F_BoardID,F_Filename,F_Username,F_FileType,F_Type,F_FileSize,F_DownNum,F_ViewNum,F_AddTime ,B.Boardtype from [DV_Upfile] U inner join dv_Board B on B.boardid=U.F_BoardID where F_Flag=0 "
'条件查询
select case Request("FileSearch")
case 1
sql=sql+" order by F_ID desc"
case 2
If IsSqlDataBase=1 Then
sql=sql+" and datediff(hour,F_AddTime,"&SqlNowString&")<25"
else
sql=sql+" and datediff('h',F_AddTime,"&SqlNowString&")<25"
end if
sql=sql+" order by F_ID desc"
case 3
If IsSqlDataBase=1 Then
sql=sql+" and datediff(month,F_AddTime,"&SqlNowString&")<1"
else
sql=sql+" and datediff('m',F_AddTime,"&SqlNowString&")<1"
end if
sql=sql+" order by F_ID desc"
case 4
If IsSqlDataBase=1 Then
sql=sql+" and datediff(month,F_AddTime,"&SqlNowString&")<3"
else
sql=sql+" and datediff('m',F_AddTime,"&SqlNowString&")<3"
end if
sql=sql+" order by F_ID desc"
case 5
sql="select top 100 F_ID,F_AnnounceID,F_BoardID,F_Filename,F_Username,F_FileType,F_Type,F_FileSize,F_DownNum,F_ViewNum,F_AddTime ,B.Boardtype from [DV_Upfile] U inner join dv_Board B on B.boardid=U.F_BoardID where F_Flag=0 and F_BoardID<>0"
sql=sql+" order by F_DownNum Desc,F_ID desc"
case 6
sql="select top 100 F_ID,F_AnnounceID,F_BoardID,F_Filename,F_Username,F_FileType,F_Type,F_FileSize,F_DownNum,F_ViewNum,F_AddTime ,B.Boardtype from [DV_Upfile] U inner join dv_Board B on B.boardid=U.F_BoardID where F_Flag=0 and F_BoardID<>0"
sql=sql+" order by F_ViewNum Desc,F_ID desc"
case 7
sql=sql+sqlstr
sql=sql+" order by F_ID desc"
case else
sql=sql+" order by F_ID desc"
end select
'response.write SQL
rs.open sql,conn,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=8 class=forumrow>没有找到相关记录。</td></tr>"
else
rs.PageSize = Cint(Dvbbs.Forum_Setting(11))
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
while (not rs.eof) and (not page_count = Cint(Dvbbs.Forum_Setting(11)))
'列表内容'''''''''''''''''''''
%>
<tr>
<td class=forumRowHighlight align=center width=20>
<img src="skins/default/filetype/<%=rs("F_FileType")%>.gif" border=0>
</td>
<td class=forumRow height=23 align=center><%=rs("F_Username")%></td>
<td class="forumRowHighlight">
<%If Dvbbs.Forum_Setting(75)="1" Then%>
<a href="<%=path%><%=rs("F_Filename")%>" target=_blank><%=rs("F_Filename")%></a>
<%Else%>
<a href="<%=path%>/<%=rs("F_Filename")%>" target=_blank><%=rs("F_Filename")%></a>
<%End If%>
</td>
<td class=forumRow><%=rs("Boardtype")%></td>
<td class=forumRowHighlight><%=getsize(rs("F_FileSize"))%></td>
<td class=forumRow>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -