[geeklog-cvs] geeklog-1.3/public_html article.php,1.29,1.30

tony at geeklog.net tony at geeklog.net
Thu Jan 16 17:52:42 EST 2003


Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory internal.geeklog.net:/tmp/cvs-serv22797

Modified Files:
	article.php 
Log Message:
Added search highlighting

Index: article.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/article.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** article.php	15 Nov 2002 15:50:15 -0000	1.29
--- article.php	16 Jan 2003 22:52:40 -0000	1.30
***************
*** 131,134 ****
--- 131,146 ----
          $A = DB_fetchArray($result);
  
+ 		if($query)
+ 		{
+ 			$mywords = explode(" ",$query);
+             foreach ($mywords as $searchword)
+             {
+                     $A['introtext'] = preg_replace ("/($searchword)/i", "<span class=highlight>\\1</span>", $A['introtext']);
+                     $A['bodytext'] = preg_replace ("/($searchword)/i", "<span class=highlight>\\1</span>", $A['bodytext']);
+             }
+ 
+ 		}
+ 
+ 
          // Display whats related any polls configured for this page
  
***************
*** 188,190 ****
  echo $display;
  
! ?>
--- 200,202 ----
  echo $display;
  
! ?>
\ No newline at end of file





More information about the geeklog-cvs mailing list