|
From: Paul S. O. <ps...@us...> - 2002-02-08 20:50:23
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv4108
Modified Files:
viewtopic.php
Log Message:
Okay, let's give this highlighting preg_ a shot ...
Index: viewtopic.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewtopic.php,v
retrieving revision 1.171
retrieving revision 1.172
diff -C2 -r1.171 -r1.172
*** viewtopic.php 3 Feb 2002 18:34:36 -0000 1.171
--- viewtopic.php 8 Feb 2002 20:50:18 -0000 1.172
***************
*** 459,464 ****
if( trim($words[$i]) != "" )
{
! $highlight_match[] = "#\b(" . str_replace("\*", ".*?", phpbb_preg_quote($words[$i], "#")) . ")(?!.*?<\/a>)(?!.*?\[/url\])(?!.*?<\/span>)\b#i";
! $highlight_replace[] = '<span style="color:#' . $theme['fontcolor3'] . '"><b>\\1</b></span>';
}
}
--- 459,464 ----
if( trim($words[$i]) != "" )
{
! $highlight_match[] = "#\b(" . str_replace("\*", ".*?", $words[$i]) . ")(?!(.*?".">.*?<)|(.*?\">))\b#i";
! $highlight_replace[] = '<span style="color:#' . $theme['fontcolor3'] . '"><b>\1</b></span>';
}
}
***************
*** 1000,1012 ****
//
- // Highlight active words (primarily for search)
- //
- if( $highlight_active )
- {
- $message = preg_replace($highlight_match, $highlight_replace, $message);
- }
-
-
- //
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
--- 1000,1003 ----
***************
*** 1046,1049 ****
--- 1037,1048 ----
}
$message = make_clickable($message);
+
+ //
+ // Highlight active words (primarily for search)
+ //
+ if( $highlight_active )
+ {
+ $message = preg_replace($highlight_match, $highlight_replace, $message);
+ }
//
|