Re: Highlighting words found in a keyword search
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 50554
interpreted = N
texte = I can do that in 2 lines, here's the code:[Text]My_String=A San Francisco school bus driver is facing a felony drunken driving charge after he allegedly ran a stop sign [/text][grep search= [arg] &replace=
[arg]][My_String][/grep]try: http://otis.kaiwi.com/SpiderBotLock/wordsearch.tpl?arg=bus: c)Hope this helpsMKOn Wednesday, May 21, 2003, at 09:23 AM, WebCat @ Inkblot Media wrote:> Marc brought up a good point.>> If you search for an a you break it. This is because of my loop+grep> feature. It is finding the a in the span I use to highlight.>> If someone could fix the GREP to excluse anything between < and > then > it> should be ok.>> You could also use a temp database and [convetwords], but you will > need to> pass some sort of session code or set a cookie to know what temp > database> goes with the user. This in my opinion is not that great of an idea > for high> traffic sites, because you will have a lot of temp databases.>> I do not know enough about webcats GREP, but I know in UNIX you can > make> grep do some amazing trick stuff.>> Let's all get our heads together and make a good snippet of code.>>>>>> ----- Original Message -----> From: WebCat @ Inkblot Media
> To: WebDNA Talk > Sent: Wednesday, May 21, 2003 7:53 AM> Subject: Re: Highlighting words found in a keyword search>>>> Here is how I did it. Not exactly the cleanest of code, but maybe you >> guys>> can better upon it.>>>> Go here: http://www.inkblotmedia.com/highlight/index.tpl>> Search for: Pukonen alcohol more>>>> All three words will highlight.>>>> this is the code for it:>>>> [math show=f]counter=0[/math]>> [listwords delimiters= ,.&words=[woGroup1data]]>> [text]word[index]=[word][/text]>> [math show=f]counter=[counter]+1[/math]>> [/listwords]>>>> [founditems]>>>>>> [loop start=1&end=[counter]]>>>> [hideif [new_desc]![raw][new_desc][/raw]]>> [text]new_desc=[grep>> search=[interpret][word[index]][/interpret]&replace=> style=background-color:>>> yellow>[interpret][word[index]][/interpret]][description][/ > grep][/te>> xt]>> [/hideif]>>>> [showif [new_desc]![raw][new_desc][/raw]]>> [text]new_desc=[grep>> search=[interpret][word[index]][/interpret]&replace=> style=background-color:>>> yellow>[interpret][word[index]][/interpret]][new_desc][/ > grep][/text]>> [/showif]>>>> [/loop]>>>> [new_desc]>> [/founditems]>>>>>> ----- Original Message ----->> From: Kenneth Grome >> To: WebDNA Talk >> Sent: Tuesday, May 20, 2003 11:27 PM>> Subject: Re: Highlighting words found in a keyword search>>>>>>>> Well, it's still not working 100%. The [notes] field is entered >>>> via a>>>>