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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Different Default search order on just one forum ?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

pierretopping
Junior Member

United Kingdom
224 Posts

Posted - 09 April 2010 :  09:50:36  Show Profile  Visit pierretopping's Homepage
Hi All,

I'm looking at changing the default search of just one forum to be "Topic Title". Does anybody know how this can be done ?

Thanks

Pierre

Edited by - pierretopping on 09 April 2010 09:51:34

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 12 April 2010 :  04:55:48  Show Profile
Find the following beginning on line 66 of forum.asp:
Select Case strtopicsortord
	Case "asc"
		strSortOrd = " ASC"
	Case Else
		strSortOrd = " DESC"
		strtopicsortord = "desc"
End Select

Select Case strtopicsortfld
	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
strQStopicsort = "FORUM_ID=" & Forum_ID
And nest another select statement within the "else" case of both to check what the Forum_ID is and set the variable accordingly, where x is the ID of your forum:
Select Case strtopicsortord
	Case "asc"
		strSortOrd = " ASC"
	Case Else
		Select Case FORUM_ID
			Case x
				strSortOrd = " ASC"
				strtopicsortord = "asc"
			Case Else
				strSortOrd = " DESC"
				strtopicsortord = "desc"
		End Select
End Select

Select Case strtopicsortfld
	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
		Select Case FORUM_ID
			Case x
				strtopicsortfld = "topic"
				strSortCol = "T_SUBJECT" & strSortOrd
			Case Else
				strtopicsortfld = "lastpost"
				strSortCol = "T_LAST_POST" & strSortOrd
		End Select
End Select
I've used a select statement rather than an if statement as it makes it more efficient if you want to set different criteria for other forums at some stage in the future.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

pierretopping
Junior Member

United Kingdom
224 Posts

Posted - 12 April 2010 :  07:44:08  Show Profile  Visit pierretopping's Homepage
Thanks Shaggy, that's a great help :o)

Rgds,

Pierre
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 13 April 2010 :  04:16:55  Show Profile
You're welcome, Pierre


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
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.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07