On post.asp when you edit a Topic, there's a drop down with a list of forums. I thought it would be nice to also include the category name and attempt to sort by category. This is helpful if you have forums with similiar names, but in different categories.
The following line references are for 3.1sr4.
In post.asp - Line 611-614 - you should see a SQL statement that you can replace with this:
'## Forum_SQL
strSql = "SELECT " & strTablePrefix & "FORUM.F_SUBJECT, " &_
strTablePrefix & "FORUM.F_TYPE, " & strTablePrefix & "FORUM.CAT_ID, " &_
strTablePrefix & "FORUM.FORUM_ID, " &_
strTablePrefix & "CATEGORY.CAT_NAME, " &_
" FROM " & strTablePrefix & "FORUM LEFT OUTER JOIN " &_
strTablePrefix & "CATEGORY ON " &_
strTablePrefix & "FORUM.CAT_ID = " & strTablePrefix & "CATEGORY.CAT_ID " &_
" WHERE F_TYPE = 0 "
Line 626 should be the ORDER BY part of the SQL statement, which can be modified to add the category id to sort on:
strSql = strSql & " ORDER BY " & strTablePrefix & "FORUM.CAT_ID ASC, " &_
strTablePrefix & "FORUM.F_SUBJECT ASC;"
Line 638 is where the forum name is displayed in the list. Replace that line with the following:
Response.Write ">" & ChkString(rsForum("CAT_NAME"),"display") & " - " & ChkString(rsForum("F_SUBJECT"),"display") & "</option>" & vbCrLf
If you have applied the latest mod for Category & Forum sorting, then here's the modifications for the SQL string. It's the same line numbers, but different code to paste in:
Lines 611-614
'## Forum_SQL
strSql = "SELECT " & strTablePrefix & "FORUM.F_SUBJECT, " &_
strTablePrefix & "FORUM.F_TYPE, " & strTablePrefix & "FORUM.CAT_ID, " &_
strTablePrefix & "FORUM.FORUM_ID, " &_
strTablePrefix & "FORUM.FORUM_ORDER, " &_
strTablePrefix & "CATEGORY.CAT_NAME, " &_
strTablePrefix & "CATEGORY.CAT_ORDER " &_
" FROM " & strTablePrefix & "FORUM LEFT OUTER JOIN " &_
strTablePrefix & "CATEGORY ON " &_
strTablePrefix & "FORUM.CAT_ID = " & strTablePrefix & "CATEGORY.CAT_ID " &_
" WHERE F_TYPE = 0 "
Line 626
strSql = strSql & " ORDER BY " & strTablePrefix & "CATEGORY.CAT_ORDER ASC, " &_
strTablePrefix & "FORUM.FORUM_ORDER ASC, " &_
strTablePrefix & "FORUM.F_SUBJECT ASC;"
Edited by - work mule on 27 March 2001 20:09:48