📄 lbbs_pic v1.03.asp
字号:
</table>
<%End If
'--自定义结束--
call showpage(c_picurl,totalput,c_MaxPerPage) '分页链接
%>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<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 Each theFile In theFolder.Files
c=c+1
if FileCount>=Int(c_MaxPerPage) then
exit for
elseif c>Int(c_MaxPerPage)*(picPage-1) then
'strFileType=lcase(mid(theFile.Name,instrrev(theFile.Name,".")+1))
FileExt = fso.GetExtensionName(theFile.Name) '获得文件的扩展名
if FileExt<>"" then
FileExt = Lcase(FileExt)
end if
If Session("lbbs_pic_delpic")="delpic" Then '点击“删除图片”时背景色样式
picbgclass="style6"
Else
picbgclass="style1"
End If
If instr(LCase(c_PicType),FileExt)>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%>">
<%
response.write "<a href='" & forder &"\"& theFile.Name & "' target='_blank'><img src='"& forder &"\"& theFile.Name & "' alt='[文件] "&theFile.Name&Chr(10)&"[大小] "&SizeTo(theFile.size)&"' border='0' onmouseover=""this.style.cursor='hand';"" onload='javascript:DrawImage(this);' width="&c_picwidth&" height="&c_picheight&" onerror=""this.src='images/Unknown.gif';""></a>"
%>
</td>
</tr>
<%If Session("lbbs_pic_delpic")="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%>
</table>
</td>
<%
Else
FileCount=FileCount-1
End if
FileCount=FileCount+1
if FileCount mod c_Page=0 then response.write "</td><tr class='tdbg'>"
TotalSize_Page=TotalSize_Page+theFile.Size
end If
Next
%>
</tr>
</table>
<%If Session("lbbs_pic_delpic")="delpic" Then
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中本页显示的所有文件</td>
<td><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';">-->
</td>
</tr>
</table>
<BR> <BR>
<%end if%>
</td></tr></table>
<%
end sub
'------------------------------------------------
'---------------------------------------
'删除单个文件或选中文件
sub DelFiles()
Call admincheck() '登录检测
dim whichfile,arrFileName,i,UploadDir2
whichfile=trim(Request("FileName"))
if whichfile="" then exit sub
if instr(whichfile,",")>0 then
arrFileName=split(whichfile,",")
for iij=0 to ubound(arrFileName)
if left(trim(arrFileName(iij)),3)<>"../" and left(trim(arrFileName(iij)),1)<>"/" then
whichfile=server.MapPath(forder &"\"& trim(arrFileName(iij)))
set thisfile=fso.GetFile(whichfile)
thisfile.Delete True
end if
Next
else
if left(whichfile,3)<>"../" and left(whichfile,1)<>"/" then
Set thisfile = fso.GetFile(server.MapPath(forder &"\"& whichfile))
thisfile.Delete True
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 adminlogin()
%>
<form method="POST" action="?action=logincheck" name="F1">
<table border="0" width="100%" class="border">
<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_delpic")=""
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() '登录检测
%>
<form method="POST" action="?action=adminsave" name="F" onSubmit="return check()">
<table border="0" width="100%" class="border">
<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"> 留空表示不作修改。</td>
</tr>
<tr>
<td width="220" align="right">再次确认密码:</td>
<td><input type="password" name="password_again" size="20"></td>
</tr>
<tr>
<td width="220" align="right">网站首页链接名称:</td>
<td><input type="text" name="HomeName" size="30" value="<%=c_HomeName%>">(空值则不显示)</td>
</tr>
<tr>
<td width="220" align="right">网站首页链接地址:</td>
<td><input type="text" name="HomeUrl" size="30" value="<%=c_HomeUrl%>"></td>
</tr>
<tr>
<td width="220" align="right">标题名:</td>
<td><input type="text" name="title" size="30" value="<%=c_title%>"></td>
</tr>
<tr>
<td width="220" align="right">图片所在文件夹:</td>
<td><input type="text" name="UploadDirg" size="30" value="<%=c_UploadDirg%>"></td>
</tr>
<tr>
<td width="220" align="right">图片类型 :</td>
<td><input type="text" name="PicType" size="30" value="<%=c_PicType%>">(使用|将图片格式分开)</td>
</tr>
<tr>
<td width="220" align="right">左则当前目录下文件:</td>
<td><INPUT TYPE="radio" value="是" NAME="filelb" <%If c_filelb="YES" Then response.write"checked"%>>显示 <INPUT TYPE="radio" value="否" NAME="filelb" <%If c_filelb<>"YES" Then response.write"checked"%>>不显示 </td>
</tr>
<tr>
<td width="220" align="right">定义功能:</td>
<td><INPUT TYPE="radio" value="是" NAME="cook" <%If c_cook="YES" Then response.write"checked"%>>显示 <INPUT TYPE="radio" value="否" NAME="cook" <%If c_cook<>"YES" Then response.write"checked"%>>不显示</td>
</tr>
<tr>
<td width="220" align="right">每页显示图片数:</td>
<td><input type="text" name="MaxPerPage" size="5" value="<%=con_MaxPerPage%>"></td>
</tr>
<tr>
<td width="220" align="right">每行显示图片数:</td>
<td><input type="text" name="Page" size="5" value="<%=con_Page%>"></td>
</tr>
<tr>
<td width="220" align="right">图片缩图宽度:</td>
<td><input type="text" name="picwidth" size="5" value="<%=con_picwidth%>"></td>
</tr>
<tr>
<td width="220" align="right">图片缩图高度:</td>
<td><input type="text" name="picheight" size="5" value="<%=con_picheight%>"></td>
</tr>
<tr>
<td width="220" align="right"></td>
<td> </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>
<script>
function check()
{
if (document.F.password.value!="" @@ document.F.password.value!=document.F.password_again.value) {
alert("两次输入的密码不相同。请重设。");
return false;
}
return true;
}
</script>
<%
End Sub
'-----------------------------------------
'-----------------------------------------
'保存参数设置
Sub adminsave()
Call admincheck() '登录检测
dim fso,hf,hf2,all
Dim n_admin_name,n_admin_password,n_HomeName,n_HomeUrl,n_title,n_UploadDirg,n_PicType,n_filelb,n_cook
Dim n_MaxPerPage,n_Page,n_picwidth,n_picheight
If trim(Request.form("username"))<>"" then
n_admin_name = chr(34) & trim(Request.form("username"))& chr(34)
Session("lbbs_pic_UserName")=trim(Request.form("username"))
Else
n_admin_name = chr(34) &c_admin_name &chr(34)
End If
If trim(Request.form("password"))<>"" then
n_admin_password = chr(34) & md5(trim(Request.form("password")))& chr(34)
Session("lbbs_pic_password")=md5(trim(Request.form("password")))
Else
n_admin_password = chr(34) &c_admin_password &chr(34)
End If
n_HomeName = chr(34) & trim(Request("HomeName"))& chr(34)
n_HomeUrl = chr(34) & trim(Request("HomeUrl"))& chr(34)
n_title = chr(34) & trim(Request("title"))& chr(34)
n_UploadDirg = chr(34) & trim(Request("UploadDirg"))& chr(34)
n_PicType = chr(34) & trim(Request("PicType"))& chr(34)
n_filelb = chr(34) & trim(Request("filelb"))& chr(34)
n_cook = chr(34) & trim(Request("cook"))& chr(34)
c_filelb = Replace(c_filelb,"YES","是")
c_cook = Replace(c_cook,"YES","是")
n_MaxPerPage = trim(Request("MaxPerPage"))
n_Page = trim(Request("Page"))
n_picwidth = trim(Request("picwidth"))
n_picheight = trim(Request("picheight"))
set fso=Server.CreateObject("Scripting.FileSystemObject")
set hf2=fso.OpenTextFile(Server.mappath(picurl),1)
if Not hf2.atendofstream Then
all = hf2.readALL
all=Replace(all,"c_admin_name="&chr(34) & c_admin_name & chr(34) &"","c_admin_name="& n_admin_name & "")
all=Replace(all,"c_admin_password="& chr(34) &c_admin_password & chr(34) &"","c_admin_password="& n_admin_password & "")
all=Replace(all,"c_HomeName="& chr(34) &c_HomeName & chr(34) &"","c_HomeName="& n_HomeName & "")
all=Replace(all,"c_HomeUrl="&chr(34) & c_HomeUrl &chr(34) & "","c_HomeUrl="& n_HomeUrl & "")
all=Replace(all,"c_title="&chr(34) & c_title &chr(34) & "","c_title="& n_title & "")
all=Replace(all,"c_UploadDirg="&chr(34) & c_UploadDirg &chr(34) & "","c_UploadDirg="& n_UploadDirg & "")
all=Replace(all,"c_PicType="&chr(34) & c_PicType &chr(34) & "","c_PicType="& n_PicType & "")
all=Replace(all,"c_cook="&chr(34) & c_cook &chr(34) & "","c_cook="& n_cook & "")
all=Replace(all,"c_filelb="&chr(34) & c_filelb &chr(34) & "","c_filelb="& n_filelb & "")
all=Replace(all,"con_MaxPerPage="& con_MaxPerPage & "","con_MaxPerPage="& n_MaxPerPage & "")
all=Replace(all,"con_Page="& con_Page & "","con_Page="& n_Page & "")
all=Replace(all,"con_picwidth="& con_picwidth & "","con_picwidth="& n_picwidth & "")
all=Replace(all,"con_picheight="& con_picheight & "","con_picheight="& n_picheight & "")
set hf=fso.CreateTextFile(Server.mappath(picurl),true)
hf.write all
hf.close
End If
hf2.close
set hf=Nothing
set hf2=Nothing
set fso=Nothing
Response.write "<script language='javascript'>alert('设置成功!');location.href='?action=admin';</script>"
response.end
End Sub
'------------------------------------------------
'------------------------------------------------
'系统版本信息
response.write "<CENTER>"
response.write "| <A HREF='"&picurl&"'>浏览图片</A> | "
response.write "<A HREF='?action=admin' class='style4'>设置管理</A> | "
If admin_login=True Then
response.write "<A HREF='?action=logout' class='style4'>退出</A> | "
End if
response.write " Powered by <a title='乐学LBBS无限级目录图片直读系统 "&c_poweredby&chr(10)&"http://www.learn365.cn/' target='_blank' href='http://www.learn365.cn/'>LBBS_pic "&c_poweredby&"</a> "
dim endtime:endtime=timer()
if isempty(starttime) then
response.write "没有程序被执行"
else
if cstr(FormatNumber((endtime-starttime)*1000,3))=".000" then
response.write "没有程序被执行"
else
response.write FormatNumber((endtime-starttime)*1000,3)&"毫秒"
end if
end if
response.write"</CENTER>"
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -