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)
 MOD: post.asp - forum list including category name
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

work mule
Senior Member

USA
1358 Posts

Posted - 27 March 2001 :  03:05:33  Show Profile
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

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 March 2001 :  03:41:51  Show Profile
excellent idea.
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.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07