📄 admin_selectfile.asp
字号:
If sortBy <> 0 Then
Call ShowFileDetail_Fil
If SearchKeyword = "" Then
Response.Write "<tr height=1><td></td></tr>" & vbCrLf
Call ShowFileDetail_fol
End If
Else
If SearchKeyword = "" Then
Call ShowFileDetail_fol
Response.Write "<tr height=1><td></td></tr>" & vbCrLf
End If
Call ShowFileDetail_Fil
End If
Response.Write " </table>" & vbCrLf
Response.Write "<input type='hidden' name='priorsort' value='" & priorSort & "'>" & vbCrLf
Response.Write "<input type='hidden' name='sortby' value='-1'>" & vbCrLf
If currentSlot > -1 Then
Call ShowJS_Tooltip
End If
Response.Write " </form>" & vbCrLf
End Sub
Sub ShowFileDetail_Fil()
If currentSlot > -1 Then
For i = 0 To FileCount
Response.Write "<tr onmouseout=""this.className='tdbgmouseout1'"" onmouseover=""this.className='tdbg1'"">" & vbCrLf
Response.Write " <td align='left'>" & vbCrLf
Select Case LCase(theFiles(i)(1))
Case "jpeg", "jpe", "bmp", "png"
Response.Write "<img src='images/Folder/img.gif'>"
Case "swf"
Response.Write "<img src='images/Folder/Ftype_flash.gif'>"
Case "dll", "vbp"
Response.Write "<img src='images/Folder/sys.gif'>"
Case "wmv", "avi", "asf", "mpg"
Response.Write "<img src='images/Folder/Ftype_media.gif'>"
Case "rm", "ra", "ram"
Response.Write "<img src='images/Folder/Ftype_rm.gif'>"
Case "rar", "zip"
Response.Write "<img src='images/Folder/zip.gif'>"
Case "xml", "txt", "exe", "doc", "html", "htm", "jpg", "gif", "xls", "asp"
Response.Write "<img src='images/Folder/" & theFiles(i)(1) & ".gif'>"
Case Else
Response.Write "<img src='images/Folder/other.gif'>"
End Select
If DialogType = "soft" Or DialogType = "photo" Or DialogType = "productthumb" Then
Response.Write "<a href='#' onClick=""window.returnValue='" & strPath3 & theFiles(i)(0) & "|" & Round(theFiles(i)(2) / 1024) & "';window.close();"">"
Else
If ModuleType = 1 Or ModuleType = 5 Or ModuleType = 6 Or ModuleType = 7 Then
Response.Write "<a href='#' onClick=""window.returnValue='" & strPath & "/" & theFiles(i)(0) & "|" & Round(theFiles(i)(2) / 1024) & "';window.close();"">"
Else
Response.Write "<a href='#' onClick=""window.returnValue='" & strPath2 & "/" & theFiles(i)(0) & "|" & Round(theFiles(i)(2) / 1024) & "';window.close();"">"
End If
End If
Response.Write "<span onmouseover=""ShowADPreview('" & FixJs(GetFileContent(strPath & "/" & theFiles(i)(0), theFiles(i)(1))) & "')"" onmouseout=""hideTooltip('dHTMLADPreview')"">" & vbCrLf
Response.Write theFiles(i)(0) & "</span></a></td>" & vbCrLf
Response.Write " <td width='80' align='right'>" & FormatNumber(theFiles(i)(2) / 1024, 0, vbTrue, vbFalse, vbTrue) & " KB</td>" & vbCrLf
Response.Write " <td width='180'> " & theFiles(i)(3) & "</td>" & vbCrLf
Response.Write " <td width='140'>" & theFiles(i)(5) & "</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Next
End If
End Sub
Function GetFileContent(sPath, sType)
If IsNull(sPath) Or sPath = "" Then
GetFileContent = " 此文件非图片或动画,无预览 "
Exit Function
End If
If IsNull(sType) Or sType = "" Then
GetFileContent = " 此文件非图片或动画,无预览 "
Exit Function
End If
If Not fso.FileExists(Server.MapPath(sPath)) Then
GetFileContent = " 此文件不存在 "
Exit Function
End If
Dim strFile
Select Case LCase(sType)
Case "jpeg", "jpe", "bmp", "png", "jpg", "gif"
strFile = "<img src='" & sPath & "'"
strFile = strFile & " width='200'"
strFile = strFile & " height='120'"
strFile = strFile & " border='0'>"
Case "wmv", "avi", "asf", "mpg", "rm", "ra", "ram", "swf"
strFile = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'"
strFile = strFile & " width='200'"
strFile = strFile & " height='120'"
strFile = strFile & "><param name='movie' value='" & sPath & "'>"
strFile = strFile & "<param name='wmode' value='transparent'>"
strFile = strFile & "<param name='quality' value='autohigh'>"
strFile = strFile & "<embed src='" & sPath & "' quality='autohigh'"
strFile = strFile & " pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'"
strFile = strFile & " wmode='transparent'"
strFile = strFile & " width='200'"
strFile = strFile & " height='120'"
strFile = strFile & "></embed></object>"
Case Else
strFile = " 此文件非图片或动画,无预览 "
End Select
GetFileContent = strFile
End Function
Sub ShowFileDetail_fol()
Dim strHtml
Response.Write "<tr>"
strHtml = ""
For Each theSubFolder In theFolder.SubFolders
If ParentDir <> "" Then
strHtml = strHtml & "<td height='18'> <img src='Images/Folder/folderclosed.gif'><a href='" & strFileName & "&ParentDir=" & ParentDir & "/" & CurrentDir & "&CurrentDir=" & theSubFolder.name & "'>" & theSubFolder.name & "</a></td>"
Else
strHtml = strHtml & "<td height='18'> <img src='Images/Folder/folderclosed.gif'><a href='" & strFileName & "&ParentDir=" & CurrentDir & "&CurrentDir=" & theSubFolder.name & "'>" & theSubFolder.name & "</a></td>"
End If
strHtml = strHtml & "<td width='50' align=""right""> </td>"
strHtml = strHtml & "<td width='180'> 文件夹</td>"
strHtml = strHtml & "<td width='140'>" & theSubFolder.DateLastModified & "</td>"
strHtml = strHtml & "</tr><tr>"
Next
Response.Write strHtml
End Sub
Function FixJs(Str)
If Str <> "" Then
Str = Replace(Str, "'", "'")
Str = Replace(Str, "\", "\\")
Str = Replace(Str, Chr(34), "\""")
Str = Replace(Str, Chr(39), "\'")
Str = Replace(Str, Chr(13), "\n")
Str = Replace(Str, Chr(10), "\r")
Str = Replace(Str, "'", "'")
Str = Replace(Str, """", """)
End If
FixJs = Str
End Function
Function ShowJS_Tooltip()
Response.Write "<div id=dHTMLADPreview style='Z-INDEX: 1000; LEFT: 0px; VISIBILITY: hidden; WIDTH: 10px; POSITION: absolute; TOP: 0px; HEIGHT: 10px'></DIV>"
Response.Write "<SCRIPT language = 'JavaScript'>" & vbCrLf
Response.Write "<!--" & vbCrLf
Response.Write "var tipTimer;" & vbCrLf
Response.Write "function locateObject(n, d)" & vbCrLf
Response.Write "{" & vbCrLf
Response.Write " var p,i,x;" & vbCrLf
Response.Write " if (!d) d=document;" & vbCrLf
Response.Write " if ((p=n.indexOf('?')) > 0 && parent.frames.length)" & vbCrLf
Response.Write " {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}" & vbCrLf
Response.Write " if (!(x=d[n])&&d.all) x=d.all[n]; " & vbCrLf
Response.Write " for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];" & vbCrLf
Response.Write " for (i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document); return x;" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "function ShowADPreview(ADContent)" & vbCrLf
Response.Write "{" & vbCrLf
Response.Write " showTooltip('dHTMLADPreview',event, ADContent, '#ffffff','#000000','#000000','6000')" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "function showTooltip(object, e, tipContent, backcolor, bordercolor, textcolor, displaytime)" & vbCrLf
Response.Write "{" & vbCrLf
Response.Write " window.clearTimeout(tipTimer)" & vbCrLf
Response.Write " if (document.all) {" & vbCrLf
Response.Write " locateObject(object).style.top=document.body.scrollTop+event.clientY+20" & vbCrLf
Response.Write " locateObject(object).innerHTML='<table style=""font-family:宋体; font-size: 9pt; border: '+bordercolor+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: '+backcolor+'"" width=""10"" border=""0"" cellspacing=""0"" cellpadding=""0""><tr><td nowrap><font style=""font-family:宋体; font-size: 9pt; color: '+textcolor+'"">'+unescape(tipContent)+'</font></td></tr></table> '" & vbCrLf
Response.Write " if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft)) {" & vbCrLf
Response.Write " locateObject(object).style.left = (document.body.clientWidth + document.body.scrollLeft) - locateObject(object).clientWidth-10;" & vbCrLf
Response.Write " } else {" & vbCrLf
Response.Write " locateObject(object).style.left=document.body.scrollLeft+event.clientX" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write " locateObject(object).style.visibility='visible';" & vbCrLf
Response.Write " tipTimer=window.setTimeout(""hideTooltip('""+object+""')"", displaytime);" & vbCrLf
Response.Write " return true;" & vbCrLf
Response.Write " } else if (document.layers) {" & vbCrLf
Response.Write " locateObject(object).document.write('<table width=""10"" border=""0"" cellspacing=""1"" cellpadding=""1""><tr bgcolor=""'+bordercolor+'""><td><table width=""10"" border=""0"" cellspacing=""0"" cellpadding=""0""><tr bgcolor=""'+backcolor+'""><td nowrap><font style=""font-family:宋体; font-size: 9pt; color: '+textcolor+'"">'+unescape(tipContent)+'</font></td></tr></table></td></tr></table>')" & vbCrLf
Response.Write " locateObject(object).document.close()" & vbCrLf
Response.Write " locateObject(object).top=e.y+20" & vbCrLf
Response.Write " if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth)) {" & vbCrLf
Response.Write " locateObject(object).left = window.innerWidth - locateObject(object).clip.width-10;" & vbCrLf
Response.Write " } else {" & vbCrLf
Response.Write " locateObject(object).left=e.x;" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write " locateObject(object).visibility='show';" & vbCrLf
Response.Write " tipTimer=window.setTimeout(""hideTooltip('""+object+""')"", displaytime);" & vbCrLf
Response.Write " return true;" & vbCrLf
Response.Write " } else {" & vbCrLf
Response.Write " return true;" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "function hideTooltip(object) {" & vbCrLf
Response.Write " if (document.all) {" & vbCrLf
Response.Write " locateObject(object).style.visibility = 'hidden';" & vbCrLf
Response.Write " locateObject(object).style.left = 1;" & vbCrLf
Response.Write " locateObject(object).style.top = 1;" & vbCrLf
Response.Write " return false;" & vbCrLf
Response.Write " } else {" & vbCrLf
Response.Write " if (document.layers) {" & vbCrLf
Response.Write " locateObject(object).visibility = 'hide';" & vbCrLf
Response.Write " locateObject(object).left = 1;" & vbCrLf
Response.Write " locateObject(object).top = 1;" & vbCrLf
Response.Write " return false;" & vbCrLf
Response.Write " } else {" & vbCrLf
Response.Write " return true;" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "//-->" & vbCrLf
Response.Write "</SCRIPT>" & vbCrLf
End Function
Function GetUploadFileStyle()
ShowFileStyle = Request.Cookies("ShowFileStyle")
If ShowFileStyle = "" Or Not IsNumeric(ShowFileStyle) Then
ShowFileStyle = 1
Else
ShowFileStyle = Int(ShowFileStyle)
End If
GetUploadFileStyle = ShowFileStyle
End Function
Sub showpage2(sfilename, totalnumber, MaxPerPage, ShowMaxPerPage)
Dim TotalPage, strTemp, strUrl, i
If totalnumber = 0 Or MaxPerPage = 0 Or IsNull(MaxPerPage) Then
Exit Sub
End If
If totalnumber Mod MaxPerPage = 0 Then
TotalPage = totalnumber \ MaxPerPage
Else
TotalPage = totalnumber \ MaxPerPage + 1
End If
If CurrentPage > TotalPage Then CurrentPage = TotalPage
strTemp = "<table align='center'><form name='showpages' method='Post' action='" & sfilename & "'><tr><td>"
strTemp = strTemp & "共 <b>" & totalnumber & "</b> 个文件,占用 <b>" & TotalSize & "</b> " & strTotalUnit & " "
If ShowMaxPerPage = True Then
strUrl = JoinChar(sfilename) & "MaxPerPage=" & MaxPerPage & "&"
Else
strUrl = JoinChar(sfilename)
End If
If CurrentPage < 2 Then
strTemp = strTemp & "首页 上一页 "
Else
strTemp = strTemp & "<a href='" & strUrl & "page=1'>首页</a> "
strTemp = strTemp & "<a href='" & strUrl & "page=" & (CurrentPage - 1) & "'>上一页</a> "
End If
If CurrentPage >= TotalPage Then
strTemp = strTemp & "下一页 尾页"
Else
strTemp = strTemp & "<a href='" & strUrl & "page=" & (CurrentPage + 1) & "'>下一页</a> "
strTemp = strTemp & "<a href='" & strUrl & "page=" & TotalPage & "'>尾页</a>"
End If
strTemp = strTemp & " 页次:<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>页 "
If ShowMaxPerPage = True Then
strTemp = strTemp & " <input type='text' name='MaxPerPage' size='3' maxlength='4' value='" & MaxPerPage & "' onKeyPress=""if (event.keyCode==13) submit();"">" & "个文件/页"
Else
strTemp = strTemp & " <b>" & MaxPerPage & "</b>" & "个文件/页"
End If
strTemp = strTemp & " 转到:<select name='page' size='1' onchange='javascript:submit()'>"
For i = 1 To TotalPage
strTemp = strTemp & "<option value='" & i & "'"
If PE_CLng(CurrentPage) = PE_CLng(i) Then strTemp = strTemp & " selected "
strTemp = strTemp & ">第" & i & "页</option>"
Next
strTemp = strTemp & "</select>"
strTemp = strTemp & "</td></tr></form></table>"
Response.Write strTemp
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -