Code: Select all
//
// Was a highlight request part of the URI? Yes, this idea was
// taken from vB but we did already have a highlighter in place
// in search itself ... it's just been extended a bit!
//
if ( isset($HTTP_GET_VARS['highlight']) )
{
$highlight_match = array();
//
// Split words and phrases
//
$words = explode(' ', trim($HTTP_GET_VARS['highlight']));
for($i = 0; $i < count($words); $i++)
{
if ( trim($words[$i]) != '' )
{
$highlight_match[] = '#\b(' . str_replace("*", "([\w]+)?", $words[$i]) . ')\b#is';
}
}
$highlight_active = ( count($highlight_match) ) ? true : false;
}
else
{
$highlight_active = false;
}