Can you change the sorting options for one forum?
Well, The answer is No and Yes.
No. Not an option in base code.
Yes, you can. With modifications in following files and addition of a column in table FORUM_FORUM
Instructions posted below. I have not tested the modifications for actual results.
Files to be modified
post.asp
post_info.asp
forum.asp
Step 1:
Database Changes
Add a text field to table FORUM_FORUM
Name the filed as F_TOPIC_SORT_FIELD
Step 2:
post.asp
Add the followings statement block around Line 742
if strRqMethod = "Forum" or _
strRqMethod = "EditForum" then
Response.Write
"<tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ noWrap vAlign=""top"" align=""right"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" <b>Sort Topics by:</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>")
Response.write (vbNewLine & _
"<SELECT NAME=""topicsortfield"" style=""font-size:10px;"">" & vbNewLine & _
" <OPTION value=""topic""" & CheckSelected(fTopicSortFld, "topic") & ">topic title</OPTION>" & vbNewLine & _
" <OPTION value=""author""" & CheckSelected(fTopicSortFld, "author") & ">topic author</OPTION>" & vbNewLine & _
" <OPTION value=""replies""" & CheckSelected(fTopicSortFld, "replies") & ">number of replies</OPTION>" & vbNewLine & _
" <OPTION value=""views""" & CheckSelected(fTopicSortFld, "views") & ">number of views</OPTION>" & vbNewLine & _
" <OPTION value=""lastpost""" & CheckSelected(fTopicSortFld, "lastpost") & ">last post time</OPTION>" & vbNewLine & _
"</SELECT> " & vbNewLine & _
"<a href=""Javascript:openWindow3('pop_help.asp?mode=options#topicsortfield')"" tabindex=""-1"">" & getCurrentIcon(strIconSmileQuestion,"Click here to get more help on this option","") & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
"</tr>")
end if
Line 376-379
Add the statement as shown in red
if strRqMethod = "EditForum" then
fDefaultDays = rs("F_DEFAULTDAYS")
fForumCntMPosts = rs("F_COUNT_M_POSTS")
fTopicSortFld = rs("F_TOPIC_SORT_FIELD")
end if
Line 365-368
Modify the sql statement as shown in red
strSql = "SELECT F_SUBJECT, F_URL, F_PRIVATEFORUMS, F_PASSWORD_NEW, " & _
"F_DEFAULTDAYS, F_COUNT_M_POSTS, F_SUBSCRIPTION, F_MODERATION, F_DESCRIPTION, F_TOPIC_SORT_FIELD " & _
"FROM " & strTablePrefix & "FORUM " & _
"WHERE FORUM_ID = " & strRqForumId
Step 3:
post_info.asp
Lines 1342-1343
Add the statement as shown in red
strSql = strSql & ", F_DEFAULTDAYS = " & cLng(Request.Form("DefaultDays"))
strSql = strSql & ", F_TOPIC_SORT_FIELD = '" & ChkString(Request.Form("topicsortfield"),"SQLString") & "'"
strSql = strSql & ", F_COUNT_M_POSTS = " & cLng("0" & Request.Form("ForumCntMPosts"))
Lines 1134-1135
Add the statement as shown in red
strSql = strSql & ", " & ChkString(Request.Form("DefaultDays"), "SQLString")
strSql = strSql & ", " & ChkString(Request.Form("topicsortfield"), "SQLString")
strSql = strSql & ", " & ChkString(Request.Form("ForumCntMPosts"), "SQLString")
Lines 1102-1103
Add the statement as shown in red
strSql = strSql & ", F_DEFAULTDAYS "
strSql = strSql & ", F_TOPIC_SORT_FIELD "
strSql = strSql & ", F_COUNT_M_POSTS "
Step 4:
forum.asp
Add the following procedure around line 902 before the ASP closing tag (%>)
sub SetTopicSortField(strSortField,strtopicsortfld,strSortCol)
strtopicsortfld = strSortField
Select Case strSortField
Case "topic"
strSortCol = "T_SUBJECT" & strSortOrd
Case "author"
strSortCol = "M_NAME" & strSortOrd
Case "replies"
strSortCol = "T_REPLIES" & strSortOrd
Case "views"
strSortCol = "T_VIEW_COUNT" & strSortOrd
Case "lastpost"
strSortCol = "T_LAST_POST" & strSortOrd
Case Else
strtopicsortfld = "lastpost"
strSortCol = "T_LAST_POST" & strSortOrd
End Select
end sub
Add the statement as shown in red
Lines 217-219
if strtopicsortfld = "" then
call SetTopicSortField((rsCFStatus("F_TOPIC_SORT_FIELD")), strtopicsortfld, strSortCol)
end if
if nDays = "" then
nDays = rsCFStatus("F_DEFAULTDAYS")
end if
Lines 191-199
Modify the statements as shown in red
strSql = "SELECT C.CAT_STATUS, C.CAT_SUBSCRIPTION, " & _
"C.CAT_MODERATION, C.CAT_NAME, C.CAT_ID, " & _
"F.F_STATUS, F.F_SUBSCRIPTION, " & _
"F.F_MODERATION, F_DEFAULTDAYS, F.F_SUBJECT, F.F_TOPIC_SORT_FIELD " & _
" FROM " & strTablePrefix & "CATEGORY C, " & _
strTablePrefix & "FORUM F " & _
" WHERE F.FORUM_ID = " & Forum_ID & _
" AND C.CAT_ID = F.CAT_ID " & _
" AND F.F_TYPE = 0"
Lines 88-90
Modify the statements as shown below
Case Else
strtopicsortfld = "" '"lastpost"
strSortCol = "" '"T_LAST_POST" & strSortOrd
<edited to add additional changes required in forum.asp>