Hi, can anybody point me in the direction?
I know the following code is the part I need to edit,
but I either end up with "end if" errors or with "missing objects"
if strRecentTopics = "1" then
strStartDate = DateToStr(dateadd("d", -30, strForumTimeAdjust))
'## Forum_SQL - Find all records for the member
strsql = "SELECT F.FORUM_ID"
strSql = strSql & ", T.TOPIC_ID"
strSql = strSql & ", T.T_SUBJECT"
strSql = strSql & ", T.T_STATUS"
strSql = strSql & ", T.T_LAST_POST"
strSql = strSql & ", T.T_REPLIES "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM F LEFT JOIN " & strTablePrefix & "TOPICS T"
strSql = strSql & " ON F.FORUM_ID = T.FORUM_ID) LEFT JOIN " & strTablePrefix & "REPLY R"
strSql = strSql & " ON T.TOPIC_ID = R.TOPIC_ID) "
strSql = strSql & " WHERE (T_DATE > '" & strStartDate & "') "
strSql = strSql & " AND (T.T_AUTHOR = " & ppMember_ID
strSql = strSql & " OR R.R_AUTHOR = " & ppMember_ID & ")"
strSql = strSql & " AND (T_STATUS < 2 OR R_STATUS < 2)"
strSql = strSql & " AND F.F_TYPE = 0"
strSql = strSql & " ORDER BY T.T_LAST_POST DESC, T.TOPIC_ID DESC"
set rs2 = my_Conn.Execute(strsql)
Response.Write " <tr>" & vbNewLine & _
" <td align=""center"" background=""darkorangegradient.gif"" colspan=""2""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Recent Topics</font></b></td>" & vbNewLine & _
" </tr>" & vbNewLine
if rs2.EOF or rs2.BOF then
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> <br /> <b>No Matches Found...<br /> </b></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
else
currTopic = 0
TopicCount = 0
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ valign=""top"" colspan=""2"">" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine
do until rs2.EOF or (TopicCount = 10)
if chkForumAccess(rs2("FORUM_ID"),MemberID,false) then
if currTopic <> rs2("TOPIC_ID") then
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ width=""5%"">" & vbNewLine & _
" <a href=""topic.asp?TOPIC_ID=" & rs2("TOPIC_ID") & """>"
if rs2("T_STATUS") <> 0 then
if strHotTopic = "1" then
if rs2("T_LAST_POST") > Session(strCookieURL & "last_here_date") then
if rs2("T_REPLIES") >= intHotTopicNum then
Response.Write getCurrentIcon(strIconFolderNewHot,"Hot Topic","align=""absmiddle""") & "</a></td>" & vbNewLine
else
Response.Write getCurrentIcon(strIconFolderNew,"New Topic","align=""absmiddle""") & "</a></td>" & vbNewLine
end if
else
if rs2("T_REPLIES") >= intHotTopicNum then
Response.Write getCurrentIcon(strIconFolderHot,"Hot Topic","align=""absmiddle""") & "</a></td>" & vbNewLine
else
Response.Write getCurrentIcon(strIconFolder,"","align=""absmiddle""") & "</a></td>" & vbNewLine
end if
end if
else
if rs2("T_LAST_POST") > Session(strCookieURL & "last_here_date") then
Response.Write getCurrentIcon(strIconFolderNew,"New Topic","align=""absmiddle""") & "</a></td>" & vbNewLine
else
Response.Write getCurrentIcon(strIconFolder,"","align=""absmiddle""") & "</a></td>" & vbNewLine
end if
end if
else
if rs2("T_LAST_POST") > Session(strCookieURL & "last_here_date") then
Response.Write getCurrentIcon(strIconFolderNewLocked,"Topic Locked","align=""absmiddle""") & "</a></td>" & vbNewLine
else
Response.Write getCurrentIcon(strIconFolderLocked,"Topic Locked","align=""absmiddle""") & "</a></td>" & vbNewLine
end if
end if
Response.Write " <td bgcolor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"" width=""95%""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """> <a href=""topic.asp?TOPIC_ID=" & rs2("TOPIC_ID") & """>" & ChkString(rs2("T_SUBJECT"),"display") & "</a> </font></td>" & vbNewLine & _
" </tr>" & vbNewLine
TopicCount = TopicCount + 1
end if
currTopic = rs2("TOPIC_ID")
end if
rs2.MoveNext
loop
end if
rs2.close
set rs2 = nothing
end if
I tried to remove any recerences to replies, but I think I'm missing
something.
Basically I want the recent topics to only display topics the author
started and not his/her replies to other people's topics.
Greets & thanks, Dominic
<