![]() |
word snippet truncation fix
I didn't like the way phpdig truncates words in the search snippets, so I removed the begin/end words (which are possible truncated)
here is the patch: diff search_function.php.bak search_function.php 555c555,562 < $extract .= ' ...'.phpdigHighlight($reg_strings,$extract_content).'... '; --- > // remove first (possibly truncated) word > if(($first_space = strpos($extract_content, ' ')) !== false) > $extract_content = substr($extract_content, $first_space + 1); > // remove last (possibly truncated) word > if(($last_space = strrpos($extract_content, ' ')) !== false) > $extract_content = substr($extract_content, 0, $last_space); > > $extract .= ' ... '.phpdigHighlight($reg_strings,$extract_content).' ... '; |
All times are GMT -8. The time now is 06:31 PM. |
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.