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)
 Search Form Enhancement
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 4

work mule
Senior Member

USA
1358 Posts

Posted - 27 September 2002 :  07:48:06  Show Profile
SEARCH FORM ENHANCEMENT (Advanced Search)

Release Date: 09/27/2002
Last Updated: 09/28/2002

DOWNLOAD HERE

DEMO - See posts below
Thank you to everyone who's posted links!!

I saw this setup at the Bioware Boards and thought it'd be interesting to try something like that on Snitz. This file is pretty much the same search.asp with cosmetic changes and a couple of asp code modifications. No database modifications are required.

Features
select range of dates
select from a list of staff members (admins/moderators) [optional]
select sort option
select # of results to display per page
includes a common word filter
and more....

Installation
To use this, place inside your forum directory and bring up the page in your browser. It's that simple. This version doesn't require any additional fields. The file can be renamed to whatever name you'd like to use. You do not have to replace your current search.asp file to try this out.

Configuration Notes (updated)

USE MEMBER DROP DOWN LIST
Choose between displaying a list of all members or an input field for people use when they want to search for posts by specific members. For forums with a large user base, it's recommended that you use the input field. This is part of the original search.asp file.

   'Display Member List vs. Text Box [0:Text Box;1:Member List]
   strUseMemberDropDownBox = 0


FORUM START YEAR
This is used as the base year for the drop down list of years. Set this to the first year your forums went live.

   'Set to the Year the forum started
   intForumStartYear = 2000 'Set to Year the forum started


DATE DISPLAY FOR DATE RANGE
By setting this, you can control in what order the lists appear. For example, if you type in "dmy", the lists will be day, month, year. If you prefer month first, then use "mdy". If this is empty, it will use the forum setting.

   'Date Display Override [ "dmy","mdy","ymd","ydm" ]
   '...if empty, it uses the forum's global setting
   strSearch_DateType = ""


MONTH FORMAT FOR DATE RANGE
This controls in what format the months will display.

Examples:
Full - September
Abbreviated - Sep
Numeric - 09
Custom - (see below)

   'Display of Month [0:Full;1:Abbreviated;2:Numeric;3:Custom]
   intSearch_MonthFormat = 0


CUSTOM MONTH FORMAT (optional)
This allows you to customize the list of months. Primarily used for translations.

   'Customized Month Array (used if intSearch_MonthFormat = 3)
   arrMonths(0)="January"
   arrMonths(1)="February"
   arrMonths(2)="March"
   arrMonths(3)="April"
   arrMonths(4)="May"
   arrMonths(5)="June"
   arrMonths(6)="July"
   arrMonths(7)="August"
   arrMonths(8)="September"
   arrMonths(9)="October"
   arrMonths(10)="November"
   arrMonths(11)="December"


DISPLAY STAFF LIST
Select whether or not you want to display a list of staff members. If set to 0, this option will not be displayed. Set this to 1 to query the database, which will list all members who are admin or moderators. Set this to 2 to use your custom list of staff members.

   'Staff List [0:Not Used;1:Database;2:Custom List]
   intSearch_StaffList = 2


TOTAL STAFF MEMBERS (optional - required for custom list)
This is required if you choose to use the custom staff list. Set this to the total number of members that are in your list.

   'Total Number of Staff (used if Staff List option set to 2)
   'This MUST match the total number of people in the staff list
   intSearch_StaffTotal = 3


CUSTOM STAFF LIST (optional)
This is where you can specify your own custom list of staff members. If you don't want all of your moderators to be listed, then use this option. You can also use this to customize how the names or whatever will be displayed in the list and/or the order.

   'STAFF LIST

   'arrStaffList(0,x) is the MEMBER ID
   'arrStaffList(1,x) is the MEMBER NAME (can be anything)
   '   x is the order

   arrStaffList(0,0)=1
   arrStaffList(1,0)="Mr. Slate (Head Honcho)"
   arrStaffList(0,1)=2
   arrStaffList(1,1)="Fred Flintsone (Moderator)"
   arrStaffList(0,2)=3
   arrStaffList(1,2)="Barney Rubble (Moderator)"
   
   'note: the 3 array records can be deleted/commented if
   '      intSearch_StaffList is not set 2

When modifying this list, for each member, you need to add two lines.

   arrStaffList(0,1)=2
   arrStaffList(1,1)="Fred Flintsone (Moderator)"

In red is the numbering for the array. This should start at 0 and be sequential. This is also the order in which the members will be listed in the drop down list.

In orange is where the member id would be placed. This is the MEMBER_ID for the member in the MEMBERS table.

In blue is the name/text you want displayed for the member.

COMMON WORD FILTER
The common word filter will filter out common words from the search text. Words like 'a' and 'the' will not be used when querying the database. To edit the list of common words, look at about Line 1349:
arrayCommonWords = "|a|all|an|and|are|as|at|be|by|do|for|from|had|has|have|he|his|I|if|in|is|it|no|of|on|one|or|so|that|the|then|they|this|to|was|we|with|you|"


Note
This should be okay, but I haven't tested this 100%. There are probably still some tweaks that could made to this.

Let me know what you think of this. Good, bad or otherwise.

Edited by - work mule on 28 September 2002 22:38:38

Rasco
Advanced Member

