Hej.
Jag har problem med paging. Jag får inga felmedelanden, men den vill inte skriva ut vilken sida man står på.
Jag har kollat och dubbelkollat, men nu ser jag ingenting. Vore tacksam för hjälp.
'Do While NOT RS2.EOF 'Tillhör orginal
'Här skall pagingen börja'********************************
Response.Write "<FONT SIZE=3>"
perpage = 10
For n = 1 to RS2.recordcount step perpage
If n <> 1 then response.write " | "
if n <> cint (request("start")) then
response.write "<a href=""" & request ("script_name") & "?start=" & n & """>"
else
response.write "<font color=""red"">"
end if
response.write n & " till "
if n + perpage <= RS2.recordcount then
response.write n + (perpage) - 1
else
response.write RS2.recordcount
end if
if n <> cint (request("start")) then
response.write "</a>"
else
response.write "</font>"
end if
next
if request("start") = "" then
start = 1
else
start = cint (request("start"))
end if
RS2.move start - 1
for row = start to start + (perpage - 1)
if RS2.eof then exit for
Response.Write "</FONT>"
'Här fortsätter orginal koden ******************************************
SQL = "select * from inlagg where forum_id="&Request.Querystring("id")
Set RS_inlagg = Databas.Execute(SQL)
SQL = "select count(*) AS count_svar from inlagg where svar_id="&RS2("id")
Set RS_count_svar = Databas.Execute(SQL)
SQL = "select count(*) AS datum_check from inlagg where svar_id="&RS2("id")
Set RS_datum_check = Databas.Execute(SQL)
SQL = "select count(skribent) AS antalskribent from inlagg where svar_id="&RS2("id")
Set RS_skribent = Databas.Execute(SQL)
If RS_datum_check("datum_check") <> 0 then
SQL = "select datum from inlagg where svar_id="&RS2("id")
SQL = SQL & " order by datum desc"
Set RS_datum = Databas.Execute(SQL)
Else
SQL = "select datum from inlagg where id="&RS2("id")
SQL = SQL & " order by datum desc"
Set RS_datum = Databas.Execute(SQL)
End If
color=color+1
If color mod 2 = 0 then
bgcolor="#C0C0C0"
Else
bgcolor="#FFFFFF"
End If
'**********************************************
SQL = "select Datum from inlagg where id = " & RS2("id")
Set RSDatum = Databas.Execute(SQL)
Dim LatestThread,newPost
LatestThread = RSDatum("Datum")
If Cdate(LatestThread) < Cdate(Request.Coookies("latestVisit")) Then
newPost = "<img border=""0"" src=""bild/19.gif""> Japp"
Else
'newPost = " -"
newPost = "<img src=""bild/20.gif""> Nix"
End If
'************************************************
If Cint(Request.Querystring("str_id")) = Cint(RS2("id")) then
SQL = "select * from inlagg where svar_id="&RS2("id")
Set RS_svar = Databas.Execute(SQL)
%>
<tr bgcolor=<%=bgcolor%>>
<td width=1><a href=forum.asp?id=<%=Request.Querystring("id")%>&str_id=0>-</a></td>
<td><a href=inlagg.asp?forum_id=<%=Request.Querystring("id")%>&inlagg_id=<%=RS2("id")%>><%=RS2("amne")%></td>
<td>
<IMG Src="Bild/<%=RS2("Icon")%>.gif">
<%=RS2("skribent")%>
</td>
<td><%=RS_count_svar("count_svar")%></td>
<td>
<%
Response.Write formatdatetime(RS2("datum"),2)
response.write "      " & newPost
%>
</td>
<td><%=RS2("hits")%></td>
</tr>
<%
Do Until RS_svar.EOF
SQL = "select * from inlagg where id = " & RS_svar("id")
Set RS_svar2 = Databas.Execute(SQL)
SQL = "select Datum from inlagg where id = " & RS_svar("id")
Set RSDatum = Databas.Execute(SQL)
'**********************************************
LatestThread = RSDatum("Datum")
If Cdate(LatestThread) < Cdate(Request.Coookies("latestVisit")) Then
newPost = "<img border=""0"" src=""bild/19.gif""> Japp"
Else
newPost = "<img src=""bild/20.gif""> Nix"
End If
%>
<tr bgcolor=<%=bgcolor%>>
<td width=1></td>
<td> <a href=inlagg.asp?forum_id=<%=Request.Querystring("id")%>&inlagg_id=<%=RS2("id")%>#<%=RS_svar("id")%>><%=RS_svar("amne")%></td>
<td colspan=2>
<IMG Src="Bild/<%=RS_svar("Icon")%>.gif">
<%=RS_svar("skribent")%>
</td>
<td><%
Response.Write formatdatetime(RS_svar2("datum"),2)
response.write "      " & newPost
%>
</td>
<td><%'=RS_svar2("hits")%></td>
</tr>
<%
RS_svar.MoveNext
Loop
Else
%>
<tr bgcolor=<%=bgcolor%>>
<td width=1>
<% If RS_count_svar("count_svar") <> 0 then %>
<a href=forum.asp?id=<%=Request.Querystring("id")%>&str_id=<%=RS2("id")%>>+</a>
<% End If %>
</td>
<td><a href=inlagg.asp?forum_id=<%=Request.Querystring("id")%>&inlagg_id=<%=RS2("id")%>><%=RS2("amne")%></td>
<td>
<IMG Src="Bild/<%=RS2("Icon")%>.gif">
<%=RS2("skribent")%></td>
<td><%=RS_count_svar("count_svar")%></td>
<td><%
'Denna är den ihopfälda menyn
Response.Write formatdatetime(RS_datum("datum"),2)
response.write "      " & newPost
%>
</td>
<td><%=RS2("hits")%></td>
</tr>
<%
End If
Set RS_count_svar = nothing
Set RS_datum_check = nothing
Set RS_datum = Nothing
Set RS_inlagg = Nothing
RS2.MoveNext
NEXT ' Tillhör paging
'Loop 'Tillhör orginal
Set RS2 = nothing
Jag insåg att jag var tvungen att lägga in ALL kod, annars så ser man nog inte riktigt.
------------------
saw
__
saw@songer.com www.mp3.com/saw_songer
__
[Redigerat av saw den 07 jan 2002]
[Redigerat av saw den 07 jan 2002]