very nice informations, thx all
here is a full example for integration, i hope its helpfull.
A test u can see here: [
www.darm-inform.de]
your index.php must contains:
switch($nav)
{
case "suchen":
include("search/mysearch.php"

; break;
}
your website template (not that from sphider):
<form action="search/mysearch_modrewrite.php" method="get" id="suchen" enctype="multipart/form-data">
<div style="text-align: center;">
<input name="query" type="text" size="9" id="query" value="" />
<input name="" type="submit" value="go" />
</div>
<input type="hidden" name="nav" value="suchen" />
<input type="hidden" name="search" value="1" />
<input type="hidden" name="start" value="1" />
<input type="hidden" name="resultsperpage" value="1" />
</form>
mysearch_modrewrite.php (form action from your website template):
<?php
print '<meta http-equiv="refresh" content="0; url=/suche/' . $_GET[query] . '-' . $_GET[start] . '-1-' . $_GET[resultsperpage] . '-and.html" />';
exit;
?>
your htaccess file:
RewriteEngine on
Options +FollowSymlinks
Options -MultiViews
RewriteBase /
RewriteRule ^suche/([^/]+)-([0-9]+)\.html$ /index.php?nav=suchen&query=$1&search=$2 [QSA,L]
RewriteRule ^suche/([^/]+)-([0-9]+)-([0-9]+)-([0-9]+)-([^/]+)\.html$ /index.php?nav=suchen&query=$1&start=$2&search=$3&results=$4&type=$5 [QSA,L]
mysearch.php (its a copy from search.php without layout):
<?php
/*******************************************
* Sphider Version 1.3.x
* This program is licensed under the GNU GPL.
* By Ando Saabas ando(a t)cs.ioc.ee
********************************************/
//error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
error_reporting(E_ALL);
$include_dir = "include";
include ("$include_dir/commonfuncs.php"

;
//extract(getHttpVars());
if (isset($_GET['query']))
$query = $_GET['query'];
if (isset($_GET['search']))
$search = $_GET['search'];
if (isset($_GET['domain']))
$domain = $_GET['domain'];
if (isset($_GET['type']))
$type = $_GET['type'];
if (isset($_GET['catid']))
$catid = $_GET['catid'];
if (isset($_GET['category']))
$category = $_GET['category'];
if (isset($_GET['results']))
$results = $_GET['results'];
if (isset($_GET['start']))
$start = $_GET['start'];
if (isset($_GET['adv']))
$adv = $_GET['adv'];
$include_dir = "include";
$template_dir = "templates";
$settings_dir = "settings";
$language_dir = "languages";
require_once("$settings_dir/database.php"

;
require_once("$language_dir/en-language.php"

;
require_once("$include_dir/searchfuncs.php"

;
require_once("$include_dir/categoryfuncs.php"

;
include "$settings_dir/conf.php";
//include "$template_dir/$template/header.html";
include "$language_dir/$language-language.php";
if ($type != "or" && $type != "and" && $type != "phrase"

{
$type = "and";
}
if (preg_match("/[^a-z0-9-.]+/", $domain)) {
$domain="";
}
if ($results != ""

{
$results_per_page = $results;
}
if (get_magic_quotes_gpc()==1) {
$query = stripslashes($query);
}
if (!is_numeric($catid)) {
$catid = "";
}
if (!is_numeric($category)) {
$category = "";
}
if ($catid && is_numeric($catid)) {
$tpl_['category'] = sql_fetch_all('SELECT category FROM '.$mysql_table_prefix.'categories WHERE category_id='.(int)$_REQUEST['catid']);
}
$count_level0 = sql_fetch_all('SELECT count(*) FROM '.$mysql_table_prefix.'categories WHERE parent_num=0');
$has_categories = 0;
if ($count_level0) {
$has_categories = $count_level0[0][0];
}
//require_once("$template_dir/$template/search_form.html"

;
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function poweredby () {
global $sph_messages;
//If you want to remove this, please donate to the project at [
www.sphider.eu]
print $sph_messages['Powered by'];?> <a href="[
www.sphider.eu] src="search/sphider-logo.png" border="0" style="vertical-align: middle" alt="Sphider"></a>
<?php
}
function saveToLog ($query, $elapsed, $results) {
global $mysql_table_prefix;
if ($results ==""

{
$results = 0;
}
$query = "insert into ".$mysql_table_prefix."query_log (query, time, elapsed, results) values ('$query', now(), '$elapsed', '$results')";
mysql_query($query);
echo mysql_error();
}
switch ($search) {
case 1:
if (!isset($results)) {
$results = "";
}
$search_results = get_search_results($query, $start, $category, $type, $results, $domain);
require("$template_dir/$template/search_results.html"

;
break;
default:
if ($show_categories) {
if ($_REQUEST['catid'] && is_numeric($catid)) {
$cat_info = get_category_info($catid);
} else {
$cat_info = get_categories_view();
}
require("$template_dir/$template/categories.html"

;
}
break;
}
//include "$template_dir/$template/footer.html";
?>
search_results.html (template from sphider):
<br/>
<?php
extract($search_results);
?>
<?php if ($search_results['did_you_mean']){?>
<div id="did_you_mean">
<?php echo $sph_messages['DidYouMean'];?>: <a href="<?php print 'index.php?nav=suchen&query='.quote_replace(addmarks($search_results['did_you_mean'])).'&search=1'?>"><?php print $search_results['did_you_mean_b']; ?></a>?
<br>
</div>
<?php }?>
<?php if ($search_results['ignore_words']){?>
<div id="common_report">
<?php while ($thisword=each($ignore_words)) {
$ignored .= " ".$thisword[1];
}
$msg = str_replace ('%ignored_words', $ignored, $sph_messages["ignoredWords"]);
echo $msg; ?>
<br>
</div>
<?php }?>
<?php if ($search_results['total_results']==0){?>
<div id ="result_report">
<?php
$msg = str_replace ('%query', $ent_query, $sph_messages["noMatch"]);
echo $msg;
?>
<br>
</div>
<?php }?>
<?php if ($total_results != 0 && $from <= $to){?>
<div id ="result_report">
<?php
$result = $sph_messages['Results'];
$result = str_replace ('%from', $from, $result);
$result = str_replace ('%to', $to, $result);
$result = str_replace ('%all', $total_results, $result);
$matchword = $sph_messages["matches"];
if ($total_results== 1) {
$matchword= $sph_messages["match"];
} else {
$matchword= $sph_messages["matches"];
}
$result = str_replace ('%matchword', $matchword, $result);
$result = str_replace ('%secs', $time, $result);
echo $result;
?>
</div>
<?php }?>
<br>
<?php if (isset($qry_results)) {
?>
<div id="results">
<!-- results listing -->
<?php foreach ($qry_results as $_key => $_row){
$last_domain = $domain_name;
extract($_row);
if ($show_query_scores == 0) {
$weight = '';
} else {
$weight = "[$weight%]";
}
?>
<?php if ($domain_name==$last_domain && $merge_site_results == 1 && $domain == ""

{?>
<div class="idented">
<?php }?>
<b><?php print $num?>.</b> <?php print $weight?>
<a href="<?php print $url?>" class="title"> <?php print ($title?$title:$sph_messages['Untitled'])?></a><br/>
<div class="description"><?php print $fulltxt?></div>
<div class="url"><?php print $url2?> - <?php print $page_size?></div>
<?php if ($domain_name==$last_domain && $merge_site_results == 1 && $domain == ""

{?>
[ <a href="<?php print 'index.php?nav=suchen&query='.quote_replace(addmarks($query)).'&search=1&results='.$results_per_page.'&domain='.$domain_name?>">More results from <?php print $domain_name?></a> ]
</div class="idented">
<?php }?>
<br/>
<?php }?>
</div>
<?php }?>
<!-- links to other result pages-->
<?php if (isset($other_pages)) {
if ($adv==1) {
$adv_qry = "&adv=1";
}
if ($type != ""

{
$type_qry = "&type=$type";
}
?>
<div id="other_pages">
<?php print $sph_messages["Result page"]?>:
<?php if ($start >1){?>
<a href="<?php print '/suche/'.quote_replace(addmarks($query)).'-'.$prev.'-1-'.'10'.'-'.'and'.'.html'?>"><?php print $sph_messages['Previous']?></a>
<?php }?>
<?php foreach ($other_pages as $page_num) {
if ($page_num !=$start){?>
<a href="<?php print '/suche/'.quote_replace(addmarks($query)).'-'.$page_num.'-'.'1'.'-'.'10'.'-'.'and'.'.html'?>"><?php print $page_num?></a>
<?php } else {?>
<b><?php print $page_num?></b>
<?php }?>
<?php }?>
<?php if ($next <= $pages){?>
<a href="<?php print '/suche/'.quote_replace(addmarks($query)).'-'.$next.'-1-10-and.html'?>"><?php print $sph_messages['Next']?></a>
<?php }?>
</div>
<?php }?>
<div class="divline">
</div>
<div id="powered_by">
<!--If you want to remove this, please donate to the project at [
www.sphider.eu];
<br><center><?php poweredby()?></center>
</div>
Edited 2 time(s). Last edit at 08/14/2008 04:35PM by teh_fr33z3r.