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 DEV-Group
 DEV Discussions (General)
 Search Term Highlighting
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 07 September 2002 :  10:09:08  Show Profile
I did some searching "global strings" on these forums and I used the Match exact phrase option.

The search highlighting option added "&SearchTerms=global,strings" to the URLs so it highlighed the words separately.

Shouldn't it be highlighting the words together if the Match extact prhrase option is used? e.g. "&SearchTerms=global%20strings"

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 September 2002 :  11:38:34  Show Profile
I had thought about that too. But the highlighter only highlights the text you search for. What search option you choose does not affect it. That would be an intelligent highlighter if you ask me.

If you can get the highlighter to highlight depending on the search criteria, that would be great. I haven't tried at it though.

Support Snitz Forums
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 07 September 2002 :  14:33:39  Show Profile
Here's some code to do it:

Find line 204:
SearchLink = "&SearchTerms=" & chkString(strKeyWords,"search")

Replace with:
if strAndOr = "phrase" then
SearchLink = "&SearchTerms=" & Server.URLEncode(Request.Form("Search"))
else
SearchLink = "&SearchTerms=" & Server.URLEncode(strKeyWords)
end if

Edited by - pweighill on 07 September 2002 14:39:47
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 September 2002 :  20:18:01  Show Profile
I believe you would need to put them through ChkString() still. To check for hazardous characters.
if strAndOr = "phrase" then
     SearchLink = "&SearchTerms=" & Server.URLEncode(chkString(Request.Form("Search"),"search")
else
     SearchLink = "&SearchTerms=" & Server.URLEncode(chkString(strKeyWords,"search")
end if
Again I haven't tried this code.

Support Snitz Forums
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 08 September 2002 :  05:22:08  Show Profile
quote:
Originally posted by Davio

I believe you would need to put them through ChkString() still.


I think it would be better run the functions the other way around. It would allow " to be highlighted in search terms.
SearchLink = "&SearchTerms=" & chkString(Server.URLEncode(strKeyWords),"search")


quote:
Originally posted by Davio

Again I haven't tried this code.

I can see that, you missed a ) of the end of the lines.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 08 September 2002 :  05:36:12  Show Profile
using Server.URLEncode caused quite a few problems.

I changed this:

			SearchLink = "&SearchTerms=" & chkString(strKeyWords,"search")


to this:

			if strAndOr = "phrase" then strKeyWords = replace(strKeyWords,",","+")
			SearchLink = "&SearchTerms=" & chkString(strKeyWords,"search")


seems to work fine, and doesn't cause problems with other characters.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 09 September 2002 :  06:07:30  Show Profile
implemented in v3.4.03
Go to Top of Page

nathansym
Junior Member

163 Posts

Posted - 17 September 2002 :  09:56:37  Show Profile  Visit nathansym's Homepage  Send nathansym an AOL message
probably pretty obvious but just wanted to make a note that this is in search.asp

- Thanks
- Nathan
- www.gunslackers.com
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.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07