--- swish.module	2005-10-06 11:14:03.014099632 -0400
+++ swish-ppt.module	2005-10-06 11:13:50.896941720 -0400
@@ -5,10 +5,10 @@
  * A simple Drupal Module that interfaces with a very powerful (IMHO) open source
  * search engine called SWISH-E.
  * The objective of this module is to allow users to search documents (.doc,
- * pdf, xls, rtf, txt) that were uploaded in the site.
+ * pdf, xls, ppt, rtf, txt) that were uploaded in the site.
  * SWISH-E indexes these files using third party filters like
- * catdoc (MS Word), xls2csv (MS Excel), pdftotext (PDF) and unrtf (RTF)
- *
+ * catdoc (MS Word), xls2csv (MS Excel), ppthtml (MS PowerPoint), pdftotext (PDF) and unrtf (RTF)
+ * Please make sure these are installed on your server prior to installing swish.module.
  */
 
 /**
@@ -77,6 +77,9 @@ function swish_settings(){
   $output .= form_textfield(t('RTF Filter Path'), 'unrtf_path',
     variable_get('unrtf_path', '/usr/bin/unrtf'), 20,40,
 	t('The absolute path of the Rich Text Format filter.'));   
+  $output .= form_textfield(t('M$ PPT Filter Path'), 'ppthtml_path',
+    variable_get('ppthtml_path', '/usr/local/bin/ppthtml'), 20,40,
+        t('The absolute path of the M$ PowerPoint filter'));
   return $output;
 }
 
@@ -93,7 +96,7 @@ function swish_index() {
 	if ($op) {
 	  $result = _swish_do_index();		      	
 	  if (substr($result[0], 0, 5) == 'err: ' ){
-	    drupal_set_message('Indexing abroted. '.$result[0], 'error');	    
+	    drupal_set_message('Indexing aborted. '.$result[0], 'error');	    
 	  }
 	  else {
 	    $length = count($result);
@@ -154,10 +157,11 @@ function swish_search ($op = 'search',  
 	    $basename = basename(substr($result, $k+1, $i-$k-1));
 	    $l = strlen($basename);
 	    $filetype = substr($basename, $l-3, 3 );
-	    $title = substr($result, $i + 2, $j -$i -2 );
-	    $file_size = substr($result, $j+2);	
+	    #$title = substr($result, $i + 2, $j -$i -2 );
+	    $title = $basename;
+		$file_size = substr($result, $j+2);	
 		$extra = array(
-	      'rank' 		=> $rank, 		  		 
+	      'rank' 	  => $rank,
 		  'file_size' => $file_size,
 		  'file_type' => $filetype );
 		$link = file_create_url ("files/".$basename);
@@ -221,7 +225,7 @@ function _swish_do_index(){
   // And don't index php modules inc, etc. could be put in the settings in the future.
   fwrite($handle, "FileRules filename contains .php .inc .module .sql  index.\n");
   //based on the admin settings of swish, include and index the ff document types.
-  //the filter programs option for now are for catdoc, xls2csv, pdftotext, unrtf
+  //the filter programs option for now are for catdoc, xls2csv, pdftotext, unrtf, ppt
   $indexonly = 'IndexOnly .txt';
   $filefilter = "\n";
   if (($filter   = variable_get('catdoc_path', '/usr/local/bin/catdoc')) ){
@@ -241,6 +245,10 @@ function _swish_do_index(){
 	$indexonly  .= ' .rtf';
 	$filefilter .= 'FileFilter .rtf         '.$filter.' "--html \'%p\'"'. "\n";
   }
+  if ( ($filter  = variable_get("ppthtml_path","/usr/local/bin/ppthtml")) ) {
+         $indexonly  .= ' .ppt';
+	 $filefilter .= 'FileFilter .ppt         '.$filter.' "\'%p\'"'. "\n";
+  }
   $indexonly .= "\n";
   $filefilter .= "\n";
   fwrite ($handle, $indexonly.$filefilter);	
@@ -270,7 +278,8 @@ function swish_validate_paths(){
 	'catdoc_path'		=> 'catdoc, M$ Word filter',
 	'xls2csv_path'		=> 'xls2csv, M$ Excel filter',
 	'pdftotext_path'	=> 'pdftotext, PDF filter',
-	'unrtf_path'		=> 'unrtf, RTF filter'
+	'unrtf_path'		=> 'unrtf, RTF filter',
+	'ppthtml_path'		=> 'ppthtml, M$ PowerPoint filter'
     );
   $drupal_files_folder = array(
     'file_directory_path' => 'Files ',
