Need "Topic" to show newest post first.

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/65812?pagenum=1
05 November 2025, 18:28

Topic


Panhandler
Need "Topic" to show newest post first.
26 October 2007, 15:18


My forum has a Topic titled "Welcome New Members"

Each week I add a Reply to my welcoming message, welcoming the most recent registrants. My Reply shows at the bottom of the page, when it would be most appropriate if it showed as the very first post.
Is there a way that I could make that one Topic reverse the entry order of posts? <

 

Replies ...


phy1729
26 October 2007, 17:13


well my changing 309ish in topic.asp from
strSql4 = " ORDER BY R.R_DATE ASC"
to
strSql4 = " ORDER BY R.R_DATE DESC"
the first post is first an all replies are in reverse order hope this helps<
cripto9t
27 October 2007, 08:03


If you just want it for the one forum
Code:
strSql4 = " ORDER BY R.R_DATE "
if Forum_ID = "ForumIDHere" then
strSql4 = strSql4 & "DESC"
else
strSql4 = strSql4 & "ASC"
end if
<
Panhandler
27 October 2007, 09:56


One topic among many. Guess that won't work, eh?
phy1729 - I'm guessing that mod would apply to every topic in every forum?

cripto9t - Would that apply to all topic in just the one forum?
<
MaD2ko0l
27 October 2007, 10:46


woudl somthign liek thsi not work...code may be different butim taking the abiove code

strSql4 = " ORDER BY R.R_DATE "
if Topic_ID = "TopicIDHere" then
strSql4 = strSql4 & "DESC"
else
strSql4 = strSql4 & "ASC"
end if


that way you wil be looking for that specific topic and it shodlnt mess with anythign else<
phy1729
27 October 2007, 12:16


mine applies to the entire board
cripto9t is just one forum
MaD2ko0l is one topic
and for sake of completion for just one category replace Topic_ID with Cat_ID .
<
Panhandler
27 October 2007, 21:58


Okay. . .for just one topic this modification has been made:
--------------------------------
end if
strSql3 = strSql3 & " OR R.R_AUTHOR = " & MemberID & ")"
end if
'#### topic mod ###
strSql4 = " ORDER BY R.R_DATE "
if Topic_ID = "TOPIC_ID=111" then
strSql4 = strSql4 & "DESC"
else
strSql4 = strSql4 & "ASC"
end if
'### end Topic Mod ###

if strDBType = "mysql" then 'MySql specific code
if mypage > 1 then
intOffset = cLng((mypage-1) * strPageSize)
strSql5 = " LIMIT " & intOffset & ", " & strPageSize & " "
end if
---------------------------

However, it's had no effect on the topic! question<
phy1729
27 October 2007, 22:27


try
if Topic_ID = "111" then<
Panhandler
28 October 2007, 09:23


Now that worked! --------------------------------
end if
strSql3 = strSql3 & " OR R.R_AUTHOR = " & MemberID & ")"
end if
'#### Reverse Topic Order Mod ###
strSql4 = " ORDER BY R.R_DATE "
if Topic_ID = "111" then
strSql4 = strSql4 & "DESC"
else
strSql4 = strSql4 & "ASC"
end if
'### end Reverse Topic Order ###

if strDBType = "mysql" then 'MySql specific code
if mypage > 1 then
intOffset = cLng((mypage-1) * strPageSize)
strSql5 = " LIMIT " & intOffset & ", " & strPageSize & " "
end if
---------------------------

I'll use it just for welcoming new members since it's unlikely that they will think to use the "last post first" feature. But just for curiosity's sake, what if I wanted to apply the reverse topic order mod to more than one topic?<
MaD2ko0l
28 October 2007, 09:45


coul not not just add and "or" statement onto it?? somthing like this

if Topic_ID = "111" or Topic_ID = "112" then

im sure that would work as well<
muzishun
28 October 2007, 14:24


If you plan to have a large number of topics that will be reversed in order *plus* a large number of topics that are in normal order, you could add a field to the database that is a simple boolean. Add it to the TOPICS table. Basically have it set as false by default (normal order), then write the code for an admin/moderator to be able to check a box that will reverse the order for that topic.
That actually sounds like a fairly useful MOD.... any takers? My plate is fairly full right now.<
Panhandler
28 October 2007, 15:29


The simple Reverse Topic Order could get very confusing if applied to a large number of topics. . .especially if the users are trained to use the jump to last post feature.
Reverse Topic seems like a specialty mod. . .useful for one or perhaps two topics.
That's the beauty of Snitz Forums - being able to make small modifications as needed. Thanks for the help on this one. . .it works just beautifully. smile
(It might make for a useful blog commentary for someone too. . .)
<
phy1729
28 October 2007, 18:53


I needed to be applied to a large number of topics you could make those topics one forum and use cripto9t's code or one category and replace Topic_ID with Cat_ID . Also I think if that wouldn't work for you I'd be better not to have a list but to mod the db so that all topics have an ASC or DESC value and the topic is sorted by that.<
Etymon
29 October 2007, 08:52


Originally posted by muzishun
If you plan to have a large number of topics that will be reversed in order *plus* a large number of topics that are in normal order, you could add a field to the database that is a simple boolean. Add it to the TOPICS table. Basically have it set as false by default (normal order), then write the code for an admin/moderator to be able to check a box that will reverse the order for that topic.
That actually sounds like a fairly useful MOD.... any takers? My plate is fairly full right now.

Just remember that that query may throw an error when viewing archived topics.
The table prefix used for queries in topic.asp is strActivePrefix which could mean either the FORUM_TOPICS table or the FORUM_A_TOPICS table depending on whether or not Request("ARCHIVE") = "TRUE" ... if the table prefix was just strTablePrefix, then you would be fine in those queries for that page, alone, but perhaps still not for other queries on other pages depending on what you have going on at your site.
Also, remember that when adding fields to the FORUM_A_TOPICS table that if you want the value stored in that table in the database you will have to add the field name and related code to your queries in the admin_forums.asp page.<
© 2000-2021 Snitz™ Communications