--- swish-4.6.0/swish.module 2005-05-19 11:54:33.000000000 +0200 +++ swish.module 2005-11-21 11:53:28.670318776 +0100 @@ -122,6 +122,7 @@ case 'search' : $find = array(); + $index_dir = getcwd().'/'.variable_get('file_directory_path', 'files'); $swish_bin = variable_get('swish_path', '/usr/local/bin/swish-e'); - $swish_index = getcwd().'/files/my_swish_index'; + $swish_index = $index_dir.'/my_swish_index'; //check if swish-e binary is executable and index file is readable. //if not, put an entry in the watchdog and just exit quitely. @@ -134,5 +135,5 @@ $words = '"'.chop(str_replace('\(', '(', str_replace('\)', ')', str_replace('\*','*', escapeshellcmd($keys).' ')))).'"'; - $swish_command = variable_get("swish_path","/usr/local/bin/swish-e") . escapeshellcmd(" -m 50 -f ". getcwd() . "/files/my_swish_index -w ").$words; + $swish_command = $swish_bin . escapeshellcmd(" -m 50 -f ".$swish_index." -w ").$words; exec ($swish_command, $results, $return_val); foreach ($results as $result){ @@ -161,5 +162,5 @@ 'file_size' => $file_size, 'file_type' => $filetype ); - $link = file_create_url ("files/".$basename); + $link = file_create_url (variable_get('file_directory_path', 'files').'/'.$basename); $find[] = array('link' => $link, 'title' => $title, 'extra' => $extra); }