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.