Author |
Topic |
mvaughn
Starting Member
30 Posts |
Posted - 11 June 2001 : 17:36:17
|
How about, eventually, having it highlight the searched out words.
-Mark- __________________ That which fascinates us, is in fact true. |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
|
mfindlay
Junior Member
USA
144 Posts |
Posted - 11 June 2001 : 19:39:41
|
quote:
Something like this: http://www.codeproject.com/asp/highlight.asp
you could use the function mentioned in that article to process the Topic subject and the Topic and reply messages.
I knew I saw that article somewhere. Thanks.
|
|
|
mfindlay
Junior Member
USA
144 Posts |
Posted - 12 June 2001 : 12:11:48
|
quote:
How about, eventually, having it highlight the searched out words.
-Mark- __________________ That which fascinates us, is in fact true.
Working on it now. I am going to release SuperSearch 2.0 first. It has a complete reworking of the query and adds a 'max recs to display' option and some other items. I've been playing around with the highlighting code and it looks like a go so will add that after 2.0
|
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 12 June 2001 : 16:49:37
|
mfindlay,
I have put the beta version 2 in, but thought that I would let you know that you for got to change the 'form action' tag to search.asp. It was looking for test_search.asp.
Apart from that no issues with putting it in.
quote:
Working on it now. I am going to release SuperSearch 2.0 first. It has a complete reworking of the query and adds a 'max recs to display' option and some other items. I've been playing around with the highlighting code and it looks like a go so will add that after 2.0
Regards,
Webmaster @ Classic Motor Cycling Classic Motor Cycling |
|
|
mfindlay
Junior Member
USA
144 Posts |
Posted - 12 June 2001 : 16:58:08
|
quote:
mfindlay,
I have put the beta version 2 in, but thought that I would let you know that you for got to change the 'form action' tag to search.asp. It was looking for test_search.asp.
Apart from that no issues with putting it in.
quote:
Working on it now. I am going to release SuperSearch 2.0 first. It has a complete reworking of the query and adds a 'max recs to display' option and some other items. I've been playing around with the highlighting code and it looks like a go so will add that after 2.0
Regards,
Webmaster @ Classic Motor Cycling Classic Motor Cycling
I just caught that myself (there is no smilie for "Doh!"...) I have updated the zipfile. Hope it didn't cause too much confusion. Thanks for the note!
Edited by - mfindlay on 13 June 2001 00:02:31 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 12 June 2001 : 17:40:29
|
Mark,
I got the highlighting to work, but I used inline styles to have a different color background. Basically the colors are just reversed for the highlighted words. I've got it working in the topic message and reply message, but just for the individual words right now. I've still got to add in an if/then for if the user is searching for a phrase and pass that variable on to topic.asp. Also need to add the highlighting code to the Topic subject as well. |
|
|
mfindlay
Junior Member
USA
144 Posts |
Posted - 12 June 2001 : 18:46:37
|
quote:
Mark,
I got the highlighting to work, but I used inline styles to have a different color background. Basically the colors are just reversed for the highlighted words. I've got it working in the topic message and reply message, but just for the individual words right now. I've still got to add in an if/then for if the user is searching for a phrase and pass that variable on to topic.asp. Also need to add the highlighting code to the Topic subject as well.
Great, you might want to hold off on any search.asp changes until I post the 2.0 release later this evening since it is a major rewrite from the 1.x versions.
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 12 June 2001 : 20:19:49
|
I've been working with just the standard Snitz search.asp page. |
|
|
Freeman II
Junior Member
232 Posts |
Posted - 13 June 2001 : 01:24:13
|
good job awesome mod!
when are you going to release the next version? with word highlights
|
|
|
mfindlay
Junior Member
USA
144 Posts |
Posted - 13 June 2001 : 02:02:29
|
quote:
good job awesome mod!
when are you going to release the next version? with word highlights
2.2 has now been released. You can download it at http://www.sagecomputerservices.com/downloads/supersearch.asp
Contains: *Color coding of keywords *Admin configurable color coding settings *Admin configurable max number of keywords to allow any single search on *Admin configurable max input length of search edit box for any single query
Edited by - mfindlay on 14 June 2001 21:42:37 |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 13 June 2001 : 02:09:28
|
question:
will the highlight work on asian languages? e.g. no space between words/centence, diff comma, period etc.
this is in a low priority.
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 13 June 2001 : 02:24:30
|
Problems with the highlighting that I have come across with testing it myself is with single letters. Try doing a search for: h for example. Then view the posts. It messes up the HTML tags in the messages. Maybe just check for the length of the searchword, if it's 1 character, then don't process the highlight code?
Here is what I use in the topics:
keywords = split(Request.QueryString("searchwords"), " ") myText = formatStr(rs("T_MESSAGE")) strStart = "<font style=""background-color:" & strForumFontColor & "; color:" & strForumFirstCellColor & ";"">" For Each word in keywords myText = Highlight(myText, word, strStart, "</font>") Next %>
Here is what I use in the replies:
keywords = split(Request.QueryString("searchwords"), " ") myText = formatStr(rs("R_MESSAGE")) strStart = "<font style=""background-color:" & strForumFontColor & "; color:" & CColor & ";"">" For Each word in keywords myText = Highlight(myText, word, strStart, "</font>") Next %>
That way with both the Topic and the Replies the highlight font is the same color as the cell background color and the background highlight is the same color as the message font. Of course there are probably browsers that don't like inline styles. You could also define .highlight1 & .highlight2 in the CSS portion of inc_top.asp and then just use class=highlight1 or class=highlight2. |
|
|
mfindlay
Junior Member
USA
144 Posts |
Posted - 13 June 2001 : 13:38:28
|
quote:
question:
will the highlight work on asian languages? e.g. no space between words/centence, diff comma, period etc.
this is in a low priority.
I believe it should since the query uses the LIKE %word% clause, but of course the best way to find out is to run it. Let me know if you would like an advance BETA copy.
|
|
|
mfindlay
Junior Member
USA
144 Posts |
Posted - 13 June 2001 : 14:00:48
|
quote:
Problems with the highlighting that I have come across with testing it myself is with single letters. Try doing a search for: h for example. Then view the posts. It messes up the HTML tags in the messages. Maybe just check for the length of the searchword, if it's 1 character, then don't process the highlight code?
Here is what I use in the topics:
keywords = split(Request.QueryString("searchwords"), " ") myText = formatStr(rs("T_MESSAGE")) strStart = "<font style=""background-color:" & strForumFontColor & "; color:" & strForumFirstCellColor & ";"">" For Each word in keywords myText = Highlight(myText, word, strStart, "</font>") Next %>
Here is what I use in the replies:
keywords = split(Request.QueryString("searchwords"), " ") myText = formatStr(rs("R_MESSAGE")) strStart = "<font style=""background-color:" & strForumFontColor & "; color:" & CColor & ";"">" For Each word in keywords myText = Highlight(myText, word, strStart, "</font>") Next %>
That way with both the Topic and the Replies the highlight font is the same color as the cell background color and the background highlight is the same color as the message font. Of course there are probably browsers that don't like inline styles. You could also define .highlight1 & .highlight2 in the CSS portion of inc_top.asp and then just use class=highlight1 or class=highlight2.
IMHO I think it's more appropriate not to process the keyword at all right from the start if it's a single letter. I am editing out single entries at the point of building the querystring. Just a couple other non-color-coding considerations, I am allowing the admin to set the max input length of the entire keyword field and the max number of keywords allowed to be searched for, to prevent malicious or at least unintentional overloading of the system/query.
|
|
|
Topic |
|