Sorry att jag postar så mycket kod men jag är lite osäker på vilka bitar ni måste se för att förstå mitt problem.
Ok jag har över elva tusen inlägg i gästboken så paging delen börjar se ganska ful ut då det är typ 500 sidor...
Jag skulle vilja att det stod såhär istället:
| Next 20 Entries | Previous 20 Entries |
Och sedan ta bor alla siffror... Finns det någon som vet hur koden för detta ser ut?
<table width="350" cellpadding="1" cellspacing="0">
<tr>
<td width="491"><img src="graphic/pix.gif" width="1" height="1"></td>
</tr>
<tr>
<td><strong><img src="graphic/four_no_1.gif" width="10" height="8">
MESSAGE BOARD.</strong></td>
</tr>
<tr>
<td> <%Function FixaTecken(str)
FixaTecken = Replace(Trim(str),"'","''")
End function
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db
If Request.Querystring("do")= "" Then%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<%Set Recset = Server.CreateObject("ADODB.Recordset")
Const gbaps = 20
Sidan = Request.QueryString("page")
If Sidan = "" then
sida = 1
Else
sida = Sidan
End If
With RecSet
.CursorLocation = 3
.CacheSize = gbaps
End With
SQL = "Select * From inlagg Order By datum desc"
RecSet.Open SQL, Conn
If RecSet.EOF Then%>
<tr>
<td><i>Inget har skrivit i gästboken.</i></td>
</tr>
<%Else
With RecSet
.MoveFirst
.PageSize = gbaps
.AbsolutePage = sida
End With
Sidor = RecSet.PageCount
If Sidor > 1 Then%>
<tr>
<td valign="top"> </td>
</tr>
<%End If
X = 0
Do While Not RecSet.EOF And X < RecSet.PageSize%>
<tr>
<td><img src="graphic/hr3d.gif" width="346" height="3"></td>
</tr>
<%If Recset("Email") <> "" Then%>
<tr>
<td><font color="#000000">|</font> <b><a href="mailto:<%=Recset("Email")%>"><%=Recset("Namn")%></a></b> <font color="#000000">|</font> <%=FormatDateTime(Recset("Datum"),4)%> <font color="#000000">|</font> <%=FormatDateTime(Recset("Datum"),2)%> <font color="#000000">|</font> <a href="http://www.leissner.se/cgi/whois?text=<%=Recset("ip")%>&c=eu" target="blank"><%=Recset("ip")%></a> <%If RecSet("Hemsida") <> "" Then%> <font color="#000000">|</font> <a href="<%=RecSet("Hemsida")%>" target="_blank">
<b><%=Mid(RecSet("Hemsida"),8,50)%></b> </a> <%End If%> </td>
</tr>
<tr>
<td><img src="graphic/hr3d.gif" width="346" height="3"></td>
</tr>
<%Else%>
<tr>
<td><font color="#000000">|</font> <b><%=Recset("Namn")%></b> <font color="#000000">|</font> <%=FormatDateTime(Recset("Datum"),4)%> <font color="#000000">|</font> <%=FormatDateTime(Recset("Datum"),2)%> <font color="#000000">|</font> <a href="http://www.leissner.se/cgi/whois?text=<%=Recset("ip")%>&c=eu" target="blank"><%=Recset("ip")%></a> <%If RecSet("Hemsida") <> "" Then%> <font color="#000000">|</font> <a href="<%=RecSet("Hemsida")%>" target="_blank">
<b><%=Mid(RecSet("Hemsida"),8,50)%></b> </a> <%End If%> </td>
</tr>
<tr>
<td><img src="graphic/hr3d.gif" width="346" height="3"></td>
</tr>
<%End If%>
<tr>
<td><%=FixaLankar(RecSet("Meddelande"))%></td>
</tr>
<%If Recset("svar") <> "" Then%>
<tr>
<td> </td>
</tr>
<tr>
<td>melody club:<b> </b><i><%=Replace(RecSet("svar"), vbCrLf, "<br>")%></i></td>
</tr>
<%End If%>
<%X = X+ 1
Recset.MoveNext
Loop
If Sidor > 1 Then%>
<tr>
<td><img src="graphic/hr3d.gif" width="346" height="3"></td>
</tr>
<tr>
<td valign="top"> <%For Sid = 1 To Sidor
If (Int(Sid)) = (Int(sida)) Then%> <font color="#CCCCCC"><%=Sid%></font> <%Else%> <a href="?NODE=11&page=<%=Sid%>"><%=Sid%></a> <%End If
Next%> </td>
</tr>
<tr>
<td valign="top"> </td>
</tr>
</table>
<%End If
Recset.Close
Set Recset = Nothing
End If
End If
If Request.QueryString("do")= "add" Then
Namn = Request.Form("namn")
Email = Request.Form("email")
Hemsida = Request.Form("hemsida")
Meddelande = FixaTecken(Request.Form("meddelande"))
Ip = Request.Servervariables("REMOTE_ADDR")
If Hemsida <> "" Then
If Left(Hemsida,7) = "http://" Then
Hemsida = Hemsida
Else
Hemsida = "http://" & Hemsida
End If
End If
Conn.Execute("Insert Into inlagg(Namn, Email, Hemsida, Meddelande,ip) Values('"& Namn &"','"& Email &"','"& Hemsida &"','"&Meddelande &"','"& Ip &"')")
Conn.Close
Set Conn = Nothing
Response.Redirect "?NODE=11"
End If%> </td>
</tr>
</table>