MyBB Community Forums

Full Version: Search Highlight Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been working on this one for quite a while, mainly because I don't get that much time to make plugins for MyBB anymore Sad

Anyway, first off I would like to thank the following people:
Christian - For helping solve initial "teething" problems.
Zaher1988 - For spending well over an hour in msn with me, trying to work out why a simple template change wasn't working...Toungue
MiNT - For constant verbal abuse...I mean support...heh heh heh...

Search Highlight

This plugin is something I've always wanted in MyBB since I converted from phpBB, and finally I have got around to making it.

Essentially it highlights your search terms, both in the post search results, and in the posts themselves so that you can easily scroll down the page and spot what you are looking for without having to read every single post or use a browser search function.

Installation

Simply download the attached file (highlight.php), upload to your plugins folder, and activate.

How to use...

You can use this plugin in two ways:

1) Do a regular search and click a result link to see that thread with your highlighted search terms.

2) Whilst in a thread, add "&highlight={Search Terms}" to the end of the url, where the {Search Terms} are the words you want to highlight.

You can separate terms using a "+":
showthread.php?tid=1&highlight=hello+goodbye

or a space:
showthread.php?tid=1&highlight=hello goodbye

If you can't be bothered to type "&highlight=" every time, you can use the shorthand version: "&hl="

It should be noted that if the showthread url is like this: showthread.php?tid=1&pid=1#pid1, the &hl={Search Terms} MUST go before the "#" like so:

showthread.php?tid=1&pid=1&hl=Hello Goodbye#pid1

Screenshots

[attachment=5536][attachment=5535][attachment=5537]

Known Issues
-Links to "next page" on search results and threads do not include the highlight code. I am working on fixing this!

Live Example
My forums (http://www.drpoodle.com/forums) have this plugin installed, so feel free to try it out there.

Enjoy!
-DrPoodle
Cool! Can't wait to try this one out! Smile

Works good! Thanks, Dr. Poodle!
glad to see you finaly got it going properly, well done.

EDIT:
Quoting from the IRC channel
Quote:<MiNT> couldnt you have done <span style="highlight"> then added a highlight class in the style sheet?
<MiNT> instead of <strong style="background-color: yellow;">
<DrPoodle> yeah
<DrPoodle> but this is version 1.0
<DrPoodle> suggest it for the new version
<MiNT> consider it formally suggested
<DrPoodle> i've gotta find a way of getting the highlight code to appear in the "next" links
<DrPoodle> suggest it in the topic
I'm happy to see this.

Quoting from IRC channel:
Quote:(rh1n0) That's cool, I was just talking to my brother about that a few days ago. (MyBB lacking it)

I currently have no board to test it on though. Big Grin
This is a really nice little plugin for MyBB and congratulations DrPoodle for making it. I'll install it on my forum when I get the chance Smile.
Oh finaly Toungue LOL.. but hay i fixed the initial part in seconds Angel Rolleyes
zaher1988 Wrote:Oh finaly Toungue LOL.. but hay i fixed the initial part in seconds Angel Rolleyes
Yeah...we took a little longer on the second bit Toungue
Thanks
It works perfect. Thanks for sharing with us DrPoodle Smile
thanks