Seite 1 von 1

Suchmodul Fehlermeldung

Verfasst: Sa 16. Sep 2006, 21:43
von JochBec
Hallo ;)

bisher lief mein Suchmodul (das gute Standartmodul) reibungslos. Von jetzt auf gleich bekomme ich statt eines Suchergebnisses folgende Fehlermeldung:

Code: Alles auswählen

Fatal error: Call to undefined function: num_rows() in /PFAD/front_content.php(771) : eval()'d code on line 230
Jemand eine Idee was die zu bedeuten hat? Hab schon alles mögliche versucht und im Forum auch nix zu finden. Premierenfehler? ;) Und wenn ja: welcher?

Kurz Input und Outout des Moduls:

Input:

Code: Alles auswählen

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:

Code: Alles auswählen

<?php
echo "<center><table width=\"380px\" border=\"0\"><tr><td align=center>
<form name=\"suche\" method=\"POST\" action=\"".$auth->url()."\" >
<input type=\"text\" size=\"9\" style=\"width:120px\" name=\"suche\" value=\"$suche\"> 
<INPUT TYPE=\"submit\" VALUE=\"Suchen\"></FORM></td></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,B.idcat AS idcat,C.parentid AS parentid,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')";

	$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&lang=$lang&parent=".$db->f("parentid")."&subid=".$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);
			for ($i=0; $i<count($hits); $i++){
				echo "<tr><td align=left><a href=\"".$results[$i][link]."\" id=\"fontCMS_VALUE[0]\"";
				if("CMS_VALUE[3]"){echo "TARGET=\"CMS_VALUE[3]\" ";}
				echo ">".$results[$i][title]."</a> <span id=\"fontCMS_VALUE[1]\">(".$hits[$i]." Treffer)<BR>";
				echo $results[$i][text]."</span></td></tr>";
			}
		} else { echo "<tr><td align=center>Keine passenden Seiten gefunden</td></tr>"; }
	} else { echo "<tr><td align=center>Keine passenden Seiten gefunden</td></tr>"; }
}
echo "</table></center>";
?>

Verfasst: So 17. Sep 2006, 00:46
von oio
hast du eine neue php5 version auf den server bekommen?

such mal im web nach "num_rows php5"

oder ist das in contenido eine eigene funktion der db-klasse?

cu
cg

Verfasst: So 17. Sep 2006, 13:23
von Dodger77
oio hat geschrieben:oder ist das in contenido eine eigene funktion der db-klasse?
Ja, siehe "conlib/mysql.inc". Die Fehlermeldung ist auf jeden Fall eigenartig.

Vielleicht hilft es, am Anfang des Moduls folgendes hinzuzufügen:

Code: Alles auswählen

$db = new DB_Contenido;

Verfasst: So 17. Sep 2006, 19:10
von JochBec
Hallo ;)

Nee es ist php 4.4.4. auf dem Server, habe extra nochmal geguckt.

Aber: der Code $db = new DB_Contenido; hat tatsächlich geholfen.

Vielen Dank!!!