hi folks!
umm, i added a search-function to my blog and now i want to highlight the search keywords - maybe with customized colors.
i found some discussion here about a "search highlight plugin" which maybe would be what i want - but i can't find this or something similar at the plugins-list o_0
so, is there something similar? or do i have to get this plugin elswhere?
any help welcome ( ),
cheers&beers!
edit: aaah, not to be missunderstood: i don't want to highlight the search-text entered at google or those websearches.
i do want to highlight the search text entered at my blog-search. is this possible?
"search highlight plugin" ...gone?
"search highlight plugin" ...gone?
the island of stupid - come to where the monkey is...
-
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
great concept it would be awesome if that could be added. I've asked in the past if we could change the search results so that instead of seeing the entry body we actually see a snippet of the entry around where the search term appears. Garvin mentioned that this would take a lot of system resources on the server and might not be a good idea, but your idea could work. We already place a <span> around the search term in the serendipity message that says how many searcfh results there are, so it might not be too difficult to do the same thing inside the entry. Maybe one of the developers could let us know how easy this would be.
If they can make it work, then we would just need to add some css styling to the search term so that it appears highlighted.
If they can make it work, then we would just need to add some css styling to the search term so that it appears highlighted.
so - this means there is no such function right now, right?
damn, i thought so
meanwhile i found this "search highlight plugin" - of course this plugin is still where it sould be. but it's not working for my purposes.
but maybe someone able to code stuff could use this highlight-plugin and check out how it works? and then use this function as a seperate plugin for the blog-intern search terms?
don't know how hard this is. just would be nice, i guess
i love your idea of having a span (maybe span&id, class or sth...) around the search terms. would be exactly what i thought about!
your mentioned snipped-function would be nice, also - but this sounds really a little more complicated. i guess a simple highlight would be easier. at least i hope so
---
edit: this forum is... strange. should i contact my isp or is really something wrong here? loading-times are horrible...
damn, i thought so
meanwhile i found this "search highlight plugin" - of course this plugin is still where it sould be. but it's not working for my purposes.
but maybe someone able to code stuff could use this highlight-plugin and check out how it works? and then use this function as a seperate plugin for the blog-intern search terms?
don't know how hard this is. just would be nice, i guess
i love your idea of having a span (maybe span&id, class or sth...) around the search terms. would be exactly what i thought about!
your mentioned snipped-function would be nice, also - but this sounds really a little more complicated. i guess a simple highlight would be easier. at least i hope so
---
edit: this forum is... strange. should i contact my isp or is really something wrong here? loading-times are horrible...
the island of stupid - come to where the monkey is...
My computer must have rebooted while I wrote my reply. I think this can be implemented with a change to serendipity_printEntries(). I'd just check if $serendipity['action'] == 'search', then explode($serendpity['GET']['searchterms'] on space, and do a str_replace() for each term to surround it with a span. I'd make the spans have two classes: foundterm and foundtermN, where N is the number of the term. That way we can highlight the first term in yellow, the second in blue, etc -- but still have a catch-all if the style doesn't cover all the search terms.
I just don't know when I'll get to it.
I just don't know when I'll get to it.
so, in memory of the origin posting - r.i.p.judebert wrote:My computer must have rebooted while I wrote my reply.
whatever you're talking about - does this mean it is possible without bigger problems? wel, we'll seejudebert wrote: I think this can be implemented with a change to serendipity_printEntries(). I'd just check if $serendipity['action'] == 'search', then explode($serendpity['GET']['searchterms'] on space, and do a str_replace()...
the island of stupid - come to where the monkey is...