📄 matrix3_piclist.asp
字号:
<!-- #include file="const.asp" -->
<%
call opendb()
checkadmin()
call closedb()
dim pic_siteurl
pic_siteurl=getpath123("http://"&request.ServerVariables("SERVER_NAME")&":"&request.ServerVariables("SERVER_PORT")&request.ServerVariables("URL"))
pic_siteurl=replace(pic_siteurl,":80","")
if right(pic_siteurl,1)<>"/" then pic_siteurl=pic_siteurl&"/"
function getpath123(str123)
if isnull(str123) then exit function
if instr(str123,"/")>0 then
getpath123=lcase(left(str123,instrRev(str123,"/")-1))
else
getpath123=""
end if
end function
%>
<html>
<head>
<title>
<%=sitename%>
</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function viewurl(src)
{
document.all.url.innerHTML="<a href='" + src + "' target='_blank'>" + src + "</a>";
}
function alertwin(url)
{
if(confirm("警告:确定要删除文件吗?"))
{
location.href=url;
}
}
function ow(src,win_width,win_height)
{
window.open(src,'','width='+win_width+',height='+win_height+',resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no');
return false;
}
window.focus();
</script>
<script language="JavaScript">
<!--
tPopWait=200; //停留tWait豪秒后显示提示。
tPopShow=5000; //显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=95;
fontcolor="#000000";
bgcolor="#EDEDED";
bordercolor="#007db5";
sPop=null;curShow=null;tFadeOut=null;tFadeIn=null;tFadeWaiting=null;
document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText { background-color: " + bgcolor + ";color:" + fontcolor + "; border: 1px " + bordercolor + " solid; font-size: 9pt; padding-right: 2px; padding-left: 2px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");
function showPopupText(){
var o=event.srcElement;
MouseX=event.x;
MouseY=event.y;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
if(o.dypop!=sPop) {
sPop=o.dypop;
clearTimeout(curShow);
clearTimeout(tFadeOut);
clearTimeout(tFadeIn);
clearTimeout(tFadeWaiting);
if(sPop==null || sPop=="") {
dypopLayer.innerHTML="正在读取数据。。。请稍等";
dypopLayer.style.filter="Alpha()";
dypopLayer.filters.Alpha.opacity=0;
}
else {
if(o.dyclass!=null) popStyle=o.dyclass
else popStyle="cPopText";
curShow=setTimeout("showIt()",tPopWait);
}
}
}
function showIt(){
dypopLayer.className=popStyle;
dypopLayer.innerHTML=sPop;
popWidth=dypopLayer.clientWidth;
popHeight=dypopLayer.clientHeight;
if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
else popTopAdjust=0;
dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
dypopLayer.style.filter="Alpha(Opacity=00)";
fadeOut();
}
function fadeOut(){
if(dypopLayer.filters.Alpha.opacity<popOpacity) {
dypopLayer.filters.Alpha.opacity+=showPopStep;
tFadeOut=setTimeout("fadeOut()",1);
}
else {
dypopLayer.filters.Alpha.opacity=popOpacity;
tFadeWaiting=setTimeout("fadeIn()",tPopShow);
}
}
function fadeIn(){
if(dypopLayer.filters.Alpha.opacity>0) {
dypopLayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);
}
}
document.onmouseover=showPopupText;
-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td height="12" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="90" height="16" bgcolor="#A0AB6D"> <span class="v8b"> <img src="images/fang-1.gif" align="absmiddle">
</span><span class="v7"><font color="#FFFFFF">图片夹</font></span></td>
<td height="16" nowrap bgcolor="#CCCCCC" class="v8b"> </td>
</tr>
</table>
<%
dim objFSO,objFolder,pic_url,i,color,objFile,dfile,action1
pic_url=""
dfile=trim(request.QueryString("file"))
action1=trim(request.QueryString("action"))
set objFSO=Server.CreateObject("Scripting.FileSystemObject")
if action1="delete" and dfile<>"" then
FileDelete(dfile)
end if
dim ProPerType,PicIcon
ProPerType="*.jpg,*.gif,*.ico"
PicIcon="images/folder.jpg"
'if not objFSO.FolderExists(Server.MapPath("uploadImages")) then
' objFSO.CreateFolder(Server.MapPath("uploadImages"))
'end if
set objFolder=objFSO.GetFolder(Server.MapPath("UploadFiles"))
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr valign="middle" bgcolor="#F0F0F0">
<td width="8%" height="30" align="center" nowrap>图标</td>
<td width="31%" height="30" align="center" nowrap>文件名</td>
<td width="16%" align="center" nowrap>大小</td>
<td width="15%" height="30" align="center" nowrap>类型</td>
<td width="15%" height="30" align="center" nowrap>时间</td>
<td width="8%" align="center" nowrap>删除</td>
<td width="7%" align="center" nowrap>选择</td>
</tr>
<%
i=1
For Each objFile in objFolder.Files
if JudgeType(objFile.Name)=true then
if (i mod 2)=0 then
color="#EBF5F5"
else
color="#FFFFFF"
end if
pic_url=pic_siteurl&"UploadFiles/"&objFile.Name
%>
<tr valign="middle">
<td width="8%" height="24" align="center" nowrap bgcolor="<%=color%>"><a href="#" OnClick="viewurl('<%=pic_url%>')"><img title="查看图片地址" src="images/<%=GetFileType(objFile.Name)%>.ico" width="16" height="16" border="0" align="absmiddle" id="selPic"></a></td>
<td width="31%" height="24" align="center" nowrap bgcolor="<%=color%>"><a href="#" title="<img src='<%=pic_url%>'>" OnClick="return ow('<%=pic_url%>',600,450)"><%=objFile.Name%></a></td>
<td width="16%" height="24" align="center" nowrap bgcolor="<%=color%>">
<%= objFile.Size %> 字节</td>
<td width="15%" height="24" align="center" nowrap bgcolor="<%=color%>"><%= objFile.Type %></td>
<td width="15%" height="24" align="center" nowrap bgcolor="<%=color%>"><%= datevalue(objFile.DateCreated) %></td>
<td width="8%" height="24" align="center" nowrap bgcolor="<%=color%>"><a href="javascript:alertwin('matrix3_piclist.asp?action=delete&file=<%=objFile.Name%>')" title="删除图片!请注意图片删除后不可恢复">删除</a></td>
<td width="7%" height="24" align="center" nowrap bgcolor="<%=color%>">
<a href=# title="插入图片到文章内容编辑框" onClick="self.opener.top.document.frames.EditBox.IMAGESelect('<%=pic_url%>');">选择</a></td>
</tr>
<%
i=i+1
end if
Next
set objFSO=nothing
set objFolder =nothing
%>
</table>
<table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr bgcolor="#F5F5F5">
<td width="8%" nowrap> 图片地址: </td>
<td width="92%" nowrap> <span id="url" name="url"> <font color="#666666"><
请点击图片前的图标查看该图片地址></font></span></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="2" bgcolor="#ECE9D9"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
function WrapName(str,num)
strlen=len(str)
temp=""
do while strlen<>0 and strlen>num
temp=temp&left(str,num)&"<br>"
str=right(str,(strlen-num))
strlen=len(str)
loop
temp=temp&str
WrapName=temp
end function
function GetParentName(folder)
GetParentName=Left(folder,abs(InStrRev(folder,"/")-1))
end function
function GetFileType(filename)
GetFileType=right(filename,len(filename)-InStrRev(filename,"."))
end function
function JudgeType(filename)
dim filetype
filetype=GetFileType(filename)
if instr(1,ProPerType,filetype)>0 then
JudgeType=true
PicIcon="images/"&filetype&".gif"
else
JudgeType=false
end if
end function
function FolderNew(folder)
If not objFSO.FolderExists(folder) Then
objFSO.CreateFolder(folder)
FolderNew="Succeeded"
else
FolderNew="Existed"
end if
end function
function FolderDelete(folder)
If not objFSO.FolderExists(folder) Then
objFSO.DeleteFolder(folder)
FolderDelete="Succeeded"
else
FolderDelete="NotFound"
end if
end function
function FileDelete(filename)
If objFSO.FileExists(Server.MapPath("UploadFiles/"&filename)) Then
objFSO.DeleteFile(Server.MapPath("UploadFiles/"&filename))
FileDelete="Succeeded"
else
FileDelete="NotFound"
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -