Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Last Post MOD error
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

crash
Advanced Member

Netherlands
2064 Posts

Posted - 05 August 2002 :  01:12:55  Show Profile  Visit crash's Homepage
i have added the lastpost mod code to my files and noticed this very weird thing going on...

in inc_functions.asp, there is this one line that riddles my mind:

when i use this line, it works on active.asp and not on default.asp
strSql = "SELECT TOP 1 TOPIC_ID, T_LAST_POSTER, T_REPLIES FROM " & strTablePrefix & "TOPICS WHERE " & ID & "= " & Forum & ""

now when i use this line, it works on default.asp and not on active.asp
strSql = "SELECT TOP 1 TOPIC_ID, T_LAST_POSTER, T_REPLIES FROM " & strTablePrefix & "TOPICS WHERE " & ID & "= " & rsForum("FORUM_ID") & ""


here's the code in both files:
default.asp:
		"        <b>" & ChkDate(rsForum("F_LAST_POST")) & "</b><br>" & vbNewline & _
" " & ChkTime(rsForum("F_LAST_POST")) & strLastUser

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!



Crash's Site | Crash is from

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 05 August 2002 :  03:02:46  Show Profile
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:

'######## BEGIN LastPost Mod by Babygate #############
Response.Write " <td bgcolor=""" & strForumCellColor & """ valign=center align=""center""" & _
"nowrap><font face=""" & strDefaultFontFace & """ size=" & strFooterFontSize & "" & _
"color=" & strForumFontColor & "><b>" & ChkDate(Topic_Last_Post) & "</b> " & _
ChkTime(Topic_Last_Post) & strLastAuthor

Response.Write " <a href=""topic.asp?TOPIC_ID=" & Topic_ID

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 think u can get the solution from the author BabyGate's website



~~ ¡¹ ¡¸ ¡¸¡¹ ¡¸ ¡¹ ~~
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 05 August 2002 :  03:16:06  Show Profile  Visit crash's Homepage
thanks! i just visited BabyGate's site but i found the same version as i already have...

i will try what you posted though, hope that helps...

one other thing: on the page that works, all the last posts point to the same number...

eg.: topic.asp?TOPIC_ID=xxxx#zzzz

the zzzz is the same in each post...

This has been fixed



Crash's Site | Crash is from


Edited by - crash on 05 August 2002 13:02:15
Go to Top of Page

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 05 August 2002 :  09:57:34  Show Profile
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

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


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.


~~ ¡¹ ¡¸ ¡¸¡¹ ¡¸ ¡¹ ~~
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 05 August 2002 :  10:39:58  Show Profile  Visit crash's Homepage
thank you so much! i will play with this wheni get home. will let you know whether that worked out for me!





Crash's Site | Crash is from
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 05 August 2002 :  11:40:53  Show Profile  Visit dayve's Homepage
crash, I had the same exact problems and can't remember everything I did, but there was like 4 major issues I ran into. I will try to break it down by

default.asp
forum.asp
topic.asp
active.asp

OR I can point you to my source code for review? that might be easier.

http://www.nineinchnailz.com

Snitz Exchange | Snitz Icons | Do's and Dont's
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  11:47:10  Show Profile
Looks like a problem with values being passed to function LastPost.
Check the values by doing Response.write

www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 05 August 2002 :  12:24:00  Show Profile  Visit crash's Homepage
dayve, getting me to look at the code is fine. thanks for answering!

GauravBhabu, the response.write tells me that the variable for Forum_ID isn't found...

Syntax error (missing operator) in query expression 'FORUM_ID= AND T_STATUS < 2'


the fun part is that when i change a line in inc_funtions.asp - as written in my first post - the error doesn't appear.

it will however show up on the other page (meaning that if it shows up on default.asp, it won't show up on active.asp and vica versa).



Crash's Site | Crash is from
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  12:28:14  Show Profile
That is what I expected. Post the function and the statements which are calling the function.

www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 05 August 2002 :  12:37:59  Show Profile  Visit crash's Homepage
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 #############

default.asp - UPDATED!
'######## BEGIN LastPost Mod by Babygate #############
Response.Write " <td align=""center"" valign=""top"" nowrap><font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strFooterFontSize & """>" & vbNewline & _
" <b>" & ChkDate(rsForum("F_LAST_POST")) & "</b><br>" & vbNewline & _
" " & ChkTime(rsForum("F_LAST_POST")) & strLastUser

LastPost(Forum_ID) 'call lastpost function
Response.write " </font></td>" & vbNewline
'######## END of LastPost Mod by Babygate #############

active.asp - UPDATED!
'######## BEGIN LastPost Mod by Babygate #############
Response.Write " <td bgcolor=""" & strForumCellColor & """ valign=center align=""center""" & _
"nowrap><font face=""" & strDefaultFontFace & """ size=" & strFooterFontSize & "" & _
"color=" & strForumFontColor & "><b>" & ChkDate(Topic_Last_Post) & "</b> " & _
ChkTime(Topic_Last_Post) & strLastAuthor

Response.Write " <a href=""topic.asp?TOPIC_ID=" & Topic_ID

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.

Edited by - crash on 05 August 2002 13:00:38
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  13:03:19  Show Profile
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.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  13:05:55  Show Profile
quote:
NOTE: active.asp works nicely, but on default.asp the error described a few posts earlier still shows up.



As I said in my earlier post, either populate the variable with appropriate values or Change the call statement in default.asp as below.

LastPost(rsForum("FORUM_ID")) 'call lastpost function

www.forumSquare.com - Rakesh Jain - It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Edited by - GauravBhabu on 05 August 2002 13:08:00
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 05 August 2002 :  13:32:40  Show Profile  Visit crash's Homepage
i tried this in default.asp, since active.asp seems to work fine now:
'Check if the variable is populated.
Response.write "Forum_ID: " & Forum_ID
LastPost(Forum_ID) 'call lastpost function

but it kept returning an empty value

i also tested your last post:
LastPost(rsForum("FORUM_ID")) 'call lastpost function


and that did the trick!

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




Crash's Site | Crash is from
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 05 August 2002 :  13:32:57  Show Profile  Visit dayve's Homepage
crash...

default.asp
http://dayve.d2g.com/forum/display_source.asp?page=default.asp

inc_functions.asp
http://dayve.d2g.com/forum/display_source.asp?page=inc_functions.asp

forum.asp
http://dayve.d2g.com/forum/display_source.asp?page=forum.asp

active.asp
http://dayve.d2g.com/forum/display_source.asp?page=active.asp

http://www.nineinchnailz.com

Snitz Exchange | Snitz Icons | Do's and Dont's
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 05 August 2002 :  13:34:30  Show Profile  Visit crash's Homepage
dayve, could you get me post_info.asp as well? thanks!



Crash's Site | Crash is from
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 05 August 2002 :  13:53:02  Show Profile
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.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.53 seconds. Powered By: Snitz Forums 2000 Version 3.4.07