Search Hi-Lite Plugin

19th Jan 2006 stk


Comment from: Danny
Any chance this plugin could include comment searching? A lot of people have asked for that.
02/04/06 @ 16:51
Comment from: stk
And retain highlighting for multiple pages? (Hey ... why not ask?)
02/05/06 @ 02:47
Comment from: stk
Note to self ... just noticed returns for the all_blog in the [css] [/css] section ... I remember that we were going to find (had?) a user-defined array where we could strip tags (and everything in between) to keep OUT of the search text??

JUst need to figure out where and HOW.

PS ... I added "special" blog to Randsco. (With a little help from my friends).

Steps (for an aging mind) ...

1) Make blog ... stub file about.php
2) For search to span ALL blogs ... add to search form
3) Make sure ALL blog has right skin :|
4) search returns now span more than one skin
5) set up skin for this new blog (title and such)
6) KEY (for me anyway) ... did not WANT sidebar elements to CHANGE (archives/categories always the same ... i.e., main blog)
7) use dirty little trick from multiblogs.php (to set $blog to be one I want ... right before archives ... and reset after categories.
8) Works ... BUT ... the links are a tad rough ... cats go to:

(instead of)

... same with archives ...
9) AND the "All Entries" (the all option in cats) ... goes to the (which is totally wrong and had to hard-code the cats_plugin file.

Wonder if there is a better way to get the all out of the links after a search throws one into the all blog?
03/02/06 @ 23:20
Comment from: MrDav
I was going to ask for comment searching too, but Danny beat me.
09/23/06 @ 19:57
I tried setting this on b2evo 1.8.5 but it didn't work for me. Have the instructions been updated for 1.8.5?


01/01/07 @ 22:15
I'm afraid we haven't got round to converting this to 1.8.6 yet.

As an aside you should upgrade to 1.8.6, see this security alert

01/02/07 @ 11:11
Comment from: Michael Watson
Has anyone been able to successfully install this plugin in b24evolution 1.9.2 as yet? I am able to run the install script without problems, but when I try to make the necessary changes to ../skins/custom/_main.php, it causes my blog to break, displaying only a blank page. I've looked pretty carefully to be sure I'm putting the changes in the right place, paying careful attention to closing braces & such. I'm wondering whether there's been a change in 1.9.2 that just makes it incompatible with am search hi-lite. By remming out various lines, I found that the problem seems to involve a line in the 2nd code block:

$am_search = $Plugins->get_by_name( 'am_search_plugin' );

01/31/07 @ 17:37
You might like to test out the beta 1.9.2 version which you can find here

You'll need to undo all the skin changes you made for this version as the new version doesn't require them ;)

If you find any problems with it then please leave a comment on that thread

02/01/07 @ 08:11
Comment from: Michael Watson
Thanks for the suggestion. I was able to install the beta 1.9.2 version without difficulty. I've managed to get it working after a fashion, but I think I'm missing an important detail on installation.

I restored the original _main.php before installing the plugin. After I installed the plugin, my blog displayed properly, and the search function did work, but search results still weren't highlighted.

I looked at the html source and noted that search words were enclosed in SPAN tags with class search_hit0, so I thought I'd missed instructions somewhere to modify the skin's stylesheet. I manually added a class of .search_hit0 with a background-color attribute to my skin's stylesheet. This did indeed make the search results highlight properly. But I'm not sure what other classes I might need to add. On examining _am_search.plugin.php, it looks like search results are tagged search_hit0, search_hit1, search_hit2 based on incrementing values of a variable etc. But I'm not sure how high the values of that variable might go, so I'm not sure what classes I need to create and assign a background-color attribute.

Did I miss documentation somewhere concerning required edits to the stylesheet?

Many thanks for your help on this, it's looking very promising!
02/01/07 @ 17:56
Hi Michael,
The most important thing you missed about the instructions is that they were written by an absent minded blonde :P

As you found out the plugin wraps the search terms in a span with a classname of search_hit# where # is a pointer for the keyword found ( 2 keywords == search_hit0 && search_hit1 ), so you need to add classes to your style sheet to cover what you think will be the maximum number of keywords that somebody might search for ( *note to self* add some sort of cap and re-use the classes for > ## keywords).

I'll upgrade the plugin to include some default styles so that it works straight out of the box, I warn you though I tend to pick gaudy colours ;)


The plugin has been upgraded (and the zip file on the original link has been updated). The keyword classes have been limited to 0 -> 6 ( after that they're re-used ).

Let me know if you have any further problems with it.
02/02/07 @ 08:04
Comment from: sam2kb

Download link is dead. ;)
02/11/08 @ 06:46
Ahh bugger, yet another broken link :-S

It's a good job really because we've done a complete recode for the 2.x series and need to update this post badly. I should get round to it in the next couple of days and I'll also add it to B.O.P.I.T so you'll know when it's updated ;)

02/11/08 @ 13:31

Comments are closed for this post.