📄 lbbs_pic v1.07.asp
字号:
Case "delpic"
'显示删除选项
Call admincheck() '登录检测
Session("lbbs_pic_show")="delpic"
response.redirect (JoinChar(c_picurl)&"page="&picPage)
Case "delsmallpic"
'显示删除选项
Call admincheck() '登录检测
Session("lbbs_pic_show")="delsmallpic"
response.redirect (JoinChar(c_picurl)&"page="&picPage)
Case "smallpic"
'显示生成缩图选项
Call admincheck() '登录检测
Session("lbbs_pic_show")="smallpic"
response.redirect (JoinChar(c_picurl)&"page="&picPage)
Case "nodelpic"
'不显示删除选项
Session("lbbs_pic_show")=""
response.redirect (JoinChar(c_picurl)&"page="&picPage)
Case "small"
'选中文件生成缩图
call smallFiles()
Case "del"
'删除选中文件
call DelFiles()
Case "delall"
'删除当前目录所有文件
call DelAll()
Case "moddir"
'修改目录
call Moddir()
Case "moddirsave"
'保存修改的目录
call Moddirsave()
Case "adddir"
'创建新目录
call adddir()
Case "adddirsave"
'保存新创建的目录
call adddirsave()
Case "deldir"
'创建新目录
call deldir()
Case "deldirsave"
'保存新创建的目录
call deldirsave()
Case "upload"
'上传文件选择
call upload()
Case "uploadsave"
'处理上传文件
call uploadsave()
Case Else
'浏览图片
call showpic()
end Select
set fso = Nothing
%>
</table>
<%
call copyright() '版本信息
end If
'========================================
'========================================
'浏览图片
Sub showpic()
%>
<%If Session("lbbs_pic_show")="smallpic" then '生成缩略图标题行%>
<tr>
<td colspan="2" bgcolor="#4ACCDB" height="25">
<p><b>生成缩略图<font color="#FFFFFF">(生成缩略图的AspJpeg组件<%ShowObjectInstalled("Persits.Jpeg")%>,缩略图文件名以“</font><font color="#FFFF00">_[small]</font><font color="#FFFFFF">”结尾)</font></b></p></td>
</tr>
<%
end if
If Session("lbbs_pic_show")="delpic" then '删除文件标题行
%>
<tr>
<td colspan="2" bgcolor="#FF9966" height="25">
<p align="left"><b>删除文件<font color="#FFFFFF">(请慎重使用:文件一旦删除,将不可恢复。)</font></b></p></td>
</tr>
<%end if
If Session("lbbs_pic_show")="delsmallpic" then '删除缩略图标题行
%>
<tr>
<td colspan="2" bgcolor="#FFCCCC" height="25">
<p align="left"><b>删除缩略图</b></p></td>
</tr>
<%end if%> <tr class="tdbg">
<td rowspan="3" valign="top" width="<%=con_filelbtablew%>">
<%
If c_search="YES" then
'--搜索功能开始--
%>
<TABLE width="160">
<form method="POST" action="<%=JoinChar(c_picurl)%>action_search=search" name="Formsearch" id="form" onSubmit="return CheckForm_search1(this)">
<tr class="tdbg">
<td>
<p align="left">
搜索:<input type="text" name="search_key" style="border: 1px solid #C0C0C0; width: 110;height:20<%if search_key<>"" then response.write(";color:#FF0000")%>" title="输入搜索关键字!" value="<%=search_key%>"><span class="style3">
<BR>
<input type="radio" value="one" name="search_scope" checked>当前目录
<!--<input type="radio" value="all" name="search_scope">全站 -->
<input type="submit" value="搜索" name="search"> </p>
</td>
</tr>
</form>
</TABLE>
<hr color="#FFFFFF" size="1">
<%
End if
'--搜索功能结束--
%>
<a title='返回总目录' href='<%=picurl%>'><img alt='' border='0' src='images/alllist.gif' width='16' height='16'>总目录</a><br>
<%if forder<>"" then response.write"<a title='↑向上…上层目录' href='?forder="&upforder&"'><img alt='' border='0' src='images/up.gif' width='16' height='16'>上层目录</a>"%>
<BR>
<%
Response.write (ShowFolderList(TruePath))'左侧目录文件列表
'以下表格用于保证左则目录栏的最小宽度
Response.write ("<TABLE width='"&con_filelbtablew&"'><tr class=tdbg><td> </td></tr></TABLE>")
%>
</td>
<td height="24" style="width: 800px; height: 12px;">
转到目录:<select size="1" name="forder" onchange="javascript:window.location='?forder='+this.options[this.selectedIndex].value;">
<option value="" style="COLOR: #808000" selected>--请选择图片目录--</option>
<option value="">--总目录--</option>
<% call bl(0,"◆",c_UploadDirg) '遍历站点所有文件夹作为下拉列表 %>
</select>
当前位置:<A HREF="?forder=<%=forder%>"><font color='#0000ff'><U><%=replace(replace(forder,".",""),c_UploadDirg,"总目录")%></U></font></A>
</td>
</tr>
<%
'--自定义图片张数尺寸开始--
If c_cook = "YES" Then
%>
<form method="POST" action="<%=JoinChar(c_picurl)%>action_cook=cookies">
<tr class="tdbg">
<td height="30" style="height: 15px; width: 800px;" valign="top">
<p align="left">
自定义:<span class="style3">每页图片数</span><input type="text" name="cook_MaxPerPage" size="5" value="<%=c_MaxPerPage%>" style="border: 1px solid #808000; width: 25px;" title="输入1-30之间的数字!"><span class="style3">
每行图片数</span><input type="text" name="cook_Page" size="12" value="<%=c_Page%>" style="border: 1px solid #808000; width: 21px;" title="输入1-10之间的数字!">
图片宽<input type="text" name="cook_picwidth" size="10" value="<%=c_picwidth%>" style="border: 1px solid #808000; width: 42px;" title="输入20-800之间的数字!">
高<input type="text" name="cook_picheight" size="10" value="<%=c_picheight%>" style="border: 1px solid #808000; width: 39px;" title="输入20-800之间的数字!"></font>
<select size="1" name="CookieTime" class="input">
<option selected value="0">是否记忆</option>
<option value="1">记忆一天</option>
<option value="2">记忆一周</option>
<option value="3">记忆一月</option>
<option value="4">记忆一年</option>
</select>
<input type="submit" value="提交" name="B1">
<input type="button" value="恢复默认值" name="B3" onClick="window.location.href='<%=JoinChar(c_picurl)%>action_cook=con'">
</p>
</td>
</tr>
</form>
<%End If
'--自定义图片张数尺寸结束--
%>
<tr class="tdbg">
<td height="30" style="height: 15px; width: 800px;" valign="top">
<% call main()'图片列表 %>
</td>
</tr>
<%
End Sub
'========================================
'========================================
'遍历站点所有文件夹作为下拉列表
'i全角的空格 数
'sty符号
'strpath文件夹路径
function bl(i,sty,strpath)
Dim objfolder,objfile,newstrpath,picFile,pi,pi2,picExt,objsubfolder,search_pic
set objfolder=fso.getfolder(server.mappath(strpath))
for each objsubfolder in objfolder.subfolders
pi=0
pi2=0
For Each picFile In objsubfolder.Files
picExt=LCase(Right(Trim(picFile.name),3))
If instr(LCase(c_PicType),picExt)>0 And instr(LCase(picFile.name),"_[small]")=0 Then
pi=pi+1
ElseIf instr(LCase(c_TxtType),picExt)>0 And Session("lbbs_pic_show")<>"smallpic" then
pi2=pi2+1
End If
Next
If CInt(pi)>0 Then pi=" "&pi&"P" Else pi=""
If CInt(pi2)>0 Then pi2=" "&pi2&"F" Else pi2=""
Response.write ("<option value='" & strpath & "/"& objsubfolder.name & "'")
if forder=strpath& "/"& objsubfolder.name then
Response.write (" style='COLOR: #0000ff' selected ")
end If
Response.write (">"&string(i," ")&""& sty & objsubfolder.name & pi & pi2 &"</option>")
i=i+1
call bl(i+1," ",strpath & "/"& objsubfolder.name)
i=i-1
next
End function
'========================================
'========================================
'图片列表
sub main()
Dim theFile_small,theFiletosmall,theFilesrcurl,theFile_time,theFile_name,theFile_size
dim c,GetFiles,f,one,two,TempName,TempTime,TempSize,j,k
Dim orderByConditions,FileArr(),i,p,Max,OrderBy,Total,PageStart,PageEnd
Dim PCount,PFSize,APFSize,fsoFolder,FilterName
'页码
picPage=trim(request("page"))
if picPage<>"" then
picPage=cint(picPage)
else
picPage=1
end if
'得到目录下所有文件的信息集合
set fsoFolder=fso.GetFolder(TruePath)
Set GetFiles =fsoFolder.files
'定义了文件总数的数组(0为文件名,1为日期时间,2为文件大小)
ReDim FileArr(Getfiles.count-1,2)
i = 0
For Each f In GetFiles
FileExt = fso.GetExtensionName(f.Name) '获得文件的扩展名
if FileExt<>"" then
FileExt = Lcase(FileExt)
end If
If ((instr(LCase(c_PicType),FileExt)>0 And instr(LCase(f.Name),"_[small]")=0) Or (instr(LCase(c_TxtType),FileExt)>0) And Session("lbbs_pic_show")<>"smallpic") and instr(LCase(f.name),search_key)>0 Then
FileArr(i,0) = f.Name '文件名
If c_PicPaixutime="CR" Then
FileArr(i,1) = f.DateCreated '建立日期
elseIf c_PicPaixutime="LA" Then
FileArr(i,1) = f.DateLastAccessed '最近一次存取日期与时间
elseIf c_PicPaixutime="LM" Then
FileArr(i,1) = f.DateLastModified '最近一次修改日期与时间
End if
FileArr(i,2) = f.Size '文件大小
APFSize=APFSize+f.Size '文件总大小
i = i + 1
End If
Next
'对文件进行排序按日期,OrderBy等于DESC降序,OrderBy等于ASC升序
Dim FileArrOne,FileArrTwo
If c_PicPaixu="TIME" Or c_PicPaixu="SIZE" then
For One = 0 To i - 1
For Two = 0 To i - 1
If c_PicPaixu="TIME" then
FileArrOne=FileArr(One,1)
FileArrTwo=FileArr(Two,1)
ElseIf c_PicPaixu="SIZE" then
FileArrOne=FileArr(One,2)
FileArrTwo=FileArr(Two,2)
End if
IF Ucase(c_orderBy) = "DESC" Then
orderByConditions=(FileArrOne > FileArrTwo)
ElseIF Ucase(c_orderBy) = "ASC" Then
orderByConditions=(FileArrOne < FileArrTwo)
End If
IF orderByConditions Then
TempName = FileArr(Two,0)
TempTime = FileArr(Two,1)
TempSize = FileArr(Two,2)
FileArr(Two,0) = FileArr(One,0)
FileArr(Two,1) = FileArr(One,1)
FileArr(Two,2) = FileArr(One,2)
FileArr(One,0) = TempName
FileArr(One,1) = TempTime
FileArr(One,2) = TempSize
End IF
Next
Next
End if
'得到总页数
Total=i
IF Total Mod c_MaxPerPage = 0 Then
PCount = ToTal / c_MaxPerPage
Else
PCount = Total \ c_MaxPerPage + 1
End IF
IF picpage > PCount Then picpage = PCount
'得到当前页的文件位置,开始地址如果为第一页则其实位置是0,因为数组的下限是0
PageStart = picpage * c_MaxPerPage - c_MaxPerPage
IF (Total-1-c_MaxPerPage) > PageStart Then
PageEnd=PageStart+c_MaxPerPage-1
Else
PageEnd=(Total-1)
End If
'显示列表
%>
<form name="myform" method="Post" action="?forder=<%=forder%>&page=<%=picPage%>" onsubmit="return confirm('你确定要执行操作吗?');">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="3" class="border">
<tr class="tdbg">
<%
For j = PageStart To PageEnd
theFile_Name = FileArr(j,0)
theFile_time = FileArr(j,1)
theFile_size = FileArr(j,2)
FileExt=lcase(mid(theFile_Name,instrrev(theFile_Name,".")+1)) '获得文件的扩展名
If Session("lbbs_pic_show")="delpic" Then '点击“删除图片”时背景色样式
picbgclass="pic_delstyle"
Elseif Session("lbbs_pic_show")="smallpic" Then '点击“生成缩图”时背景色样式
picbgclass="pic_smallstyle"
Elseif Session("lbbs_pic_show")="delsmallpic" Then '点击“删除缩图”时背景色样式
picbgclass="pic_delsmallstyle"
Else
picbgclass="pic_showstyle"
end if
If ((instr(LCase(c_PicType),FileExt)>0 And instr(LCase(theFile_Name),"_[small]")=0) Or (instr(LCase(c_TxtType),FileExt)>0) And Session("lbbs_pic_show")<>"smallpic") and instr(LCase(theFile_Name),search_key)>0 Then
%>
<td>
<table width="100%" height="100%" border="0" cellpadding="0">
<tr>
<td align="center" width="<%=c_picwidth%>" height="<%=c_picheight+10%>" class="<%=picbgclass%>">
<%
If instr(LCase(c_PicType),FileExt)>0 Then
theFile_small=Replace(theFile_Name,Right(theFile_Name,4),"_[small]"& Right(theFile_Name,4)) '缩略图
If fso.FileExists(Server.Mappath(forder &"\"&theFile_small))=true Then '检查缩略图是否存在
theFile_small=theFile_small
theFiletosmall=True
Else
theFile_small=theFile_Name
theFiletosmall=false
End If
response.write "<a href='"&URLEncode(forder &"\"& theFile_Name)&"' target='_blank'><img src='"&URLEncode(forder &"\"& theFile_small)&"' alt='[文件] "&theFile_Name&Chr(10)&"[时间] "&theFile_time&Chr(10)&"[大小] "&SizeTo(theFile_size)&"' border='0' onmouseover=""this.style.cursor='hand';"" onload='javascript:DrawImage(this);' width="&c_picwidth&" height="&c_picheight&"></a>"
ElseIf instr(LCase(c_TxtType),FileExt)>0 and Session("lbbs_pic_show")<>"smallpic" Then
response.write "<p align='left'><a href='"&theFilesrcurl&"' target='_blank'><img src='images/" & FileExt & ".gif' border='0' onmouseover=""this.style.cursor='hand';"" class='imgmid' onerror=""this.src='images/noknow.gif';""><font color='#0066FF' style='font-size: 11pt;'>"&theFile_Name&"</font></a>"
End if
%>
</td>
</tr>
<tr>
<td align="left">
<%
If c_shownane="YES" Then'显示图片文件名
response.write "<font color='#0066FF'>"&j+1&".</font>"
If instr(LCase(c_PicType),FileExt)>0 Then
response.write Replace(theFile_Name,search_key,"<font color=#FF9900>"&search_key&"</font>")&" ["&SizeTo(theFile_size)&"]"
Else
response.write "["&theFile_size&"]"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -