Ich hab jetzt hier im Forum zich Versionen und abänderungen von VOlltextsuchen gefunden.
Welches ist jetzt die aktuelleste funktionierende Version die in 2 Containern (Suchfeld , Suchergebnisse) funktioniert ?
wiedereinmal supervielen dank
Suche Aktuelle Version von Fulltextsuche
hab hier was laufen, aber die ersten 100 zeichen sollen normal mit ausgegeben werden, es kommt aber nichts an
Code: Alles auswählen
<?php
echo "<table border=0 cellpadding=0 cellspacing=0 width=\"100%\"><tr>";
if($suche){
$suche = trim($suche);
$suchregexp = "(".str_replace(" ",")|(",$suche).")";
$s=ereg_replace("ü", "%FC",strtolower($suche));
$s=ereg_replace("ä", "%E4",$s);
$s=ereg_replace("ö", "%F6",$s);
$suchregexp .= "|$s";
$suchliste = explode(" ",strtolower($suche));
$sql = "SELECT
a.title AS title, a.idart AS idart, a.summary AS comment, a.idartlang AS idartlang,
b.idcat AS idcat,
c.parentid AS parentid,
d.value AS content
FROM
".$cfg["tab"]["art_lang"]." AS a,
".$cfg["tab"]["cat_art"]." AS b,
".$cfg["tab"]["cat"]." AS c,
".$cfg["tab"]["content"]." AS d
WHERE
a.idart = b.idart AND
a.idartlang = d.idartlang AND
b.idcat = c.idcat AND
c.idclient = '$client' AND
idlang = '$lang' AND
online='1' AND
(d.value REGEXP '$suchregexp' OR a.title REGEXP '$suchregexp' OR a.summary REGEXP '$suchregexp')";
$db->query($sql);
if ($db->num_rows() != 0){
for ($i=0; $i<$db->num_rows(); $i++) {
$db->next_record();
if ($auth->auth["uid"] == "nobody"){
$sql2 = "SELECT public FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='".$db->f("idcat")."'";
$db2 = new DB_Contenido; $db2->query($sql2); $db2->next_record();
if($db2->f("public") == 0) continue;
};
$num = 0 + $db->f("idartlang");
$results[$num][link] = "front_content.php?client=$client&lang=$lang&parent=".$db->f("parentid")."&idcat=".$db->f("idcat")."&idart=".$db->f("idart")."";
$results[$num][title] = $db->f("title");
switch ("CMS_VALUE[2]") {
case 0: $results[$num][text] = "";break;
case 1: $results[$num][text] = $db->f("comment");break;
case 2: $results[$num][text] .= substr(strip_tags(rawurldecode($db->f("content"))),0,100)."...";
};
for($x=0;$x<count($suchliste);$x++){
$hits[$num] += substr_count(strtolower($db->f("title")), $suchliste[$x]) +
substr_count(strtolower($db->f("comment")), $suchliste[$x]) +
substr_count(strtolower($db->f("content")), $suchliste[$x]);
};
};
if(count($hits) > 0){
$hits = array_values($hits);
$results = array_values($results);
array_multisort ($results, SORT_DESC, SORT_NUMERIC, $hits, SORT_DESC, SORT_NUMERIC);
echo '<tr><td colspan="2"><p>Folgende Seiten zu Ihrer Anfrage <strong>\''.$s.'\'</strong> können wir Ihnen anbieten:</p><br></td></tr>';
for ($i=0; $i<count($hits); $i++){
//echo "<tr><td align=\"left\"><a href=\"".$results[$i][link]."\"";
echo '<tr><td align="left">';
echo'<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="12">
<p><img src="images/auflistungszeichen2.gif" width="12" height="8">
</td>
<td width="100%"><p><a href="'.$results[$i][link].'"';
if("CMS_VALUE[3]"){
echo "target=\"CMS_VALUE[3]\" ";
};
echo '>'.$results[$i][title].'</a></p>
</td>
</tr>
<tr>
<td> </td>
<td>';
echo "<p>(".$hits[$i]." Treffer)";
echo $results[$i][text]."</p></td></tr></table></td></tr>";
};
} else {
echo "<tr><td align=center><p>Keine passenden Seiten gefunden</p></td></tr>";
};
} else {
echo "<tr><td align=center><p>Keine passenden Seiten gefunden</p></td></tr>";
};
};
echo "</table>";
?>