|
05-05-2005, 02:17 PM | #1 |
Green Mole
Join Date: May 2005
Posts: 1
|
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).' ... '; |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
phpdigSessionRemove() fix | zas | Mod Submissions | 0 | 05-14-2007 06:09 AM |
Indexing "<word>-<word>"? | FaberFedor | How-to Forum | 23 | 02-28-2005 03:35 AM |
links found : 0 -- Fix! | David_Hogan | Troubleshooting | 0 | 05-06-2004 06:00 AM |
Exclude meta tags from text snippet | guillemc | How-to Forum | 2 | 05-02-2004 11:14 PM |