Gir fortapt
Jeg har et fotoalbum, men jeg ser billederne som røde krydser......mangler jeg et komponet eller hvadKode:<%@ Language=VBScript %>
<!--#include file="konfiguration.txt" -->
<%
Server.ScriptTimeout = 1800
if vantalperside = "" then
vantalperside = 20
end if
for i = 1 to vantalbib - 1
vbib = vbib & "../"
next
if request.querystring("funktion") = "hentbillede" then
xstr = request.querystring("x")
ystr = request.querystring("y")
zstr = request.querystring("z")
billede = request.querystring("billede")
response.ContentType = "image/jpeg"
Set Image = Server.CreateObject("AspImage.Image")
Image.ImageFormat = 1
image.loadimage Server.MapPath(billede)
if zstr <> "" and zstr <> "0" then
image.resize int(image.maxx / zstr), int(image.maxy / zstr)
elseif xstr <> "" and ystr <> "" then
image.resize xstr, ystr
elseif xstr <> "" and ystr = "" then
image.resize xstr, int(image.maxy / (image.maxx / xstr))
elseif xstr = "" and ystr <> "" then
image.resize int(image.maxx / (image.maxy / ystr)), ystr
end if
response.binarywrite image.image
set image = nothing
elseif request.querystring("funktion") = "visbillede" then
%>
<html>
<head>
<title>Billede</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
//-->
</script>
</head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function open_window(newin) {flyout=window.open(newin,"flyout","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=600,height=340,top=10,left=10")}
-->
</SCRIPT>
<body bgcolor="#FEEEEEE" background="<%=vbaggrund%>" onload="self.focus()">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td>
<div align="center"><img src="fotoside.asp?funktion=hentbillede&billede=<%=request.querystring("billede")%>&y=400"></div>
</td>
</tr>
</table>
<br>
<form name="form" method="post" action="">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td>
<div align="left"><a href="#" target="indhold" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('knaptilbage2','','../ebeltoftgarden/FOTO/knapper/tilbage-2.gif',1)">
</a>
<input type="button" name="Button" value=" Udskriv " onclick="java script:window.print()">
</div>
</td>
<td>
<div align="right"> <a href="java script:window.close()">
<input type="button" name="Button" value=" Luk " onClick="java script:window.close()">
</a></div>
</td>
</tr>
</table>
</form>
</body>
</html>
<%
else
dim pix(10000), antalpix, sti, vraekke, i1, i2, vraekker, vaktuelpix, vantalperside, vside, vstart, vantalsider
function IndlaesBilleder()
sti = Request.ServerVariables("path_info")
sti = left(sti,InstrRev(sti, "/",-1))
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(Server.MapPath(sti))
Set objFiles = objFolder.Files
i = 0
For Each Image In objFiles
if lcase(right(image,4)) = "jpeg" or lcase(right(image,3)) = "jpg" or lcase(right(image,3)) = "gif" then
i = i + 1
pix(i) = right(image, len(image) - len(Server.MapPath(sti)) - 1)
end if
Next
antalpix = i
Set objFS = Nothing
end function
function visnavn(fil)
dim tmp
tmp = left(fil, instr(fil,".") - 1)
visnavn = replace(tmp,"_"," ")
end function
if vhoejde = "" then
vhoejde = 80
end if
if vkolonner = "" then
vkolonner = 4
end if
indlaesbilleder()
%>
<html>
<head>
<title>Fotoside</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#EEEEEE" text="#000000" background="<%=vbaggrund%>">
<script language="JavaScript">
<!--
function open_window(newin)
{flyout=window.open(newin,"flyout","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=600,height=500,top=10,left=10")}
-->
</script>
<table width="555" border="1" cellspacing="0" cellpadding="0" bordercolor="#000066">
<tr>
<td>
<table width="555" border="0" cellspacing="0" cellpadding="3">
<tr>
<td bgcolor="#DDDDDD">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif" color="#000066"><b><%=vtekst%></b></font></div>
</td>
</tr>
<% if vbroed <> "" then %>
<tr>
<td bgcolor="#DDDDDD">
<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#000066"><%=vbroed%></font>
</td>
</tr>
<% end if %>
</table>
</td>
</tr>
</table>
<br>
<table width="555" border="1" cellspacing="0" cellpadding="0" bordercolor="#000066">
<tr>
<td>
<table width="555" border="0" cellspacing="0" cellpadding="3">
<tr valign="bottom" bgcolor="#DDDDDD">
<td>
<%
vside = request.querystring("side")
if vside = "" then
vside = 1
end if
if antalpix mod vantalperside = 0 then
vantalsider = antalpix / vantalperside
else
vantalsider = int(antalpix / vantalperside) + 1
end if
%>
<div align="center"><font size="1"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000066">
<% if vantalsider > 1 then %>
Billederne er delt op i flere sider, som man kan vælge mellem
vha. rullelisten eller knapperne. <br>
<% end if %>
For at se et billede i stor format, skal der bare klikkes på
det.</font></font></div>
</td>
</tr>
<tr valign="bottom" bgcolor="#DDDDDD">
<% if vantalsider > 1 then %>
<td>
<% if vside > 1 then %>
<input type="submit" name="knapforrige" value="<< Forrige side" style="width:100px" onclick="location.href='fotoside.asp?side=<%=vside-1%>'">
<% end if %>
<select name="side" style="background-color:#EEEEEE" onChange="location.href = 'fotoside.asp?side=' + this.options[this.selectedIndex].value">
<%
for i = 1 to vantalsider
response.write "<option value='" & i & "'"
if int(vside) = int(i) then
response.write " selected"
end if
response.write ">Fotoside " & i & "</option>"
next
%>
</select>
<% if int(vside) < int(vantalsider) then %>
<input type="submit" name="knapnaeste" value="Næste side >>" style="width:100px" onclick="location.href='fotoside.asp?side=<%=vside+1%>'">
<% end if %>
</td>
<% end if %>
</tr>
</table>
</td>
</tr>
</table>
<br>
<table width="555" border="1" cellspacing="0" cellpadding="0" bordercolor="#000066">
<tr>
<td>
<table width="555" border="0" cellspacing="5" cellpadding="5">
<%
vstart = ((vside - 1) * vantalperside) + 1
if vstart + vantalperside > antalpix then
antalpix = antalpix - vstart
else
antalpix = vantalperside
end if
if antalpix mod vkolonner = 0 then
vraekker = antalpix / vkolonner
else
vraekker = (antalpix / vkolonner) + 1
end if
for i1 = 1 to vraekker
response.write "<tr valign='top'>"
for i2 = 1 to vkolonner
response.write "<td width='" & int(100/vkolonner) & "%'><div align='center'>"
vaktuelpix = ((i1 - 1) * vkolonner) + i2 + vstart - 1
if pix(vaktuelpix) <> "" and vaktuelpix < vstart + vantalperside then
response.write "<a href=java script:open_window('fotoside.asp?funktion=visbillede&billede=" & pix(vaktuelpix) & "');>"
response.write "<img src='fotoside.asp?funktion=hentbillede&billede=" & pix(vaktuelpix) & "&y=" & vhoejde & "' border='0'>"
if vfilnavne = "ja" then
response.write "<br><font size='2'>" & visnavn(pix(vaktuelpix)) & "</font>"
end if
response.write "</a>"
end if
response.write "</div></td>"
next
response.write "</tr>"
next
%>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
end if
%>
