Fejl i galleri script
HejSidder og roder med et gammel galleri script jeg har brugt tidligere.
Det er ret simpelt - Galleri viser thumbs af de billeder den finder i en mappe, og derefter kan den åbne billederne i et nyt vindue.
Når jeg kører scriptet kommer der en række fejl meddelelser. Bruger IE.
Scriptet kan ses live her http://www.januslock.dk/test/PhotoAlbum.asp
Her er koden til filen PhotoAlbum.asp
---------------------------------------------
<%
' PhotoAlbum
Dim CurFile, PopFileShowSub, ShowPic, PictureNo
Dim strPathInfo, strPhysicalPath
Dim intTotPics, intPicsPerRow, intPicsPerPage, intTotPages, intPage, strPicArray()
intPicsPerRow = 4
intPicsPerPage = 8
intPage = CInt(Request.QueryString("Page"))
If intPage = 0 Then
intPage = 1
End If
CurFile = "PhotoAlbum.asp"
PopFile = "ShowPicture.asp"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
<script language="JavaScript" type="text/javascript">
<!--
function jumppage(sel)
{
var i = sel.selectedIndex
self.location.href = sel.options[i].value
}
// -->
</script>
<script language="JavaScript" type="text/javascript">
<!-- hide from JavaScript-challenged browsers
function openGalleryWindow(url) {
if (document.all)
var xMax = screen.width, yMax = screen.height;
else
if (document.layers)
var xMax = window.outerWidth, yMax = window.outerHeight;
else
var xMax = 800, yMax=600;
var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
var xOffset = 100, yOffset = 100;
popupWin = window.open(url,'new_page','width=700,height=535,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=auto,toolbars=no,menubar=no,resizable=yes')
}
// done hiding -->
</script>
</head>
<body>
<table width="500" cellspacing="0" cellpadding="0">
<tr>
<td>
<%
ShowSub = request("ShowSub")
ShowPic = request("ShowPic")
strPathInfo = Request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPhysicalPath)
Set objFolder = objFile.ParentFolder
Set objFolderContents = objFolder.Files
For each Folder in objFolder.SubFolders
If Left(Folder.Name,1)<>"_" Then
If ShowSub <= " " Then
ShowSub = Folder.Name
End if
End if
Next
Set objFSO = Nothing
%>
</td>
</tr>
<tr>
<td>
<%
If ShowPic > " " then
ShowPic = Replace(ShowPic, " ", "%20")
Response.Write "<a href='java script:history.go(-1)'><img src='" & ShowPic & "' alt='Grøn Koncert Image " & x & "'><BR><BR><font face=""verdana"" size=""1""><strong>Tilbage</strong></a>"
Else
%>
<table border="0" cellpadding="0" cellspacing="5" style="border-collapse: collapse" class="brcolor" width="100%" id="AutoNumber2">
<tr>
<%
strPhysicalPath = Server.MapPath(".\" & ShowSub)
If ShowSub > " " then
ShowSub = Replace(ShowSub, " ", "%20")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPhysicalPath)
Set objFolderContents = objFolder.Files
'Get the number of pictures in the subdirectory
intTotPics = 0
For Each objFileItem in objFolderContents
If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN
intTotPics = intTotPics + 1
End if
Next
'Get the total number of pages in the subdirectory
If (intTotPics/intPicsPerPage) = (int(intTotPics/intPicsPerPage)) Then
intTotPages = int(intTotPics/intPicsPerPage)
Else
intTotPages = int(intTotPics/intPicsPerPage)+1
End If
Redim strPicArray(2,intTotPics)
'Store picture file names in an array
x = 0
For Each objFileItem in objFolderContents
If Ucase(Right(objFileItem.Name,4))=".GIF" OR Ucase(Right(objFileItem.Name,4))=".JPG" THEN
strPicArray(0,x) = objFileItem.Name
strPicArray(1,x) = Cstr(int(x/intPicsPerPage)+1)
x = x + 1
End if
Next
'Determine if there are multiple pages and if so, display page numbers.
If intTotPages > 1 Then
Response.Write "<td colspan='" & intPicsPerRow & "' align='center'>Side: "
For x = 1 to intTotPages
If x = intPage Then
Response.Write x & " "
Else
Response.Write "<a href='PhotoAlbum.asp?Page=" & x & "&ShowSub=" & ShowSub & "' >" & x & "</a> "
End If
Next
Response.Write "</td>"
Response.Write "</tr><tr><td> </td></tr><tr>"
End If
For x = 0 to UBound(strPicArray,2)-1
If CInt(strPicArray(1,x)) = intPage Then
ShowPic = Replace(strPicArray(0,x), " ", "%20")
Response.write "<td align='center' width='25%'><a href=""" & PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & """ target='_blank' title='Grøn Koncert Image " & x & " (Opens in a new window)' onClick=""java script:openGalleryWindow(" & PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & "')"" onKeyPress=""java script:openGalleryWindow('" & PopFile & "?ShowPic=" & ShowSub & "/" & ShowPic & "')"""
Response.write "<br>"
Response.Write("<img border=""0"" src='" & ShowSub & "/" & strPicArray(0,x) & "' width=80 alt='Grøn Koncert Image " & x & " (Opens in a new window)'> ")
' Response.Write("<br><strong>" & Mid(strPicArray(0,x),1,Len(strPicArray(0,x))-4) & "</strong>")
Response.write "</a></td>" & vbcrlf
PictureNo = PictureNo + 1
If PictureNo=intPicsPerRow Then
Response.write "</tr><tr>"
PictureNo = 0
End if
End If
Next
Set objFSO = Nothing
End if
%>
<tr>
<td> </td>
</tr>
</table>
<%
End if
%>
</body>
</html>
----------------------------------------------
Det skal lige siges at jeg IKKE er programmør og har derfor ikke meget forstand på asp.
Så alt hjælp modtages...
