View Single Post
Old 09-08-2004, 01:03 AM   #15
OceanSurf
Green Mole
 
Join Date: Sep 2004
Posts: 7
I used Charters code posted 03-26-2004 06:16 AM
this is how I made my highlighting. not perfectet it thou.

Add this function to your custom_search_page.php
PHP Code:
function color_result($text) {
    
// explode the keywords
    
$keywords explode(" "$_REQUEST['query_string']);
    
// now color the words 
    
foreach ($keywords as $replace)
        {
         
$text str_replace($replace"<font color=\"#FF0000\"><b>".$replace."</b></font>"$text);
        }
    return 
$text;    

and at the bottom when printing the result use it like this:
PHP Code:
echo color_result($output2['text']); 
i tried it a couple of times and it worked just fine (for now ).
OceanSurf is offline   Reply With Quote