Germany
3192 Posts

Posted - 27 September 2002 :  08:15:27  Show Profile  Send Rasco an ICQ Message
That sounds good. Will try to implement it in the evening.

German Snitz Forum
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 27 September 2002 :  11:17:21  Show Profile  Visit dayve's Homepage
I put it on my forum, gonna test this baby out now:

http://dayve.d2g.com/forum/search_mod.asp

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 27 September 2002 :  11:26:57  Show Profile  Visit dayve's Homepage
I like it dave, great job.


Edited by - dayve on 27 September 2002 11:27:09
Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 27 September 2002 :  22:32:14  Show Profile
whenever I use one of the CommonWords, it says "You must enter keywords".

is it how it supposed to work?

I couldn't understand what this code stands for?

	Private Sub DisplayCommonWordExclusions()
		If strcommonwordexcl <> "" Then
			response.write "<div style=""color:#6f6f6f;"">"
			response.write "<b>""" & strcommonwordexcl & """</b>"
			If Instr(strcommonwordexcl,",") > 0 Then
				response.write " are very common words and were not included in your search."
			Else
				response.write " is a very common word and was not included in your search."
			End If
			response.write "</div>"
			response.write "<div style=""font-size:6px""> </div>"
		End If
	End Sub
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 27 September 2002 :  23:31:42  Show Profile
quote:
Originally posted by blackinwhite

whenever I use one of the CommonWords, it says "You must enter keywords".

is it how it supposed to work?



The CommonWords filter strips out common words such as 'the', 'a', 'and', etc. from the criteria used in the query. For example, if someone types in "the sql database" and "Search for all Words" - then as part of the criteria, it'll search for the word "the" in the database which will result in a lot of records that you most likely didn't want included in the results (search for "the" at Snitz results in 242 pages). It's also database friendly since it cuts down on people pounding the database with common words in the search queries.

Here's where I got the idea from:
http://www.google.com/help/basics.html#stopwords

Try visiting Google and type in "the snitz forums" and you'll see their message regarding common words.

What I need to do is when someone enters in only a common word(s), then take them to the regular page which says no records have been found and post the notice about the common words. Just a minor thing...

Note to self: One modification I see I should make is that if someone selects to search on an exact phrase, then I shouldn't send it through the CommonWords filter, but leave it intact. Fixed in update

quote:
Originally posted by blackinwhite

I couldn't understand what this code stands for?

	Private Sub DisplayCommonWordExclusions()
           ...
	End Sub




If a user includes one of the common words in the search, this will display a message stating that certain words are not used in the search.

Once again, the intentions are that you should have been taken to the page and shown this message, but I guess I have to tweak that a bit.

Does that answer your questions?

Edited by - work mule on 28 September 2002 22:31:50
Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 28 September 2002 :  07:02:56  Show Profile
yeah,

thanks for the detailed explanation.

great addition BTW. :)
Go to Top of Page

snerdley
New Member

USA
65 Posts

Posted - 28 September 2002 :  07:18:07  Show Profile
I like it! Thanks!

http://www.kc5nyo.net/forum/search.asp


snerd
Go to Top of Page

HarshReality
Junior Member

USA
128 Posts

Posted - 28 September 2002 :  07:45:22  Show Profile  Visit HarshReality's Homepage  Send HarshReality an AOL message  Send HarshReality an ICQ Message  Send HarshReality a Yahoo! Message
too sweet! Thanks for the work!


Anti Social Personality
Go to Top of Page

sy
Average Member

United Kingdom
638 Posts

Posted - 28 September 2002 :  09:13:34  Show Profile  Visit sy's Homepage  Send sy a Yahoo! Message
Looks excellent! Looks good at your forum dayve.

Good stuff

Sy

The pessimist complains about the wind; the optimist expects it to change; the realist adjusts the sails

Go to Top of Page

RISING
Starting Member

Switzerland
24 Posts

Posted - 28 September 2002 :  09:40:19  Show Profile  Visit RISING's Homepage
Looks good (just saw it on other pages), is there a possibility to have a basic <=> advanced search button? So peeps can choose what kind of search they want.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 28 September 2002 :  13:18:34  Show Profile
I have it (with the option to select basic vs advanced search) installed on my 3.4.02 forum @ Carefree
Go to Top of Page

RISING
Starting Member

Switzerland
24 Posts

Posted - 28 September 2002 :  13:39:55  Show Profile  Visit RISING's Homepage
Sry all, after reading the 1. post again it came clear to me too
Go to Top of Page

corneillie
Junior Member

140 Posts

Posted - 28 September 2002 :  15:01:34  Show Profile  Visit corneillie's Homepage
Hello,

Excellent work !, I have a Dutch forum 3.4.02 (translated myself) and I was wondering how to have the months translated. Or, written into numbers (februari = 02)

Is there a solution for that please?

Thanks
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 28 September 2002 :  17:01:16  Show Profile
Thank you all for your comments.

I'll have an update for this soon to take care of a couple items noted above. I'll also provide a way to customize the month names.

Shouldn't take too long, I hope.
Go to Top of Page

corneillie
Junior Member

140 Posts

Posted - 28 September 2002 :  17:32:33  Show Profile  Visit corneillie's Homepage
Thanks a lot !
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Next Page
 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.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07