Highlighted search results..
#11
It's okay, at least someone else is noticing this so it's not just meToungue.
#12
PHP Code:
        $find "#(^|>)([^<]*)(".preg_quote($word"#").")#i";
        
$replacement "$1$2<span class=\"highlight\">$3</span>"
Appears to be a number of problems with that actually, such as breaking HTML entities as well.

A cheap fix could be to make the spans not have a border, thus stacked spans don't appear to be stacked... Won't fix the issue with HTML entities however (write another replacement for that?).
#13
Bump...
#14
(02-20-2009, 10:23 AM)Tom Loveric Wrote:  Bump...

As a staff member, you should you already know how busy we are. Bumping will not accomplish anything and you should cease from doing that in the future.
#15
Suggested fix. Find in inc/functions.php:

PHP Code:
function build_highlight_array($terms)


add after

PHP Code:
global $mybb;

if(
$mybb->settings['minsearchword'] < 1)
{
    
$mybb->settings['minsearchword'] = 3;


Find in the same file:

PHP Code:
foreach($split_words as $word)
{
    if(!
$word)
    {
        continue;
    }
    
$words[] = trim($word);


replace with

PHP Code:
foreach($split_words as $word)
{
    if(!
$word || strlen($word) < $mybb->settings['minsearchword'])
    {
        continue;
    }
    
$words[] = trim($word);


because that is the minimum limit for a word when searching otherwise it just ignores the word. We should ignore it as well.

(more fix coming later)
#16
Corresponding Ticket: http://dev.mybboard.net/issues/411


Forum Jump:


Users browsing this thread: 1 Guest(s)