/* terraserver.de/search-0.2-11.04.2002 - http://www.terraserver.de/ Copyright (C) 2002 Holger Eichert, mailto:h.eichert@gmx.de. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License http://www.gnu.org/copyleft/gpl.html for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. About: Some people say php is not the language to do a fulltextsearch and they are right ;-) but anyway: terraserver.de/search performs a realtime fulltext-search over spezified directorys including subdirectorys and returns a link and an extract of each file. htmlspecialchars are supported so a search for "über" will return documents having "über" as well as documents having "über". Changes: - Added some more features like 'match case' and the possibility to limit the number of results. Configure: Comment/Uncomment your language configuration and if necessary edit the settings. Have fun... */ ini_set('max_input_time','90'); ini_set('max_execution_time','90'); // English Configuration $my_server = "http://".getenv("SERVER_NAME").":".getenv("SERVER_PORT"); // Your Server (generally no changes needed) $my_root = getenv("DOCUMENT_ROOT"); // Your document root (generally no changes needed) $s_dirs = array(""); // Which directories should be searched ("/dir1","/dir2","/dir1/subdir2","/Verzeichniss2/Unterverzeichniss2")? --> $s_dirs = array(""); searches the entire server $s_skip = array("/aspnet_client","/blog","/Cal","/CGI-BIN","/CSS","/email","/Files","/flash","/images","/lightbox","/PDFs","/Scripts","/SpryAssets","/thumbs"); // Which files/dirs do you like to skip? $s_files = "htm|php"; // Which files types should be searched? Example: "html$|htm$|php4$" $min_chars = "3"; // Min. chars that must be entered to perform the search $max_chars = "30"; // Max. chars that can be submited to perform the search $default_val = ""; // Default value in searchfield $limit_hits = array("20","30","50","100"); // How many hits should be displayed, to suppress the select-menu simply use one value in the array --> array("100") $message_1 = "Invalid Searchterm!"; // Invalid searchterm $message_2 = "Please enter at least $min_chars characters."; // Invalid searchterm long ($min_chars/$max_chars) $message_3 = "Your search result(s) for:"; // Headline searchresults $message_4 = "Sorry, no hits."; // No hits $message_5 = "results"; // Hits // $message_6 = "Match case"; // Match case $message_7 = "End of search"; $no_title = "Carolina Woman"; // This should be displayed if no title or empty title is found in file $limit_extracts_extracts = ""; // How many extratcts per file do you like to display. Default: "" --> every extract, alternative: 'integer' e.g. "3" $byte_size = "20000"; // How many bytes per file should be searched? Reduce to increase speed //ini_set("error_reporting", "2047"); // Debugger // search_form(): Gibt das Suchformular aus function search_form($_GET, $limit_hits, $default_val, $message_5, $PHP_SELF) { @$keyword=$_GET['keyword']; @$case=$_GET['case']; @$limit=$_GET['limit']; echo "