Hej!
Vore jättesjysst om nån kunde hjälpa mig! Jag vet inte vad jag ska göra åt ett felmeddelande som jag får.
Kolla in sidan:
http://richard.franzon.info/db/gruv/visa.asp?id=Tunna
Tryck på nästa sida för att se vad jag menar...
Det hela fungerar om jag ett jämt antal bilder inlagda i databasen....? Se koden nedan.
Tack på förhand!
Mvh,
Richard
<%Response.Buffer = "True"%>
<!--#Include file="settings.asp"-->
<html>
<head>
<title>»» Bildgalleri ««</title>
<script language="JavaScript">
<!--
function blured()
{
for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}
if (document.all)
{
document.onmousedown = blured;
}
// -->
</script>
<script language="JavaScript" type="text/javascript">
<!-- Begin //
function Bilden(filename,winTitle)
{
var myImage = new Image();
myImage.src=filename;
properties='height=10,width=10';
var imgWindow = window.open('','',properties);
html = '<html>';
html += '<head>';
html += '<title>'+winTitle+'</title>';
html += '</head>';
html += '<body topmargin="0" marginheight="0" leftmargin="0" marginwidth="0">';
html += '<img src="'+myImage.src+'" onLoad="resizeTo(document.bild.width+10,document.bild.height+29);" name="bild" OnClick="self.close();">';
html += '</body>';
html += '</html>';
imgWindow.document.write(html);
}
// End -->
</script>
<link rel="stylesheet" href="stil.css" type="text/css">
</head>
<body bgcolor="#f0f0f0" onLoad="<%=mess%>">
<!--
************************************************
Åsa Gruvsjö © 2002
[url]www.gruvsjo.com[/url]
[email]Asa@gruvsjo.com[/email]
Fri att använda om ni låter copyrightkoden stå kvar!
************************************************
-->
<%Set Conn = Server.CreateObject("ADODB.Connection")
Set RecSet = Server.CreateObject("ADODB.Recordset")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db
Set RS=Conn.Execute("Select * From galleri Where namn='" & Request.QueryString("id") & "'")
If Request.Querystring("id") = "" then
Response.Redirect "index.asp"
End If%>
<table width="400" align="center" border="0">
<tr>
<td colspan="2"><font size="2">Bildgalleriet:</font></td>
</tr>
<tr>
<td height="10" colspan="2"><img src="bilder/dot400.gif"></td>
</tr>
<form name="menyn">
<tr>
<td width="267"><font size="2">» Välj kategori i menyn till höger</font></td>
<td align="right" width="133">
<!--#Include file="meny.asp"-->
</td>
</tr>
</form>
<tr>
<td height="10" colspan="2"><img src="bilder/dot400.gif"></td>
</tr>
</table>
<!-- HÄR BÖRJAR KITTET
-->
<table width="400" border="0" align="center" cellpadding="3">
<%
Const perSida = 6 'Bilder per sida
Sidan = Request.QueryString("sida")
If Sidan = "" then
sida = 1
Else
sida = Sidan
End If
With RecSet
.CursorLocation = 3
.CacheSize = perSida
End With
SQL = "Select * From bilder Where namn='" & Request.QueryString("id") & "' And visa=True Order By snitt desc,totalt desc"
RecSet.Open SQL, Conn
If RecSet.EOF Then%>
<tr>
<td colspan="3" class="normal">Inga bilder i denna kategori.</td>
</tr>
<%Else%>
<tr>
<td colspan="3"><%=Replace(RS("info"), vbCrLf, "<br>" )%></td>
</tr>
<%With RecSet
.MoveFirst
.PageSize = perSida
.AbsolutePage = sida
End With
Sidor = RecSet.PageCount
X = 0
If Request.QueryString("Z") <> "" then
Z=Request.QueryString("Z")
Else
Z=1
End If
koll = 0
Do While Not RecSet.EOF And X < RecSet.PageSize%>
<tr>
<td>
<table width="200" border="0" align="center">
<td width="100" valign="top" nowrap class="normal">
<a href="java script:Bilden('pics/<%=RecSet("bild")%>','<%=RecSet("namn")%>');"><img src="pics/<%=RecSet("Bild")%>" width="90" height="90" border="1"></a>
</td>
<td valign="top" class="normal" width="295" valign="top">
<table width="100%">
<tr><td colspan="2" class="normal">
<%=Replace(RecSet("bildinfo"), vbCrLf, "<br>" )%>
</td></td>
</table>
</td>
</tr>
</table>
<%Z = Z + 1
X = X + 1
koll = koll + 1
If koll = 6 then exit do
Recset.MoveNext
%>
<td>
<table width="200" border="0" align="center">
<td width="100" valign="top" nowrap class="normal">
<a href="java script:Bilden('pics/<%=RecSet("bild")%>','<%=RecSet("namn")%>');"><img src="pics/<%=RecSet("Bild")%>" width="90" height="90" border="1"></a>
</td>
<td valign="top" class="normal" width="295" valign="top">
<table width="100%">
<tr><td colspan="2" class="normal">
<%=Replace(RecSet("bildinfo"), vbCrLf, "<br>" )%>
</td></td>
</table>
</td>
</tr>
<tr>
</td>
</table>
</td>
</tr>
<%Z = Z + 1
X = X + 1
koll = koll + 1
Recset.MoveNext
Loop
Recset.Close
Conn.Close
Set Recset = Nothing
Set Conn = Nothing
If Request.QueryString("Z") <> "" then
Z=Request.QueryString("Z")
Else
Z=1
End If
If Request.QueryString("sida") <> "" then
sida = Request.QueryString("sida")
Else
sida = 1
End If%>
<tr>
<td colspan="3" height="10"><font size="2">
<%If Sidor <> 1 Then
If (Int(sida)) <> 1 Then%>
<a href="visa.asp?id=<%=Request.QueryString("id")%>&sida=<%=(Int(sida)-1)%>&z=<%=Z-perSida%>"><b>«</b></a>
<%Else
Response.Write ""
End If
For Sid = 1 To Sidor
If (Int(Sid)) = (Int(sida)) Then%><%=Sid%> <%Else%> <a href="visa.asp?id=<%=Request.QueryString("id")%>&sida=<%=Sid%>&z=<%=persida*Sid-perSida+1%>"><%=Sid%></a> <%End If
Next
If (Int(sida)) <> (Int(Sidor)) AND X > 0 Then%>
<a href="visa.asp?id=<%=Request.QueryString("id")%>&sida=<%=(Int(sida)+1)%>&z=<%=Z+perSida%>"><b>»</b></a>
<%Else
End If
End If%>
</font>
</td>
</tr>
<%End If%>
</table>
</body>
</html>



