Ombygning af script!
Hej eksperter,Jeg kunne godt tænke mig at denne kode skal hente "seneste svar" ned, istedet for seneste emne. Altså så det kommer til at se noglelunde sådan her ud:
"sidste svar her"
I "og så i det pågældende emnes navn"
25-12-2004 kl. 11:49
af: David
Så den skal istedet for at hente fra foratopics, hente fra forareplys.
Her kan i se hvordan min forareplys ser ud:
http://www.team-nopanic.dk/db.gif.
Har ikke så mange point, men vil forhøje så snart jeg har tjent nogle ind. På forhånd tak for hjælpen
Her er min soucecode:
-------------------------------------------
SQL = "SELECT TOP 1 addeddate, addedtime, topic, id, author, memberid, email FROM foratopics WHERE fora = " & RS("id") & " ORDER BY id DESC;"
set RStopic = conn.execute(SQL)
if not RStopic.EOF then
topic = left(RStopic("topic"),30)
if session("login") = "" and RS("locked") = 1 then
topicstr = topic
else
topicstr = "<a href='?page=5&mode=replys&fora=" & RS("id") & "&topic=" & RStopic("id") & "'>" & topic & "</a>"
end if
email = RStopic("email")
author = RStopic("author")
end if
response.write("<tr>")
response.write("<td height='40'>")
if session("login") = "" AND RS("locked") = 1 then
title = RS("title")
else
title = "<a href='?page=5&mode=topics&fora=" & RS("id") & "'>" & RS("title") & "</a>"
end if
response.write(title)
response.write("<br>")
response.write("<FONT COLOR='#C3C3C3'>")
Response.Write(RS("description"))
response.write("</FONT>")
response.write("</td>")
SQL = "SELECT COUNT(*) as count FROM foratopics WHERE fora = " & RS("id")
set RScount = conn.execute(SQL)
response.write("<td align='center' valign='middle'>" & RScount("count") & "</td>")
SQL = "SELECT COUNT(*) as count FROM forareplys, foratopics WHERE forareplys.topic = foratopics.id AND foratopics.fora = " & RS("id")
set RScount = conn.execute(SQL)
response.write("<td align='center'>" & RScount("count") & "</td>")
response.write("<td align='center'>")
if RStopic.EOF then
response.write("Ingen tråde")
else
do while not RStopic.EOF
response.write(topicstr & "<br>" & formatdatetime(RStopic("addeddate"),2) & " kl. " & formatdatetime(RStopic("addedtime"),4) & "<br>af: ")
if email = "" then
authorstr = author
else
authorstr = "<a href='mailto: " & email & "'>" & author & "</a>"
end if
response.write(authorstr)
RStopic.movenext
loop
end if
