View Single Post
Old 02-03-2005, 12:13 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
This is an improvement to PhpDig v.1.8.8 RC1 for locating and highlighting search terms contained in table content.

In search_functions.php, find the phpdigGetExtracts function.

In this function find:
Code:
$where_to_start = mb_strlen($extract_content);
And replace with:
Code:
$max_off = (int) min(mb_strlen($query_string)+1,floor(0.80*mb_strlen($extract_content)));
$where_to_start = mb_strlen($extract_content) - $max_off;
Also, in this function find:
Code:
$first_bold_spot = max($first_bold_spot - round((SNIPPET_DISPLAY_LENGTH / 2),0), 0);
And replace with:
Code:
$first_bold_spot = (int) max($first_bold_spot - round((SNIPPET_DISPLAY_LENGTH / 2),0), 0);
If you downloaded PhpDig v.1.8.8 RC1 after the date of this post, the changes are already included in the package.
__________________
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