PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Bug Tracker (http://www.phpdig.net/forum/forumdisplay.php?f=27)
-   -   Version 1.6.3 Highlight Bug & Fix (http://www.phpdig.net/forum/showthread.php?t=218)

Charter 11-16-2003 08:35 AM

Version 1.6.3 Highlight Bug & Fix
 
Hi. The version 1.6.3 highlight fix to fix the version 1.6.2 highlight problem with exact words has a bug.

The bug is that with version 1.6.3, if you search on say 'php' using words begin or any words part, you will see something like 'blah blah phpdigHighlight">php' in the search results.

To fix this in version 1.6.3 do the following.
  1. In robot_functions.php find:
    PHP Code:

    //replace any group of blank characters by an unique space
    $text ereg_replace("[[:blank:]]+"," ",eregi_replace("<[^>]*>","",$text)); 

    and right after add:
    PHP Code:

    //strip characters used in highlighting
    $text str_replace("^#_","",str_replace("_#^","",$text)); 

  2. In phpdig_functions.php replace the phpdigHighlight function with the following:
    PHP Code:

    function phpdigHighlight($ereg='',$string='')
    {
    if (
    $ereg) {
    //    return @eregi_replace($ereg,"\\\\1<span class=\"phpdigHighlight\">\\\\2</span>\\\\3",$string);
        
    $string = @eregi_replace($ereg,"\\\\1<^#_>\\\\2</_#^>\\\\3",@eregi_replace($ereg,"\\\\1<^#_>\\\\2</_#^>\\\\3",$string));
        
    $string str_replace("^#_","span class=\"phpdigHighlight\"",str_replace("_#^","span",$string));
        return 
    $string;
    }
    else {
        return 
    $result;
    }


  3. In search_function.php there are four places where the following occurs:
    PHP Code:

    phpdigHighlight($reg_strings,phpdigHighlight($reg_strings

    In these four places, remove the following from each line:
    PHP Code:

    // the first instance of phpdigHighlight($reg_strings,
    // and also one ending ) to match parentheses 

Remember to remove any "word" wrapping in the above code.

EDIT: PhpDig version 1.6.4 includes this fix. See the Changelog for more details.

sid 11-17-2003 12:05 AM

so is this the cure for the 2 word highlight thing in exact words or something else?

Charter 11-17-2003 12:16 AM

Hi. This is the fix to the fix for the word highlighting in exact word searches. I'd recommend just installing version 1.6.4. ;)


All times are GMT -8. The time now is 10:27 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.