Supportnet / Forum / Webseiten/HTML
Verwirrende Suchfunktion
Frage
Hallo zusammen,
ich habe ein rießen Problem und bin schon fast am verzweifeln!
Mein Onlineshop, greift über eine shopsearch.php Datei auf einen Ordner mit vordefinierten XML Dateien zu. z.B.:
<productdescription>
Bad Tölz <B>Atelier Knobl</B>
<BR>Die wunderbare Welt des Porzellans
<BR>Gilgenhöfe 5 - 83661 Lenggries
<BR>Telefon:08042/3175 - Fax:3275
<BR>
<BR>[b]Porzellankunst[/b] PorzellanArt
<BR>Geheimtipp Handarbeit Porcellan
<BR>Porzellanunikate Porzellanartikel
<BR>[b]Geschenkidee[/b] Geschenkartikel
<BR>Geschenkgutschen Präsentidee
<BR>Porzellan Restaurierung
<BR>[b]PorzellanHobby Potzellanmalerei[/b]
<BR>
<BR>
Mail: <B><a href="mailto:info@porzellanshop.de">
info@porzellanshop.de</B></a>
<BR>
Web:<B><a href="http://www.porzellanshop.de" target="blank"> http://www.porzellanshop.de</B></a>
<BR>
<BR>
<FONT COLOR="#990000"><B>
INTERNETSHOPVERKAUF !!!!! INTERNETSHOPVERKAUF !!!!!
</B></FONT>
</productdescription>
Aus dieser Beschreibung, werden die Suchergebnisse geliefert! Wenn ich die Suchlogik auf AND einstelle und sagen o. Beispiel suche mir [b]Porzellankunst[/b] und [b]Geschenkidee[/b] liefert er mir keine Suchtreffer.
Gebe ich jedoch aus einer Zeile ein [b]PorzellanHobby und Potzellanmalerei[/b]
Findet er mir den Eintrag!
An was kann das liegen? Bitte dringend um Hilfe!
VIELEN VIELEN DANK!
Gruß Maris
Antwort 1 von rfb
Zitat:
An was kann das liegen?
An der shopsearch.php, aber ohne die zu kennen wirds schwierig, dir zu helfen.An was kann das liegen?
Antwort 2 von Maris
Ich könnte Sie posten oder einen Link darauf verweisen! Wie soll ich machen?
Antwort 3 von rfb
am besten hier reinsetzen, damit möglichst viele SNler sie ohne größere Umstände analysieren können
Antwort 4 von Maris
Ist ein wenig lang, ich hoffe Ihr könnt mir weiterhelfen!
<h1 class="groupid">Suchresultate</h1>
<?php
class productgroups {
var $xml_parser;
var $xml_file;
var $html_file;
var $html;
var $producthtml;
var $open_tag ;
var $close_tag ;
var $search;
var $currency;
var $found;
var $hits;
var $itemcount;
var $groupname;
var $productnumber;
var $productname;
var $counter;
var $searchlogic; //"and" or "or"
var $searchwords; //array for words to search for
var $wordscount; //number of words to search for
var $foundwords; //number of found words
//Class Constructor
function productgroups() {
$this->xml_parser = "";
$this->xml_file = "";
$this->html_file = "";
$this->html = "";
$this->producthtml = "";
$this->search = "";
$this->currency = "";
$this->found = false;
$this->hits = 0;
$this->tagname = "";
$this->itemcount = "";
$this->groupname = "";
$this->productnumber = "";
$this->productname = "";
$this->counter = "";
$this->open_tag = array(
"PRODUCTGROUP" => "",
"GROUPNAME" => "",
"PRODUCTS" => "",
"PRODUCT" => "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td colspan=\"2\" class=\"searchresults1\">%%counter%% %%productname%%</td></tr>",
"PRODUCTNUMBER" => "<tr><td colspan=\"2\" class=\"searchresults2\">",
"PRODUCTNAME" => "",
"PRODUCTDESCRIPTION" => "",
"PRODUCTDETAILTEXT1" => "<tr><td colspan=\"2\" class=\"searchresults2\">",
"PRODUCTDETAILTEXT2" => "<tr><td colspan=\"2\" class=\"searchresults2\">",
"PRICE" => "<tr><td class=\"searchresults3\" colspan=\"2\"><b>",
"STPRICE1" => "<br>",
"STQTY1" => ":",
"STPRICE2" => "<br>",
"STQTY2" => ":",
"PRODUCTVATRATE" => "",
"ITEMCOUNT" => "",
"NEWLINE" => "<BR>"
);
$this->close_tag = array(
"PRODUCTGROUP" => "",
"GROUPNAME" => "",
"PRODUCTS" => "",
"PRODUCT" => "</b></td></tr></table><br>\n",
"PRODUCTNUMBER" => "",
"PRODUCTNAME" => "",
"PRODUCTDESCRIPTION" => "<br></td></tr>\n",
"PRODUCTDETAILTEXT1" => "</td></tr>\n",
"PRODUCTDETAILTEXT2" => "</td></tr>\n",
"PRODUCTVATRATE" => "",
"ITEMCOUNT" => "",
"NEWLINE" => "<BR>"
);
}
<h1 class="groupid">Suchresultate</h1>
<?php
class productgroups {
var $xml_parser;
var $xml_file;
var $html_file;
var $html;
var $producthtml;
var $open_tag ;
var $close_tag ;
var $search;
var $currency;
var $found;
var $hits;
var $itemcount;
var $groupname;
var $productnumber;
var $productname;
var $counter;
var $searchlogic; //"and" or "or"
var $searchwords; //array for words to search for
var $wordscount; //number of words to search for
var $foundwords; //number of found words
//Class Constructor
function productgroups() {
$this->xml_parser = "";
$this->xml_file = "";
$this->html_file = "";
$this->html = "";
$this->producthtml = "";
$this->search = "";
$this->currency = "";
$this->found = false;
$this->hits = 0;
$this->tagname = "";
$this->itemcount = "";
$this->groupname = "";
$this->productnumber = "";
$this->productname = "";
$this->counter = "";
$this->open_tag = array(
"PRODUCTGROUP" => "",
"GROUPNAME" => "",
"PRODUCTS" => "",
"PRODUCT" => "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\"><tr><td colspan=\"2\" class=\"searchresults1\">%%counter%% %%productname%%</td></tr>",
"PRODUCTNUMBER" => "<tr><td colspan=\"2\" class=\"searchresults2\">",
"PRODUCTNAME" => "",
"PRODUCTDESCRIPTION" => "",
"PRODUCTDETAILTEXT1" => "<tr><td colspan=\"2\" class=\"searchresults2\">",
"PRODUCTDETAILTEXT2" => "<tr><td colspan=\"2\" class=\"searchresults2\">",
"PRICE" => "<tr><td class=\"searchresults3\" colspan=\"2\"><b>",
"STPRICE1" => "<br>",
"STQTY1" => ":",
"STPRICE2" => "<br>",
"STQTY2" => ":",
"PRODUCTVATRATE" => "",
"ITEMCOUNT" => "",
"NEWLINE" => "<BR>"
);
$this->close_tag = array(
"PRODUCTGROUP" => "",
"GROUPNAME" => "",
"PRODUCTS" => "",
"PRODUCT" => "</b></td></tr></table><br>\n",
"PRODUCTNUMBER" => "",
"PRODUCTNAME" => "",
"PRODUCTDESCRIPTION" => "<br></td></tr>\n",
"PRODUCTDETAILTEXT1" => "</td></tr>\n",
"PRODUCTDETAILTEXT2" => "</td></tr>\n",
"PRODUCTVATRATE" => "",
"ITEMCOUNT" => "",
"NEWLINE" => "<BR>"
);
}
Antwort 5 von Maris
//Class Destructor
function destroy() {
// $this->hits = 0;
xml_parser_free($this->xml_parser);
}
//Class Members
function concat($str) {
$this->html .= $str;
}
function startElement($parser, $name, $attrs) {
$this->tagname=$name;
if ($format= $this->open_tag[$name])
{
if ($name == "PRODUCTGROUP" || $name == "GROUPNAME")
{
$this->html .= $format;
}
else
{
$this->producthtml .= $format;
}
}
}
function endElement($parser, $name) {
global $counter;
if ($format= $this->close_tag[$name])
{
if ($name == "PRODUCTGROUP" || $name == "GROUPNAME")
{
$this->html .= $format;
}
else
{
if ($name == "PRICE")
$this->producthtml .= $this->currency;
// Tag end
$this->producthtml .= $format;
if ($name =="PRODUCT")
{
if ($this->found)
{
$this->producthtml = ereg_replace("%%productnumber%%", $this->productnumber, $this->producthtml);
$this->producthtml = ereg_replace("%%productname%%", $this->productname, $this->producthtml);
$this->producthtml = ereg_replace("%%counter%%", $counter.".", $this->producthtml);
++$counter;
$this->producthtml = ereg_replace("%%itemcount%%", $this->itemcount, $this->producthtml);
$this->producthtml = ereg_replace("%%groupname%%", $this->groupname, $this->producthtml);
$this->html .= $this->producthtml;
}
$this->itemcount = "";
$this->productnumber = "";
$this->productname = "";
$this->producthtml = "";
$this->found = false;
}
}
}
}
function characterData($parser, $data) {
if ($this->tagname == "PRODUCTGROUP" || $this->tagname == "GROUPNAME")
{
if ($this->tagname == "GROUPNAME")
{
if ($data > " " && $this->groupname == "")
$this->groupname = "<a href=\"".$this->html_file."\">".$data."</a>";
}
}
else if ($this->tagname != "PRODUCTVATRATE" && $this->tagname != "ITEMCOUNT")
{
if ($this->tagname == "PRODUCTNUMBER")
{
if ($data > " " && $this->productnumber == "")
$this->productnumber = $data;
}
else
{
if ($this->tagname == "PRODUCTNAME")
{
if ($data > " " && $this->productname == "")
{
$this->productname = "<a href=\"";
$this->productname .= $this->html_file;
$this->productname .= "%%itemcount%%";
$this->productname .= "\">";
$this->productname .= $data;
$this->productname .= "</a>";
}
}
else
$this->producthtml .= $data;
if ($this->wordscount <= 1)
{
if (stristr($data, $this->search))
{
// Search results found in this field
if (! $this->found)
$this->hits++;
$this->found = true;
}
}else{
$this->foundwords = 0;
foreach($this->searchwords as $srw)
{
if (stristr($data, $srw))
{
if($this->searchlogic=="or")
{
if (! $this->found)
$this->hits++;
$this->found = true;
}else{
$this->foundwords++;
}
}
}
if ( ($this->searchlogic=="and")
and ($this->foundwords==$this->wordscount))
{
if (! $this->found)
$this->hits++;
$this->found = true;
}
}
}
}
else if ($this->tagname == "ITEMCOUNT")
{
if ($data > " " && $this->itemcount == "")
$this->itemcount = "#".$data;
}
}
function parse() {
$this->xml_parser = xml_parser_create();
xml_set_object($this->xml_parser, $this);
// use case-folding so we are sure to find the tag in $map_array
xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, true);
xml_set_element_handler($this->xml_parser, "startElement", "endElement");
xml_set_character_data_handler($this->xml_parser, "characterData");
//xml_set_processing_instruction_handler($this->xml_parser, "PIHandler");
if (!($fp = @fopen($this->xml_file, "r"))) {
// die("could not open XML input");
}
else
{
while ($data = fread($fp, 4096)) {
if (!xml_parse($this->xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser)));
function destroy() {
// $this->hits = 0;
xml_parser_free($this->xml_parser);
}
//Class Members
function concat($str) {
$this->html .= $str;
}
function startElement($parser, $name, $attrs) {
$this->tagname=$name;
if ($format= $this->open_tag[$name])
{
if ($name == "PRODUCTGROUP" || $name == "GROUPNAME")
{
$this->html .= $format;
}
else
{
$this->producthtml .= $format;
}
}
}
function endElement($parser, $name) {
global $counter;
if ($format= $this->close_tag[$name])
{
if ($name == "PRODUCTGROUP" || $name == "GROUPNAME")
{
$this->html .= $format;
}
else
{
if ($name == "PRICE")
$this->producthtml .= $this->currency;
// Tag end
$this->producthtml .= $format;
if ($name =="PRODUCT")
{
if ($this->found)
{
$this->producthtml = ereg_replace("%%productnumber%%", $this->productnumber, $this->producthtml);
$this->producthtml = ereg_replace("%%productname%%", $this->productname, $this->producthtml);
$this->producthtml = ereg_replace("%%counter%%", $counter.".", $this->producthtml);
++$counter;
$this->producthtml = ereg_replace("%%itemcount%%", $this->itemcount, $this->producthtml);
$this->producthtml = ereg_replace("%%groupname%%", $this->groupname, $this->producthtml);
$this->html .= $this->producthtml;
}
$this->itemcount = "";
$this->productnumber = "";
$this->productname = "";
$this->producthtml = "";
$this->found = false;
}
}
}
}
function characterData($parser, $data) {
if ($this->tagname == "PRODUCTGROUP" || $this->tagname == "GROUPNAME")
{
if ($this->tagname == "GROUPNAME")
{
if ($data > " " && $this->groupname == "")
$this->groupname = "<a href=\"".$this->html_file."\">".$data."</a>";
}
}
else if ($this->tagname != "PRODUCTVATRATE" && $this->tagname != "ITEMCOUNT")
{
if ($this->tagname == "PRODUCTNUMBER")
{
if ($data > " " && $this->productnumber == "")
$this->productnumber = $data;
}
else
{
if ($this->tagname == "PRODUCTNAME")
{
if ($data > " " && $this->productname == "")
{
$this->productname = "<a href=\"";
$this->productname .= $this->html_file;
$this->productname .= "%%itemcount%%";
$this->productname .= "\">";
$this->productname .= $data;
$this->productname .= "</a>";
}
}
else
$this->producthtml .= $data;
if ($this->wordscount <= 1)
{
if (stristr($data, $this->search))
{
// Search results found in this field
if (! $this->found)
$this->hits++;
$this->found = true;
}
}else{
$this->foundwords = 0;
foreach($this->searchwords as $srw)
{
if (stristr($data, $srw))
{
if($this->searchlogic=="or")
{
if (! $this->found)
$this->hits++;
$this->found = true;
}else{
$this->foundwords++;
}
}
}
if ( ($this->searchlogic=="and")
and ($this->foundwords==$this->wordscount))
{
if (! $this->found)
$this->hits++;
$this->found = true;
}
}
}
}
else if ($this->tagname == "ITEMCOUNT")
{
if ($data > " " && $this->itemcount == "")
$this->itemcount = "#".$data;
}
}
function parse() {
$this->xml_parser = xml_parser_create();
xml_set_object($this->xml_parser, $this);
// use case-folding so we are sure to find the tag in $map_array
xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, true);
xml_set_element_handler($this->xml_parser, "startElement", "endElement");
xml_set_character_data_handler($this->xml_parser, "characterData");
//xml_set_processing_instruction_handler($this->xml_parser, "PIHandler");
if (!($fp = @fopen($this->xml_file, "r"))) {
// die("could not open XML input");
}
else
{
while ($data = fread($fp, 4096)) {
if (!xml_parse($this->xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser)));
Antwort 6 von Maris
}
}
}
}
}
function startIndexElement($parser, $name, $attrs) {
global $grouppageflag;
if ($name == "GROUPPAGENAME")
$grouppageflag = 1;
else
$grouppageflag = 0;
}
function endIndexElement($parser, $name) {
}
function indexCharacterData($parser, $data) {
global $grouppageflag;
global $xmlfiles;
if ($data >" ") {
if ($grouppageflag==1) {
$xmlfiles[] = $data;
}
}
}
function startSettingsElement($parser, $name, $attrs) {
global $tagname;
$tagname=$name;
}
function endSettingsElement($parser, $name) {
}
function settingsCharacterData($parser, $data) {
global $currency;
global $tagname;
if ($data > " " && $tagname == "CURRENCY") {
$currency = $data;
}
}
function print_header()
{
print ("<body>\n");
print ("<p>");
}
function print_footer()
{
}
// Please enter a word to search for!
$search = strip_tags(trim($HTTP_POST_VARS["search"]));
// Searchlogic (AND/OR)
$searchlogic = $HTTP_POST_VARS["searchlogic"];
if ($searchlogic == "")
{
$searchlogic = "or";
}
if ($search == "")
{
print_header();
die ("<b>Bitte einen Suchbegriff eingeben!</b><p><input type=button value=Zurück class=buttons onClick=javascript:history.back()>");
print_footer();
}
$file = "xml/index.xml";
$xmlfiles = array();
//Create parser for index.xml
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startIndexElement", "endIndexElement");
xml_set_character_data_handler($xml_parser, "indexCharacterData");
if (!($fp = fopen($file, "r"))) {
die("Could not open index.xml.");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
xml_parser_free($xml_parser);
$file = "xml/settings.xml";
//Create parser for index.xml
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startSettingsElement", "endSettingsElement");
xml_set_character_data_handler($xml_parser, "settingsCharacterData");
if (!($fp = fopen($file, "r"))) {
die("Could not open settings.xml.");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
xml_parser_free($xml_parser);
$istreffer = false;
$totalhits = 0;
$groupcount = 0;
global $counter;
$counter = 1;
}
}
}
}
function startIndexElement($parser, $name, $attrs) {
global $grouppageflag;
if ($name == "GROUPPAGENAME")
$grouppageflag = 1;
else
$grouppageflag = 0;
}
function endIndexElement($parser, $name) {
}
function indexCharacterData($parser, $data) {
global $grouppageflag;
global $xmlfiles;
if ($data >" ") {
if ($grouppageflag==1) {
$xmlfiles[] = $data;
}
}
}
function startSettingsElement($parser, $name, $attrs) {
global $tagname;
$tagname=$name;
}
function endSettingsElement($parser, $name) {
}
function settingsCharacterData($parser, $data) {
global $currency;
global $tagname;
if ($data > " " && $tagname == "CURRENCY") {
$currency = $data;
}
}
function print_header()
{
print ("<body>\n");
print ("<p>");
}
function print_footer()
{
}
// Please enter a word to search for!
$search = strip_tags(trim($HTTP_POST_VARS["search"]));
// Searchlogic (AND/OR)
$searchlogic = $HTTP_POST_VARS["searchlogic"];
if ($searchlogic == "")
{
$searchlogic = "or";
}
if ($search == "")
{
print_header();
die ("<b>Bitte einen Suchbegriff eingeben!</b><p><input type=button value=Zurück class=buttons onClick=javascript:history.back()>");
print_footer();
}
$file = "xml/index.xml";
$xmlfiles = array();
//Create parser for index.xml
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startIndexElement", "endIndexElement");
xml_set_character_data_handler($xml_parser, "indexCharacterData");
if (!($fp = fopen($file, "r"))) {
die("Could not open index.xml.");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
xml_parser_free($xml_parser);
$file = "xml/settings.xml";
//Create parser for index.xml
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startSettingsElement", "endSettingsElement");
xml_set_character_data_handler($xml_parser, "settingsCharacterData");
if (!($fp = fopen($file, "r"))) {
die("Could not open settings.xml.");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
xml_parser_free($xml_parser);
$istreffer = false;
$totalhits = 0;
$groupcount = 0;
global $counter;
$counter = 1;
Antwort 7 von Maris
// Print HTML head
print_header();
for ($i=0;$i<sizeof($xmlfiles);$i++)
{
// New XML product parser class
$group = new productgroups();
// Hyper link
$group->html_file = $xmlfiles[$i];
// Create XML files names
$htmpos = strrpos($xmlfiles[$i], ".htm");
$xmlfile = substr($xmlfiles[$i],0,$htmpos);
$xmlfiles[$i] = $xmlfile.".xml";
// Search in XML files
$group->xml_file = "xml/".$xmlfiles[$i];
// Assign Search word
$group->search = $search;
// Assign Search logic
$group->searchlogic = $searchlogic;
// Create search list
$group->searchwords = explode(" ",$search);
$group->wordscount = count($group->searchwords);
// Assign currency
$group->currency = $currency;
if (strlen($xmlfile) > 0)
{
$group->parse();
// Search results found?
if ($group->hits > 0)
{
$istreffer = true;
// Ountput of HTML block search results
print ($group->html);
$totalhits += $group->hits;
++$groupcount;
}
$group->destroy();
}
}
// No hits?
if (! $istreffer)
{
print ("\"".$search."\" ");
print ("");
print ("<img src=pixel.gif width=400 height=1><br><b>nicht gefunden!</b>");
}
else
{
print ("<b>");
print ($totalhits);
print (" Artikel - ");
print ($groupcount);
print (" Warengruppe(n) ");
print ("</b>");
}
// Create HTML footer
print_footer();
?>
</td>
<td class="rightcolumn" valign="top"> <img src="pixel.gif" width="1" height="500" align="right">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tdcolor2"><img src="spacer.gif" width="20" height="3"></td>
</tr>
<tr>
<td class="tdcolor1"><img src="spacer.gif" width="20" height="3"></td>
</tr>
<tr>
<td class="titlenews">News<b></b></td>
</tr>
<tr>
<td class="tdcolor2"><img src="spacer.gif" width="20" height="3"></td>
</tr>
<tr>
<td class="td_hellblau">
<table width="100%" border="0" cellspacing="0" cellpadding="3" >
<tr>
<td valign="top">
<script language="JavaScript">
<!--
showItemsneu();
//-->
</script>
print_header();
for ($i=0;$i<sizeof($xmlfiles);$i++)
{
// New XML product parser class
$group = new productgroups();
// Hyper link
$group->html_file = $xmlfiles[$i];
// Create XML files names
$htmpos = strrpos($xmlfiles[$i], ".htm");
$xmlfile = substr($xmlfiles[$i],0,$htmpos);
$xmlfiles[$i] = $xmlfile.".xml";
// Search in XML files
$group->xml_file = "xml/".$xmlfiles[$i];
// Assign Search word
$group->search = $search;
// Assign Search logic
$group->searchlogic = $searchlogic;
// Create search list
$group->searchwords = explode(" ",$search);
$group->wordscount = count($group->searchwords);
// Assign currency
$group->currency = $currency;
if (strlen($xmlfile) > 0)
{
$group->parse();
// Search results found?
if ($group->hits > 0)
{
$istreffer = true;
// Ountput of HTML block search results
print ($group->html);
$totalhits += $group->hits;
++$groupcount;
}
$group->destroy();
}
}
// No hits?
if (! $istreffer)
{
print ("\"".$search."\" ");
print ("");
print ("<img src=pixel.gif width=400 height=1><br><b>nicht gefunden!</b>");
}
else
{
print ("<b>");
print ($totalhits);
print (" Artikel - ");
print ($groupcount);
print (" Warengruppe(n) ");
print ("</b>");
}
// Create HTML footer
print_footer();
?>
</td>
<td class="rightcolumn" valign="top"> <img src="pixel.gif" width="1" height="500" align="right">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tdcolor2"><img src="spacer.gif" width="20" height="3"></td>
</tr>
<tr>
<td class="tdcolor1"><img src="spacer.gif" width="20" height="3"></td>
</tr>
<tr>
<td class="titlenews">News<b></b></td>
</tr>
<tr>
<td class="tdcolor2"><img src="spacer.gif" width="20" height="3"></td>
</tr>
<tr>
<td class="td_hellblau">
<table width="100%" border="0" cellspacing="0" cellpadding="3" >
<tr>
<td valign="top">
<script language="JavaScript">
<!--
showItemsneu();
//-->
</script>
Antwort 8 von disco
moin
habe mir das script nicht angesehen, aber deine beiden suchanfragen, sind ja auch zwei paar schuhe.
so wie ich das sehe, sind Porzellankunst und Geschenkidee zwei unterschiedliche "objekte", während PorzellanHobby und Potzellanmalerei in einer zeile stehen, also ein objekt ist.
AND (im boolschen sinne) bedeutet, dass beide einträge vorkommen müssen, was nur bei PorzellanHobby und Potzellanmalerei der fall ist.
wenn du alle eintrge erhalten möchtest, in denen Porzellankunst und (im bolschen sinne: oder) Geschenkidee vorkommen sollen, also mindestens eins von beiden. musst du sie mit OR und nicht mit AND vereinigen.
g,
disco
habe mir das script nicht angesehen, aber deine beiden suchanfragen, sind ja auch zwei paar schuhe.
so wie ich das sehe, sind Porzellankunst und Geschenkidee zwei unterschiedliche "objekte", während PorzellanHobby und Potzellanmalerei in einer zeile stehen, also ein objekt ist.
AND (im boolschen sinne) bedeutet, dass beide einträge vorkommen müssen, was nur bei PorzellanHobby und Potzellanmalerei der fall ist.
wenn du alle eintrge erhalten möchtest, in denen Porzellankunst und (im bolschen sinne: oder) Geschenkidee vorkommen sollen, also mindestens eins von beiden. musst du sie mit OR und nicht mit AND vereinigen.
g,
disco
Antwort 9 von Maris
Ja das ist mit schon klar! Das Problemchen mit den 2 verschieden Zeilen (Objekten). Ich habe ja quasi eine Suchmaschine die in verschieden Regionen bestimmte Gewerbetreibende finden soll.
Gebe ich jetzt wie den Ort Lengriess an und das Suchwort Porzellankunst und verknüpfe beide mit OR erhalte ich: Alle gewerbetreibende aus Lengriess die aber nicht zwingend was mit Porzellan zu tun haben und alle gewerbetreibende die Porzellankunstherstellen aber nicht zwingend ansässig sind in Lengriess.
Du hast das Thma mit den verschieden Objekten angesprochen. Gibt es nicht eine Möglichkeit aus den verschiedenen Objekten 1 Gesamtobjekt zu machen, so könnte mit der AND Verknüfung komplett aus dies Objekt zugegriffen werden und das Problem wäre gelöst!
Gebe ich jetzt wie den Ort Lengriess an und das Suchwort Porzellankunst und verknüpfe beide mit OR erhalte ich: Alle gewerbetreibende aus Lengriess die aber nicht zwingend was mit Porzellan zu tun haben und alle gewerbetreibende die Porzellankunstherstellen aber nicht zwingend ansässig sind in Lengriess.
Du hast das Thma mit den verschieden Objekten angesprochen. Gibt es nicht eine Möglichkeit aus den verschiedenen Objekten 1 Gesamtobjekt zu machen, so könnte mit der AND Verknüfung komplett aus dies Objekt zugegriffen werden und das Problem wäre gelöst!

