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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Newest/Oldest Topic
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

animedj
Junior Member

USA
190 Posts

Posted - 09 August 2000 :  09:04:22  Show Profile  Visit animedj's Homepage  Send animedj an ICQ Message
Well, Another add-on that would add a newest/oldest topic in the topic.asp file. As always suggestions, bugs, fixes are welcome.

d/l : http://216.74.80.15/community/forums/hacks/topic_nav.zip

demo : http://216.74.80.15/community/forums/topic.asp?TOPIC_ID=63&FORUM_ID=8&CAT_ID=3



Lord Maverick
New Member

Norway
92 Posts

Posted - 09 August 2000 :  16:06:03  Show Profile  Send Lord Maverick an ICQ Message
Tested it, and it returned this error message:

Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/Forum2000/topic_nav.asp, line 19



Go to Top of Page

Nathan L
New Member

USA
83 Posts

Posted - 09 August 2000 :  16:08:48  Show Profile  Send Nathan L an AOL message  Send Nathan L an ICQ Message  Send Nathan L a Yahoo! Message
OK, the first two SQL statements need to be changed so that T_LAST_POST_DATE is a text string (i.e. placing it inside 's). As of right now, it's not so it's not being recognized as a text string, causing the date type mismatch.

Response.Write ("The Reign of Nice")
Go to Top of Page

Lord Maverick
New Member

Norway
92 Posts

Posted - 09 August 2000 :  16:27:18  Show Profile  Send Lord Maverick an ICQ Message
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>OK, the first two SQL statements need to be changed so that T_LAST_POST_DATE is a text string (i.e. placing it inside 's). As of right now, it's not so it's not being recognized as a text string, causing the date type mismatch.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Cant find the T_LAST_POST<font color=red>_DATE</font id=red>, so it would be nice to see the actual coding...

Go to Top of Page

animedj
Junior Member

USA
190 Posts

Posted - 09 August 2000 :  16:46:59  Show Profile  Visit animedj's Homepage  Send animedj an ICQ Message
hmm that's starnge.. I didn't get the error.. anyways I update the zip with fix. Anyways try to replace the SQL queries with these lines. The only fix added it's the <b>'</b> around the T_LAST_POST field

strSQL = "SELECT TOP 1 T_SUBJECT, TOPIC_ID " & _
"FROM " & strTablePrefix & "TOPICS " & _
"WHERE T_LAST_POST > '" & T_LAST_POST & _
"' AND FORUM_ID=" & Request.QueryString("Forum_ID") & _
" ORDER BY T_LAST_POST DESC;"

set rsPrevTopic = my_conn.Execute (strSQL)

strSQL = "SELECT TOP 1 T_SUBJECT, TOPIC_ID " & _
"FROM " & strTablePrefix & "TOPICS " & _
"WHERE T_LAST_POST < '" & T_LAST_POST & _
"' AND FORUM_ID=" & Request.QueryString("Forum_ID") & _
" ORDER BY T_LAST_POST DESC;"

set rsNextTopic = my_conn.Execute (strSQL)

Go to Top of Page

slemieux
Junior Member

USA
234 Posts

Posted - 09 August 2000 :  16:56:56  Show Profile
Yahoo!!

That seems to have fixed it! Thanks animedj!! That one's been driving me nuts <img src=icon_smile.gif border=0 align=middle>

Go to Top of Page

Nathan L
New Member

USA
83 Posts

Posted - 09 August 2000 :  17:24:33  Show Profile  Send Nathan L an AOL message  Send Nathan L an ICQ Message  Send Nathan L a Yahoo! Message
Whoops, yeah, it's just T_LAST_POST. Anyway....

Response.Write ("The Reign of Nice")
Go to Top of Page

Lord Maverick
New Member

Norway
92 Posts

Posted - 09 August 2000 :  17:45:48  Show Profile  Send Lord Maverick an ICQ Message
There is a logical mistake here, and I'm confused about the texting "next newest topic" and "next oldest topic". I think a more understandable solutions to the users would be to do the last/next thing according to how its visualised on the forum.asp.

I also prefer to use "next topic" (meaning next topic as it is visualised at forum.asp) and "last topic".

First the logical thing. The sorting order in animedjs latest SQL should be <font color=red>ASC</font id=red> not DESC for the first SQL-test. Else it would return to the newest post (at the top of forum.asp) when clicking "next oldest topic" at the oldest topic. (Think my tongue just twirled...!!) I've changed the SQL animedj last posted to this:

strSQL = "SELECT TOP 1 T_SUBJECT, TOPIC_ID " & _
"FROM " & strTablePrefix & "TOPICS " & _
"WHERE T_LAST_POST > '" & T_LAST_POST & _
"' AND FORUM_ID=" & Request.QueryString("Forum_ID") & _
" ORDER BY T_LAST_POST <font color=red>ASC</font id=red>;"

set rsPrevTopic = my_conn.Execute (strSQL)

strSQL = "SELECT TOP 1 T_SUBJECT, TOPIC_ID " & _
"FROM " & strTablePrefix & "TOPICS " & _
"WHERE T_LAST_POST < '" & T_LAST_POST & _
"' AND FORUM_ID=" & Request.QueryString("Forum_ID") & _
" ORDER BY T_LAST_POST DESC;"

set rsNextTopic = my_conn.Execute (strSQL)


and I've also changed the following code to this:

if rsPrevTopic.EOF then
prevTopic = "<font color=red>last topic</font id=red>"
else
prevTopic = "<a href=topic.asp?cat_id=" & request.queryString("CAT_ID") & _
"&FORUM_ID=" & Request.QueryString("FORUM_ID") & _
"&TOPIC_ID=" & rsPrevTopic("TOPIC_ID") & _
"&Topic_Title=" & ChkString(rsPrevTopic("T_SUBJECT"),"urlpath") & _
"&Forum_Title=" & ChkString(Request.QueryString("Forum_Title"),"urlpath") & _
"><font color=red>last topic</font id=red></a>"
end if

if rsNextTopic.EOF then
NextTopic = "<font color=red>next topic"</font id=red>
else
NextTopic = "<a href=topic.asp?cat_id=" & request.queryString("CAT_ID") & _
"&FORUM_ID=" & Request.QueryString("FORUM_ID") & _
"&TOPIC_ID=" & rsNextTopic("TOPIC_ID") & _
"&Topic_Title=" & ChkString(rsNextTopic("T_SUBJECT"),"urlpath") & _
"&Forum_Title=" & ChkString(Request.QueryString("Forum_Title"),"urlpath") & _
"><font color=red>next topic</font id=red></a>"
end if





Edited by - Lord Maverick on 09 August 2000 17:46:54

Edited by - Lord Maverick on 09 August 2000 17:48:20
Go to Top of Page

animedj
Junior Member

USA
190 Posts

Posted - 09 August 2000 :  20:25:36  Show Profile  Visit animedj's Homepage  Send animedj an ICQ Message
About the queries, you are right Maverick, That's something I've overlooked while i was coding it this morning, and about the wroding, well that's a people choice...for me last post would mean the laspot being posted.. <img src=icon_smile_big.gif border=0 align=middle> . Fixed the zip and well.. you already posted the query.

Go to Top of Page
  Previous Topic Topic Next Topic  
 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.11 seconds. Powered By: Snitz Forums 2000 Version 3.4.07