Hallo,
Ich habe die "Volltextsuche" in 442 eingebaut, aber alles was ich sehe ist das Wort "Suchbegriff:". Kein Eingabefeld, nix.
Woran liegt das wohl ?
Was muss ich bei "Linkziel" eintragen?
Wäre für Hilfe dankbar,
Volltextsuche in 442
Volltextsuche in 442
Gruss Karl
Irgendwo gab es mal im Forum ein Suchmodul 1.2, das bei mir läuft.
Input
echo "<table align=\"left\" cellpadding=\"0\" cellspacing=\"0\">
<tr valign=\"top\">
<td width=\"202\">Schriftart Link:</td>
<td><select name=\"CMS_VAR[0]\" size=\"1\">";
if ("CMS_VALUE[0]" != 0) {echo "<option value=\"0\">".$lngForm["nothing"]."</option>";}
else {echo "<option value=\"0\" selected>".$lngForm["nothing"]."</option>";}
for ($i=1; $i<=50; $i++) {if ( $i != "CMS_VALUE[0]" ) {echo "<option value=\"$i\">Font $i</option>";} else {echo "<option value=\"$i\" selected>Font $i</option>";}}
echo "</SELECT></td>
</tr> <tr valign=\"top\">
<td width=\"202\">Schriftart Text:</td>
<td><select name=\"CMS_VAR[1]\" size=\"1\">";
if ("CMS_VALUE[1]" != 0) {echo "<option value=\"0\">".$lngForm["nothing"]."</option>";}
else {echo "<option value=\"0\" selected>".$lngForm["nothing"]."</option>";}
for ($i=1; $i<=50; $i++) {if ( $i != "CMS_VALUE[1]" ) {echo "<option value=\"$i\">Font $i</option>";} else {echo "<option value=\"$i\" selected>Font $i</option>";}}
echo "</SELECT></td>
</tr> <tr valign=\"top\">
<td width=\"202\">Zusatzangaben: </td>
<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[2]\" VALUE=\"0\" ";
if("CMS_VALUE[2]" == 0){ echo "checked=checked"; }; echo "> nichts <br>
<INPUT TYPE=\"radio\" NAME=\"CMS_VAR[2]\" VALUE=\"1\" ";
if("CMS_VALUE[2]" == 1){ echo "checked=checked"; }; echo "> Kommentar <br>
<INPUT TYPE=\"radio\" NAME=\"CMS_VAR[2]\" VALUE=\"2\" ";
if("CMS_VALUE[2]" == 2){ echo "checked=checked"; }; echo "> Textausschnitt </td>
</tr> <tr valign=\"top\">
<td width=\"202\">Linkziel: </td>
<td><INPUT TYPE=\"text\" NAME=\"CMS_VAR[3]\" VALUE=\"CMS_VALUE[3]\"></td>
</tr>
</table>";
Output
<?php
echo '<form name="suche" method="POST" action="'.$auth->url().'">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="70%"><p><input type="text" size="25" style="width:250px" name="suche" value="'.$suche.'" class="Input"></p></td>
<td width="30%"><p><INPUT TYPE="submit" VALUE="Suchen" style="width:100px" class="InputButton"></p></td>
</tr>
<tr>
<td colspan=2><input type="radio" name="verknuepfung" value="und" checked> UND-Verknüpfung (<i>alle</i> Begriffe müssen enthalten sein)</td>
</tr>
<tr>
<td colspan=2><input type="radio" name="verknuepfung" value="oder"> ODER-Verknüpfung (<i>mindestens ein</i> Begriff muss enthalten sein)</td>
</tr>
<tr>
<td colspan=2><p><br>Durchsucht werden alle Seiten dieses Webs, nicht jedoch die Inhalte von PDF-Dateien.</p>
<p>Groß-/Kleinschreibung wird ignoriert, Wörter wie "und", "der" etc. werden aus der Suchliste gestrichen.</p></td>
</tr>
</table></center>
</FO'.'RM>';
if($suche){
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
$ignore_konj = array("und","oder","als","wenn","auch","wo","wie");
$ignore_art = array("der","die","das","ein","eine");
$ignore = array("ich","du","er","sie","es","wir","ihr","sie");
$suche = trim($suche);
$suchliste = explode(" ",strtolower($suche));
$suchliste = array_diff ($suchliste, $ignore_konj, $ignore_art, $ignore);
$suche = trim(implode(" ",$suchliste));
if($verknuepfung=="oder"){
$suchregexp = "(".str_replace(" ",")|(",$suche).")";
$s=ereg_replace("ü", "%FC",strtolower($suche));
$s=ereg_replace("ä", "%E4",$s);
$s=ereg_replace("ö", "%F6",$s);
$suchregexp .= "|$s";
$sql = "SELECT A.title AS title,A.idart AS idart,A.summary AS comment,B.idcat AS idcat,D.value AS content,A.idartlang AS sideid ";
$sql .= "FROM ".$cfg["tab"]["art_lang"]." AS A, ".$cfg["tab"]["cat_art"]." AS B, ".$cfg["tab"]["cat"]." AS C, ".$cfg["tab"]["content"]." AS D ";
$sql .= "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'";
$sql .= " AND (D.value REGEXP '".$suchregexp."' OR A.title REGEXP '".$suchregexp."' OR A.summary REGEXP '".$suchregexp."')";
} else {
$sql = "SELECT A.title AS title,A.idart AS idart,A.summary AS comment,B.idcat AS idcat,D.value AS content,A.idartlang AS sideid ";
$sql .= "FROM ".$cfg["tab"]["art_lang"]." AS A, ".$cfg["tab"]["cat_art"]." AS B, ".$cfg["tab"]["cat"]." AS C, ".$cfg["tab"]["content"]." AS D ";
$sql .= "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'";
while(list($key, $val) = each($suchliste)) {
$suchregexp = "(".str_replace(" ",")|(",$val).")";
$s=ereg_replace("ü", "%FC",strtolower($val));
$s=ereg_replace("ä", "%E4",$s);
$s=ereg_replace("ö", "%F6",$s);
$suchregexp .= "|$s";
$sql .= " AND (D.value REGEXP '".$suchregexp."' OR A.title REGEXP '".$suchregexp."' OR A.summary REGEXP '".$suchregexp."')";
} reset($suchliste);
}
$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("sideid");
$results[$num][link] = "front_content.php?client=".$client."&la"."ng=".$lang."&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(urldecode($db->f("content"))),0,100)."...";
};
while(list($key, $val) = each($suchliste)) {
$hits[$num] += substr_count(strip_tags(urldecode(strtolower($db->f("title")))), $val) +
substr_count(strtolower(strip_tags(urldecode($db->f("comment")))), $val) +
substr_count(strtolower(strip_tags(urldecode($db->f("content")))), $val);
// echo $num.': '.$val.'='.$hits[$num].$db->f("content").'<br>';
}; reset($suchliste);
};
if(count($hits) > 0){
echo '<tr><td><h1>Suchergebnisse</h1>
<p><b>für "'.$suche.'" ';
if($verknuepfung=="oder"){ echo '(ODER-verknüpft)'; }
else { echo '(UND-verknüpft)'; }
echo '</b></p></td></tr>';
$hits = array_values($hits);
$results = array_values($results);
array_multisort ($results, SORT_DESC, SORT_NUMERIC, $hits, SORT_DESC, SORT_NUMERIC);
for ($i=0; $i<count($hits); $i++){
echo "<tr><td align=left><p><a href=\"".$results[$i][link]."\"";
if("CMS_VALUE[3]"){echo "TARGET=\"CMS_VALUE[3]\" ";};
echo ">".$results[$i][title]."</a> (".$hits[$i]." Treffer)<BR>";
echo $results[$i][text]." <a href=\"".$results[$i][link]."\"";
if("CMS_VALUE[3]"){echo "TARGET=\"CMS_VALUE[3]\" ";};
echo ">mehr</a></p></td></tr>";
};
} else { echo "<tr><td align=center><p><b>Keine passenden Seiten gefunden</b></p></td></tr>"; };
} else { echo "<tr><td align=center><p><b>Keine passenden Seiten gefunden</b></p></td></tr>"; };
echo '</table>';
}
?>
Input
echo "<table align=\"left\" cellpadding=\"0\" cellspacing=\"0\">
<tr valign=\"top\">
<td width=\"202\">Schriftart Link:</td>
<td><select name=\"CMS_VAR[0]\" size=\"1\">";
if ("CMS_VALUE[0]" != 0) {echo "<option value=\"0\">".$lngForm["nothing"]."</option>";}
else {echo "<option value=\"0\" selected>".$lngForm["nothing"]."</option>";}
for ($i=1; $i<=50; $i++) {if ( $i != "CMS_VALUE[0]" ) {echo "<option value=\"$i\">Font $i</option>";} else {echo "<option value=\"$i\" selected>Font $i</option>";}}
echo "</SELECT></td>
</tr> <tr valign=\"top\">
<td width=\"202\">Schriftart Text:</td>
<td><select name=\"CMS_VAR[1]\" size=\"1\">";
if ("CMS_VALUE[1]" != 0) {echo "<option value=\"0\">".$lngForm["nothing"]."</option>";}
else {echo "<option value=\"0\" selected>".$lngForm["nothing"]."</option>";}
for ($i=1; $i<=50; $i++) {if ( $i != "CMS_VALUE[1]" ) {echo "<option value=\"$i\">Font $i</option>";} else {echo "<option value=\"$i\" selected>Font $i</option>";}}
echo "</SELECT></td>
</tr> <tr valign=\"top\">
<td width=\"202\">Zusatzangaben: </td>
<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[2]\" VALUE=\"0\" ";
if("CMS_VALUE[2]" == 0){ echo "checked=checked"; }; echo "> nichts <br>
<INPUT TYPE=\"radio\" NAME=\"CMS_VAR[2]\" VALUE=\"1\" ";
if("CMS_VALUE[2]" == 1){ echo "checked=checked"; }; echo "> Kommentar <br>
<INPUT TYPE=\"radio\" NAME=\"CMS_VAR[2]\" VALUE=\"2\" ";
if("CMS_VALUE[2]" == 2){ echo "checked=checked"; }; echo "> Textausschnitt </td>
</tr> <tr valign=\"top\">
<td width=\"202\">Linkziel: </td>
<td><INPUT TYPE=\"text\" NAME=\"CMS_VAR[3]\" VALUE=\"CMS_VALUE[3]\"></td>
</tr>
</table>";
Output
<?php
echo '<form name="suche" method="POST" action="'.$auth->url().'">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="70%"><p><input type="text" size="25" style="width:250px" name="suche" value="'.$suche.'" class="Input"></p></td>
<td width="30%"><p><INPUT TYPE="submit" VALUE="Suchen" style="width:100px" class="InputButton"></p></td>
</tr>
<tr>
<td colspan=2><input type="radio" name="verknuepfung" value="und" checked> UND-Verknüpfung (<i>alle</i> Begriffe müssen enthalten sein)</td>
</tr>
<tr>
<td colspan=2><input type="radio" name="verknuepfung" value="oder"> ODER-Verknüpfung (<i>mindestens ein</i> Begriff muss enthalten sein)</td>
</tr>
<tr>
<td colspan=2><p><br>Durchsucht werden alle Seiten dieses Webs, nicht jedoch die Inhalte von PDF-Dateien.</p>
<p>Groß-/Kleinschreibung wird ignoriert, Wörter wie "und", "der" etc. werden aus der Suchliste gestrichen.</p></td>
</tr>
</table></center>
</FO'.'RM>';
if($suche){
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
$ignore_konj = array("und","oder","als","wenn","auch","wo","wie");
$ignore_art = array("der","die","das","ein","eine");
$ignore = array("ich","du","er","sie","es","wir","ihr","sie");
$suche = trim($suche);
$suchliste = explode(" ",strtolower($suche));
$suchliste = array_diff ($suchliste, $ignore_konj, $ignore_art, $ignore);
$suche = trim(implode(" ",$suchliste));
if($verknuepfung=="oder"){
$suchregexp = "(".str_replace(" ",")|(",$suche).")";
$s=ereg_replace("ü", "%FC",strtolower($suche));
$s=ereg_replace("ä", "%E4",$s);
$s=ereg_replace("ö", "%F6",$s);
$suchregexp .= "|$s";
$sql = "SELECT A.title AS title,A.idart AS idart,A.summary AS comment,B.idcat AS idcat,D.value AS content,A.idartlang AS sideid ";
$sql .= "FROM ".$cfg["tab"]["art_lang"]." AS A, ".$cfg["tab"]["cat_art"]." AS B, ".$cfg["tab"]["cat"]." AS C, ".$cfg["tab"]["content"]." AS D ";
$sql .= "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'";
$sql .= " AND (D.value REGEXP '".$suchregexp."' OR A.title REGEXP '".$suchregexp."' OR A.summary REGEXP '".$suchregexp."')";
} else {
$sql = "SELECT A.title AS title,A.idart AS idart,A.summary AS comment,B.idcat AS idcat,D.value AS content,A.idartlang AS sideid ";
$sql .= "FROM ".$cfg["tab"]["art_lang"]." AS A, ".$cfg["tab"]["cat_art"]." AS B, ".$cfg["tab"]["cat"]." AS C, ".$cfg["tab"]["content"]." AS D ";
$sql .= "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'";
while(list($key, $val) = each($suchliste)) {
$suchregexp = "(".str_replace(" ",")|(",$val).")";
$s=ereg_replace("ü", "%FC",strtolower($val));
$s=ereg_replace("ä", "%E4",$s);
$s=ereg_replace("ö", "%F6",$s);
$suchregexp .= "|$s";
$sql .= " AND (D.value REGEXP '".$suchregexp."' OR A.title REGEXP '".$suchregexp."' OR A.summary REGEXP '".$suchregexp."')";
} reset($suchliste);
}
$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("sideid");
$results[$num][link] = "front_content.php?client=".$client."&la"."ng=".$lang."&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(urldecode($db->f("content"))),0,100)."...";
};
while(list($key, $val) = each($suchliste)) {
$hits[$num] += substr_count(strip_tags(urldecode(strtolower($db->f("title")))), $val) +
substr_count(strtolower(strip_tags(urldecode($db->f("comment")))), $val) +
substr_count(strtolower(strip_tags(urldecode($db->f("content")))), $val);
// echo $num.': '.$val.'='.$hits[$num].$db->f("content").'<br>';
}; reset($suchliste);
};
if(count($hits) > 0){
echo '<tr><td><h1>Suchergebnisse</h1>
<p><b>für "'.$suche.'" ';
if($verknuepfung=="oder"){ echo '(ODER-verknüpft)'; }
else { echo '(UND-verknüpft)'; }
echo '</b></p></td></tr>';
$hits = array_values($hits);
$results = array_values($results);
array_multisort ($results, SORT_DESC, SORT_NUMERIC, $hits, SORT_DESC, SORT_NUMERIC);
for ($i=0; $i<count($hits); $i++){
echo "<tr><td align=left><p><a href=\"".$results[$i][link]."\"";
if("CMS_VALUE[3]"){echo "TARGET=\"CMS_VALUE[3]\" ";};
echo ">".$results[$i][title]."</a> (".$hits[$i]." Treffer)<BR>";
echo $results[$i][text]." <a href=\"".$results[$i][link]."\"";
if("CMS_VALUE[3]"){echo "TARGET=\"CMS_VALUE[3]\" ";};
echo ">mehr</a></p></td></tr>";
};
} else { echo "<tr><td align=center><p><b>Keine passenden Seiten gefunden</b></p></td></tr>"; };
} else { echo "<tr><td align=center><p><b>Keine passenden Seiten gefunden</b></p></td></tr>"; };
echo '</table>';
}
?>
Netz: Contenido 4.42 läuft auf Apache/df-exts 1.1 (Unix) mod_ssl/2.8.15 OpenSSL/0.9.6k AuthPG/1.3 FrontPage/5.0.2.2510, MySQL server version 3.23.57-log, PHP 4.2.3 bei Domainfactory
Lokal: Contenido 4.42 läuft auf Apache/2.0.46 (Win32) mod_perl/1.99_10-dev Perl/v5.8.0 PHP/4.3.2 mod_ssl/2.0.46 OpenSSL/0.9.7b
Lokal: Contenido 4.42 läuft auf Apache/2.0.46 (Win32) mod_perl/1.99_10-dev Perl/v5.8.0 PHP/4.3.2 mod_ssl/2.0.46 OpenSSL/0.9.7b