📄 lbbs_pic v1.07.asp
字号:
End if
End if
%>
</td>
</tr>
<%If Session("lbbs_pic_show")="delpic" Then '删除图片选择%>
<tr>
<td><input name="FileName" type="checkbox" id="FileName" value="<%=theFile_Name%>" onclick="unselectall()">选中 <a href="<%=JoinChar(c_picurl)%>Action=Del&page=<%=picPage%>&FileName=<%=theFile_Name%>" onclick="return confirm('删除后不可恢复,你真的要删除吗?')" ><font color='#FF0000'>单个删除</font></a></td>
</tr>
<%
End If
If Session("lbbs_pic_show")="delsmallpic" Then '删除缩略图%>
<tr>
<td>
<%If theFiletosmall=false Then '无缩略图%>
<font color='#A5A5A5'>(此图无缩略图)</font>
<%elseIf theFiletosmall=true Then '未有缩略图%>
<input name="FileName" type="checkbox" id="FileName" value="<%=theFile_Name%>" onclick="unselectall()">选中 <a href="<%=JoinChar(c_picurl)%>Action=Del&page=<%=picPage%>&FileName=<%=theFile_Name%>" onclick="return confirm('你真的要删除缩略图吗?')" ><font color='#FF00CC'>删除缩略图</font></a>
<%End If%>
</td>
</tr>
<%
End If
If Session("lbbs_pic_show")="smallpic" and instr(LCase(c_PicType),FileExt)>0 Then '生成缩略图选择
%>
<tr>
<td>
<%If theFiletosmall=true Then '已有缩略图%>
<font color='#A5A5A5'>(已有缩略图)</font>
<%elseIf theFiletosmall=false Then '未有缩略图%>
<input name="FileName" type="checkbox" id="FileName" value="<%=theFile_Name%>" onclick="unselectall()">选中 <a href="<%=JoinChar(c_picurl)%>Action=small&page=<%=picPage%>&FileName=<%=theFile_Name%>" onclick="return confirm('你真的要生成缩图吗?生成缩图需要AspJpeg组件支持(如果图片很小就无生成缩图必要)')" ><font color='#0000FF'><B>单个生成缩图</B></font></a>
<%End If%>
</td>
</tr>
<%
End If
%>
</table>
</td>
<%Else
FileCount=FileCount-1
End if
FileCount=FileCount+1
PFSize = PFSize + theFile_Size
if FileCount mod c_Page=0 then response.write "</td><tr class='tdbg'>"
Next
Set fsoFolder=Nothing
Set GetFiles=Nothing
%>
</tr>
</table>
<%If Session("lbbs_pic_show")="delpic" or Session("lbbs_pic_show")="smallpic" Or Session("lbbs_pic_show")="delsmallpic" Then
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="180" height="30">
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中本页显示的所有文件</td>
<td>
<%If Session("lbbs_pic_show")="delpic" Or Session("lbbs_pic_show")="delsmallpic" Then '删除图片选择%>
<input name="Action" type="hidden" id="Action" value="Del">
<input name="forder" type="hidden" id="forder" value="<%=forder%>">
<input type="submit" name="Submit" value="删除选中的文件">
<!--<input type="submit" name="Submit2" value="删除当前目录所有文件" onClick="document.myform.Action.value='DelAll';">-->
<%elseIf Session("lbbs_pic_show")="smallpic" Then '生成缩图选择%>
<input name="Action" type="hidden" id="Action" value="small">
<input name="forder" type="hidden" id="forder" value="<%=forder%>">
<input type="submit" name="Submit" value="选中的文件生成缩略图">
<%end if%>
</td>
</tr>
</table>
<%
end If
'上一页、下一页链接
Dim search_keylat,sfilename
if search_key<>"" then
search_keylat="搜索<font color=#FF9900>["&search_key&"]</font>结果:"
end if
If forder = "" Then
sfilename = c_picurl &"?search_key="&search_key&"&"
Else
sfilename = c_picurl &"&search_key="&search_key&"&"
End If
Response.Write "<table><tr><td colspan=4 align=right>"
Response.Write ""&search_keylat&" 当前目录共有<B>"&total&"</B>个文件 "
Response.Write "<B>" & SizeTo(APFSize) & "</B>"
Response.Write "(本页<B>" & PageEnd-PageStart+1 & "</B>个"
Response.Write "<B>" & SizeTo(PFSize) & "</B>) "
IF picPage > 1 Then
Response.Write "<a title='首页' href=" & sfilename & "page=1>首页</a> <a title='上一页,第"&(picPage-1)&"页' href=" & sfilename & "page="&picpage-1&">上一页</a>"
Else
Response.Write "首页 上一页 "
End IF
IF picPage < PCount Then
Response.Write "<a title='下一页,第"&(picPage+1)&"页' href=" & sfilename & "page="&picpage+1&">下一页</a> <a title='尾页' href=" & sfilename & "page="&PCount&">尾页</a> "
Else
Response.Write "下一页 尾页 "
End IF
Response.Write "<B><font color=red>" & picPage & "</font>/"&PCount&"</B>页 "
response.write " 转到:<select name='page' size='1' onchange=""javascript:window.location='"&sfilename&"page="& "'+this.options[this.selectedIndex].value;"">"
for i= 1 to PCount
response.write "<option value='" & i & "'"
if cint(picPage)=cint(i) then response.write " selected "
response.write ">第" & i & "页</option>"
next
response.write "</select>"
Response.Write "</td></tr>"
Response.WRite "</table>"
End sub
'------------------------------------------------
'---------------------------------------
'删除单个文件或选中文件
sub DelFiles()
Call admincheck() '登录检测
dim whichfile,whichfile_small,arrFileName,i,UploadDir2
whichfile=trim(Request("FileName"))
if whichfile="" then exit sub
if instr(whichfile,",")>0 then
arrFileName=split(whichfile,",")
for i=0 to ubound(arrFileName)
if left(trim(arrFileName(i)),3)<>"../" and left(trim(arrFileName(i)),1)<>"/" Then
whichfile=server.MapPath(forder &"/"& trim(arrFileName(i)))
if Session("lbbs_pic_show")="delpic" Then
set thisfile=fso.GetFile(whichfile)
thisfile.Delete True
End if
whichfile_small=Replace(trim(arrFileName(i)),Right(trim(arrFileName(i)),4),"_[small]"& Right(trim(arrFileName(i)),4)) '缩略图
If fso.FileExists(Server.Mappath(forder &"/"&whichfile_small)) Then '检查缩略图是否存在,存在则删除
fso.deleteFile(Server.Mappath(forder &"/"&whichfile_small)),true
End if
end if
Next
else
if left(whichfile,3)<>"../" and left(whichfile,1)<>"/" Then
if Session("lbbs_pic_show")="delpic" Then
Set thisfile = fso.GetFile(server.MapPath(forder &"/"& whichfile))
thisfile.Delete True
End if
whichfile_small=Replace(whichfile,Right(whichfile,4),"_[small]"& Right(whichfile,4)) '缩略图
If fso.FileExists(Server.Mappath(forder &"/"&whichfile_small)) Then '检查缩略图是否存在,存在则删除
fso.deleteFile(Server.Mappath(forder &"/"&whichfile_small)),true
End if
end if
end If
forder=Replace(forder,"\","/")
Response.Write("<script>alert('所选文件删除成功!(对应的缩略图随之删除了)');location.href='?forder="&forder&"&page="&picPage&"';</script>")
Response.end
end sub
'删除所有文件
sub DelAll()
Call admincheck() '登录检测
Set theFolder=fso.GetFolder(TruePath)
For Each theFile In theFolder.Files
theFile.Delete True
next
Response.Write("<script>alert(""本目录所有文件删除成功!"");location.href='"&c_picurl&"';</script>")
Response.end
end Sub
'---------------------------------------
'---------------------------------------
'生成缩略图,单个文件或选中文件
sub smallFiles()
Call admincheck() '登录检测
If IsObjInstalled("Persits.Jpeg")=false Then
Response.Write("<script>alert('没有AspJpeg组件,无法生成缩略图!');location.href='?forder="&forder&"&page="&picPage&"';</script>")
exit Sub
End if
dim whichfile,whichfile_small,arrFileName,i,UploadDir2
whichfile=trim(Request("FileName"))
if whichfile="" then exit sub
if instr(whichfile,",")>0 then
arrFileName=split(whichfile,",")
for i=0 to ubound(arrFileName)
if left(trim(arrFileName(i)),3)<>"../" and left(trim(arrFileName(i)),1)<>"/" Then
whichfile_small=Replace(trim(arrFileName(i)),Right(trim(arrFileName(i)),4),"_[small]"& Right(trim(arrFileName(i)),4)) '缩略图
If fso.FileExists(Server.Mappath(forder &"/"&whichfile_small))=false Then '检查缩略图是否存在,不存在则生成
call pic_small(forder&"/",trim(arrFileName(i)))
End if
end if
Next
else
if left(whichfile,3)<>"../" and left(whichfile,1)<>"/" then
whichfile_small=Replace(whichfile,Right(whichfile,4),"_[small]"& Right(whichfile,4)) '缩略图
If fso.FileExists(Server.Mappath(forder &"/"&whichfile_small))=false Then '检查缩略图是否存在,不存在则生成
call pic_small(forder &"/",whichfile)
End if
end if
end If
forder=Replace(forder,"\","/")
Response.Write("<script>alert('所选图片生成缩略图成功!');location.href='?forder="&forder&"&page="&picPage&"';</script>")
Response.end
end sub
'-----------------------------------------
'-----------------------------------------
'如果有缩图组件、则生成缩图
sub pic_small(formPath,sSaveFileName)
Dim n_sSaveFileName,jpegs
If IsObjInstalled("Persits.Jpeg") then
Set jpegs = Server.CreateObject("Persits.Jpeg")
Jpegs.Open Server.MapPath(""&formPath & sSaveFileName &"") ' 打开上传图片
'生成的缩图大小
if Jpegs.OriginalWidth>con_pic_small_w then
Jpegs.Width = con_pic_small_w
Jpegs.Height = (Jpegs.Originalheight/Jpegs.OriginalWidth)*con_pic_small_w
elseif Jpegs.OriginalWidth>con_pic_small_h Then
Jpegs.Width = (Jpegs.OriginalWidth/Jpegs.Originalheight)*con_pic_small_h
Jpegs.Height = con_pic_small_h
else
Jpegs.Width = Jpegs.OriginalWidth
Jpegs.Height = Jpegs.Originalheight
end If
n_sSaveFileName=Replace(sSaveFileName,Right(sSaveFileName,4),"_[small]"& Right(sSaveFileName,4)) '缩图文件名
Jpegs.Save Server.MapPath(""& formPath & n_sSaveFileName &"")' 保存文件
Jpegs.Close
Set jpegs = Nothing ' 注销对象
End If
End sub
'-----------------------------------------
'-----------------------------------------
'管理员登录
Sub adminlogin()
%>
<form method="POST" action="?action=logincheck" name="F1">
<table border="0" width="100%" class="border">
<tr>
<td width="220" align="right"> </td>
<td> </td>
</tr>
<tr>
<td width="220" align="right"> </td>
<td><span lang="zh-cn"><b>管理登录</b></span></td>
</tr>
<tr>
<td width="220" align="right"> </td>
<td> </td>
</tr>
<tr>
<td width="220" align="right"><span lang="zh-cn">用户名:</span></td>
<td height="21"><input type="text" name="username" size="20" value=""></td>
</tr>
<tr>
<td width="220" align="right">密 码:</td>
<td><input type="password" name="password" size="20"></td>
</tr>
<tr>
<td width="220" align="right"> </td>
<td><input type="submit" value="提交" name="B1"> <input type="reset" value="重置" name="B2"></td>
</tr>
</table>
</form>
<%
End Sub
'----------------------------------------
'----------------------------------------
'登录
sub logincheck()
If trim(Request.form("username"))<>c_admin_name Then
Response.write "<script language='javascript'>alert('管理用户名不正确!');history.go(-1);</script>"
response.End
Exit Sub
End If
If md5(trim(Request.form("password")))<>c_admin_password Then
Response.write "<script language='javascript'>alert('密码不正确!');history.go(-1);</script>"
response.End
Exit Sub
End If
Session("lbbs_pic_UserName")=trim(Request("username"))
Session("lbbs_pic_password")=md5(trim(Request("password")))
response.redirect ("?action=admin")
response.end
End sub
'----------------------------------------
'----------------------------------------
'退出登录
sub adminlogout()
Session("lbbs_pic_UserName")=""
Session("lbbs_pic_password")=""
Session("lbbs_pic_show")=""
response.redirect (picurl)
response.end
End sub
'----------------------------------------
'----------------------------------------
'登录检测
Sub admincheck()
If Session("lbbs_pic_UserName")<>c_admin_name or Session("lbbs_pic_password")<>c_admin_password Then
Response.write "<script language='javascript'>location.href='?action=login';</script>"
response.End
Exit Sub
End If
End Sub
'---------------------------------------
'---------------------------------------
'管理/参数设置
Sub admin()
Call admincheck() '登录检测
%>
<script>
<!--
function ascheck()
{
if (document.admin.password.value!=""){
if (document.admin.password.value!=document.admin.password_again.value) {
alert("两次输入的密码不相同。请重设。\n\n如果不想修改密码,请留空。");
admin.password_again.focus();
return false;
}
}
return true;
}
//-->
</script>
<form method="POST" action="?action=adminsave" name="admin" onSubmit="return ascheck()">
<table border="0" width="100%" class="border">
<tr>
<td width="220" align="right"> </td>
<td> </td>
</tr>
<tr>
<td width="220" align="right"> </td>
<td><span lang="zh-cn"><b>参数设置</b></span></td>
</tr>
<tr>
<td width="220" align="right"> </td>
<td> </td>
</tr>
<tr>
<td width="220" align="right"><span lang="zh-cn">登录用户名 :</span></td>
<td height="21"><input type="text" name="username" size="20" value="<%=c_admin_name%>"></td>
</tr>
<tr>
<td width="220" align="right">登录密码 :</td>
<td><input type="password" name="password" size="20"> <font color='#009900'>留空表
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -