LastPost(Forum_ID) 'call lastpost function Response.write " </font></td>" & vbNewline
active.asp:
ChkTime(Topic_Last_Post) & strLastAuthor
LastPost(Forum_ID) 'call lastpost function Response.write " </font></td>" & vbNewline
since i already am eternally gratefull for you guys helping me out with the Quick Reply add-on, i will try to be even a little more grateful should you help me with this one!
Umm... not sure about this, but i think u got the older version of LastPost MOD. the version i used now..(the readme file date 2002/01/23), it seem ONLY the default.asp page use the LastPost(Forum_ID) function. and in active.asp page instead by:
if mxpages > 1 then Response.Write "&whichpage=" & mxpages 'using the same mxpages on this page end if
if Last_Post <> "0" then Response.Write "#" & Last_Post Response.Write " ""><img alt=""Go to Latest Post"" src=""lastpost.gif"" border=""0""></a> " Response.write " </font></td>" & vbNewline '######## END of LastPost Mod by Babygate #############
i can't remember where i get the version of LastPost MOD that i used now and work no problem... but it seem really some different with yours..
i compare the post_info.asp file with the version Dayve post here on other topic, they also not alike...
post_info.asp in my version of LastPost Mod: below this line if Moderation = "No" then there are a additional section.. '######## BEGIN LastPost Mod by Babygate ############# '<-- Added by iblade Dim strReplyDate Dim intAuthor Dim myRsTracker Dim intReplyID
strSql = "SELECT @@Identity FROM " & strActivePrefix & "Reply " set myRsTracker = my_Conn.execute(strsql) intReplyID = myRsTracker(0) set myRsTracker = Nothing '######## END of LastPost Mod by Babygate ############# '--> Added by iblade
i don't know what this SQL statement meaning.. (so odd the @@...) but it seem can't work if lacking this section.
and you can download the version i have here... lastpost_mod.zip it work fine for me. hope it also can do something for u.
UPDATED!the code below is AFTER i tried DoraMoon's newer version of the mod...
the function
'######## BEGIN LastPost Mod by Babygate ############# function LastPost(Forum) 'find the topic_id of the latest post in a forum dim ID if instr(Request.ServerVariables("SCRIPT_NAME"), "default_category") then 'required if you are using Huwr's version and want to add this function to default_category.asp ID = "CAT_ID" else ID = "FORUM_ID" end if
if strDBType = "mysql" then 'MySql specific code strSql = "SELECT TOPIC_ID, T_LAST_POSTER FROM " & strTablePrefix & "TOPICS WHERE " & ID & "= " & Forum if AdminAllowed = "Y" then strSql = strSql & " AND T_STATUS < " if Moderation = "Y" then strSql = strSql & "2" ' Ignore unapproved posts else strSql = strSql & "3" ' Ignore any hold posts end if else strSql = strSql & " AND T_STATUS < 2 " ' Ignore unapproved/held posts end if strSql = strSql & " ORDER BY T_LAST_POST desc LIMIT 1;" else strSql = "SELECT TOP 1 TOPIC_ID, T_LAST_POSTER, T_REPLIES FROM " & strTablePrefix & "TOPICS WHERE " & ID & "= " & Forum if AdminAllowed = "Y" then strSql = strSql & " AND T_STATUS < " if Moderation = "Y" then strSql = strSql & "2" ' Ignore unapproved posts else strSql = strSql & "3" ' Ignore any hold posts end if else strSql = strSql & " AND T_STATUS < 2 " ' Ignore unapproved/held posts end if strSql = strSql & " ORDER BY T_LAST_POST desc;" end if set rsLastPost = my_Conn.Execute (strSql)
if rsLastPost.EOF or rsLastPost.BOF then '## Do Nothing else LastTopicID = rsLastPost("TOPIC_ID") LastPost = rsLastPost("T_LAST_POSTER") mxpages = (rsLastPost("T_REPLIES") / strPageSize) if mxpages <> cint(mxpages) then mxpages = int(mxpages) + 1 end if Response.Write " <a href=""topic.asp?TOPIC_ID=" & LastTopicID if mxpages > 1 then Response.Write "&whichpage=" & mxpages end if 'if LastPost <> "0" then Response.Write "&Reply_ID=" & LastPost & "#" & LastPost '**user this line if you are using my threaded mod** if LastPost <> "0" then Response.Write "#" & LastPost Response.Write " ""><img alt=""Go to Last Post"" src=""" & strImageURL & "lastpost.gif"" border=0></a>" end if
rsLastPost.close set rsLastPost = nothing end function '######## END of LastPost Mod by Babygate #############
if mxpages > 1 then Response.Write "&whichpage=" & mxpages 'using the same mxpages on this page end if
if Last_Post <> "0" then Response.Write "#" & Last_Post Response.Write " ""><img alt=""Go to Last Post"" src=""" & strImageURL & "lastpost.gif"" border=""0"" width=""15"" height=""15""></a> " Response.write " </font></td>" & vbNewline '######## END of LastPost Mod by Babygate #############
NOTE: active.asp works nicely, but on default.asp the error described a few posts earlier still shows up.
Variable Forum_ID is used for making call to the function LastPost. Make sure it is populated with appropriate Values in both active.asp and default.asp before it is passed on to the function.
'Check if the variable is populated. Response.write Forum_ID LastPost(Forum_ID) 'call lastpost function
www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
strSql = "SELECT @@Identity FROM " & strActivePrefix & "Reply " set myRsTracker = my_Conn.execute(strsql) intReplyID = myRsTracker(0) set myRsTracker = Nothing '######## END of LastPost Mod by Babygate ############# '--> Added by iblade
quote: LastPost(rsForum("FORUM_ID")) 'call lastpost function
and that did the trick!
quote: i have one question left... need i change anything in post_info.asp?
as Doramoon posted, this code, need it be in post_info.asp?
'######## BEGIN LastPost Mod by Babygate ############# '<-- Added by iblade Dim strReplyDate Dim intAuthor Dim myRsTracker Dim intReplyID strReplyDate = DateToStr(strForumTimeAdjust) intAuthor = rs("MEMBER_ID") strSql = "SELECT @@Identity FROM " & strActivePrefix & "Reply " set myRsTracker = my_Conn.execute(strsql) intReplyID = myRsTracker(0) set myRsTracker = Nothing
'######## END of LastPost Mod by Babygate ############# '--> Added by iblade
How is that related to this Mod?
www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.