PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Bug Tracker

Reply
 
Thread Tools
Old 11-16-2003, 08:35 AM   #1
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
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.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 11-17-2003, 12:05 AM   #2
sid
Former Member
 
Join Date: Sep 2003
Posts: 34
so is this the cure for the 2 word highlight thing in exact words or something else?
sid is offline   Reply With Quote
Old 11-17-2003, 12:16 AM   #3
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
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.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
URL ? Bug Fix x0dus Mod Requests 2 08-20-2004 06:04 AM
PHP Version 4.1.2 & pdftotext m2ke External Binaries 1 08-18-2004 07:38 AM
Cleanup Engine Bug and Fix Charter Bug Tracker 0 03-08-2004 10:35 AM
Bug fix for pdftohtml alivin70 Mod Submissions 0 02-25-2004 07:19 AM
Version 1.8.0 and session IDs & links Charter Mod Submissions 0 01-21-2004 03:04 PM


All times are GMT -8. The time now is 08:17 AM.


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