?? lbbs_pic v1.03.asp
字號:
.style2 {
text-align: left;background-color: #99CCFF; height: 28px;
}
.style3 {
color: #000000;
}
.style4 {
color: #0066FF;
}
#copyright em { color: #FF9D25; }
#copyright em { font-weight: bold; }
em { font-style: normal; font-weight: normal; }
.style5 {
text-align: left;
background-color: #CCFFCC;
color: #000000;
}
.style6 {
border: 1px solid #c0c0c0;
background-color: #CCFFFF;
}
/*鼠標懸停在圖片上時提示框樣式*/
.TableBody {
BACKGROUND: #E3E6FD; LINE-HEIGHT: 150%
}
TH {
FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #FFFFFF; HEIGHT: 18px; BACKGROUND-COLOR: #3399FF
}
TD.TableBody1 {
LINE-HEIGHT: normal; BACKGROUND-COLOR: #FFFFFF
}
/*鼠標懸停在圖片上時提示框樣式*/
</STYLE>
</head>
<SCRIPT language=javascript>
<!--
function unselectall()
{
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll")
e.checked = form.chkAll.checked;
}
}
//----------------------
//圖片等比例縮圖
flag=false
function DrawImage(ImgD)
{
var image=new Image();
image.src=ImgD.src;
image.alt=ImgD.alt;
if(image.width>0 && image.height>0){
flag=true;
if(image.width/image.height>= <%=c_picwidth%>/<%=c_picheight%>){
if(image.width><%=c_picwidth%>){
ImgD.width=<%=c_picwidth%>;
ImgD.height=(image.height*<%=c_picwidth%>)/image.width;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.alt+"\n[尺寸] "+image.width+"x"+image.height+" 像素";
}else{
if(image.height><%=c_picheight%>){
ImgD.height=<%=c_picheight%>;
ImgD.width=(image.width*<%=c_picheight%>)/image.height;
}else{
ImgD.width=image.width;
ImgD.height=image.height;
}
ImgD.alt=image.alt+"\n[尺寸] "+image.width+"x"+image.height+" 像素";
}
}
}
//-------------------------
//鼠標懸停在圖片上時提示框
var pltsPop=null;
var pltsoffsetX = 10; // 彈出窗口位于鼠標左側或者右側的距離;3-12 合適
var pltsoffsetY = 15; // 彈出窗口位于鼠標下方的距離;3-12 合適
var pltsTitle="";
document.write('<div id=pltsTipLayer style="display: none;position: absolute; z-index:10001"></div>');
function pltsinits()
{
document.onmouseover = plts;
document.onmousemove = moveToMouseLoc;
}
function plts()
{ var o=event.srcElement;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
pltsPop=o.dypop;
if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined")
{
pltsTipLayer.style.left=-1000;
pltsTipLayer.style.display='';
var Msg=pltsPop.replace(/\n/g,"<br>");
Msg=Msg.replace(/\0x13/g,"<br>");
var re=/\{(.[^\{]*)\}/ig;
if(!re.test(Msg))pltsTitle="信息提示";
else{
re=/\{(.[^\{]*)\}(.*)/ig;
pltsTitle=Msg.replace(re,"$1")+" ";
re=/\{(.[^\{]*)\}/ig;
Msg=Msg.replace(re,"");
Msg=Msg.replace("<br>","");}
var content =
'<table style="FILTER:alpha(opacity=90) shadow(color=#FFFFFF,direction=135);" id=toolTipTalbe border=0 class="TableBody"><tr><td width="100%"><table class=tableborder1 cellspacing="1" cellpadding="0" style="width:100%">'+
'<tr id=pltsPoptop><th height=18 valign=bottom><b><p id=topleft align=left>↖'+pltsTitle+'</p><p id=topright align=right style="display:none">'+pltsTitle+'↗</font></b></th></tr>'+
'<tr><td class=tablebody1 style="padding-left:14px;padding-right:14px;padding-top: 6px;padding-bottom:6px;line-height:135%">'+Msg+'</td></tr>'+
'<tr id=pltsPopbot style="display:none"><th height=18 valign=bottom><b><p id=botleft align=left>↙'+pltsTitle+'</p><p id=botright align=right style="display:none">'+pltsTitle+'↘</font></b></th></tr>'+
'</table></td></tr></table>';
pltsTipLayer.innerHTML=content;
toolTipTalbe.style.width=Math.min(pltsTipLayer.clientWidth,document.body.clientWidth/2.2);
moveToMouseLoc();
return true;
}
else
{
pltsTipLayer.innerHTML='';
pltsTipLayer.style.display='none';
return true;
}
}
function moveToMouseLoc()
{
if(pltsTipLayer.innerHTML=='')return true;
var MouseX=event.x;
var MouseY=event.y;
//window.status=event.y;
var popHeight=pltsTipLayer.clientHeight;
var popWidth=pltsTipLayer.clientWidth;
if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
{
popTopAdjust=-popHeight-pltsoffsetY*1.5;
pltsPoptop.style.display="none";
pltsPopbot.style.display="";
}
else
{
popTopAdjust=0;
pltsPoptop.style.display="";
pltsPopbot.style.display="none";
}
if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
{
popLeftAdjust=-popWidth-pltsoffsetX*2;
topleft.style.display="none";
botleft.style.display="none";
topright.style.display="";
botright.style.display="";
}
else
{
popLeftAdjust=0;
topleft.style.display="";
botleft.style.display="";
topright.style.display="none";
botright.style.display="none";
}
pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
return true;
}
pltsinits();
//-----------------------------------------
//-->
</script>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" style="font-size: 9pt">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
<tr class="topbg">
<td colspan=2 class="style2">
<%response.write "<a href='"&c_HomeUrl&"' title='"&c_HomeName&"'><u>"&c_HomeName&"</u></a>" '首頁鏈接%> <font color="#000000"><b><%=c_title%></b></font>
</td>
</tr>
<%If admin_login=True Then%>
<tr class="topbg">
<td colspan=2 class="style5" style="height: 28px">
【 管理員<B><%=Session("lbbs_pic_UserName")%></B>已登錄 <A HREF='?action=logout' class='style4'><U>退出</U></A> 】
| <a href="?action=admin">系統設置</a> | <a href="?forder=<%=forder%>&action=nodelpic&page=<%=picPage%>">瀏覽圖片</a> | <a href="?forder=<%=forder%>&action=delpic&page=<%=picPage%>">刪除圖片</a> |
</td>
</tr>
<%
End if
'==========================================
If not IsObjInstalled("Scripting.FileSystemObject") Then
Response.Write "<b><font color=red>你的服務器不支持 FSO(Scripting.FileSystemObject)! 不能顯示文件</font></b>"
Else
set fso=CreateObject("Scripting.FileSystemObject")
Action=trim(Request("Action"))
Select Case Action
Case "admin"
'管理設置
call admin()
Case "adminsave"
'保存設置
call adminsave()
Case "login"
'管理登錄
call adminlogin()
Case "logincheck"
'檢查登錄
call logincheck()
Case "logout"
'退出登錄
call adminlogout()
Case "delpic"
'顯示刪除選項
Call admincheck() '登錄檢測
Session("lbbs_pic_delpic")="delpic"
response.redirect (JoinChar(c_picurl)&"page="&picPage)
Case "nodelpic"
'不顯示刪除選項
Session("lbbs_pic_delpic")=""
response.redirect (JoinChar(c_picurl)&"page="&picPage)
Case "Del"
'刪除選中文件
call DelFiles()
Case "DelAll"
'刪除當前目錄所有文件
call DelAll()
Case Else
'瀏覽圖片
call showpic()
end select
end If
'========================================
'========================================
'瀏覽圖片
Sub showpic()
%>
<tr class="tdbg">
<td height="24" style="width: 238px">
<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>"%>
</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>
<BR>當前位置:<font color='#0000ff'><%=replace(replace(forder,".",""),c_UploadDirg,"總目錄")%></font>
</td>
</tr>
<tr class="tdbg">
<td height="30" style="width: 238px;" valign="top">
<% Response.write (ShowFolderList(TruePath))'左側目錄文件列表 %>
</td>
<td height="30" style="height: 15px; width: 800px;" valign="top">
<% call main()'圖片列表 %>
</td>
</tr>
</table><p></p>
<%
End Sub
'========================================
'========================================
'遍歷站點所有文件夾作為下拉列表
'i全角的空格( )數
'sty符號
'strpath文件夾路徑
function bl(i,sty,strpath)
Dim objfolder,objfile,newstrpath,picFile,pi,pi2,picExt,objsubfolder
set objfolder=fso.getfolder(server.mappath(strpath))
for each objsubfolder in objfolder.subfolders
pi=0
pi2=0
For Each picFile In objsubfolder.Files
If instr(LCase(c_PicType),LCase(Right(Trim(picFile.name),3)))>0 Then
pi=pi+1
Else
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()
if fso.FolderExists(TruePath)=False then
response.write "找不到文件夾!可能是配置有誤!"
exit sub
end if
FileCount=0
TotalSize=0
Set theFolder=fso.GetFolder(TruePath)
For Each theFile In theFolder.Files
If instr(LCase(c_PicType),LCase(Right(Trim(theFile.name),3)))>0 Then
FileCount=FileCount+1
TotalSize=TotalSize+theFile.Size
End if
next
totalPut=FileCount
if picPage<1 then
picPage=1
end if
if (picPage-1)*c_MaxPerPage>totalput then
if (totalPut mod c_MaxPerPage)=0 then
picPage= totalPut \ c_MaxPerPage
else
picPage= totalPut \ c_MaxPerPage + 1
end if
end if
if picPage=1 then
call showContent()
Call showpage(c_picurl,totalput,c_MaxPerPage)
else
if (picPage-1)*c_MaxPerPage<totalPut then
call showContent()
call showpage(c_picurl,totalput,c_MaxPerPage)
else
picPage=1
call showContent()
call showpage(c_picurl,totalput,c_MaxPerPage)
end if
end if
end sub
sub showContent()
dim c
FileCount=0
TotalSize_Page=0
%>
<table width='100%' border="0" cellpadding="0" cellspacing="0">
<%
'--自定義開始--
If c_cook = "YES" Then
%>
<form method="POST" action="<%=JoinChar(c_picurl)%>action_cook=cookies">
<tr class="tdbg">
<td height="30" width="756">
<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>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -