Hi,
ich benutze das Modul zur Druckvorschau. FUnktioniert auch schön, allerdings habe ich beim Drucken von Suchergebnissen ein Problem. Meine Suchergebnisse, die ich zwar auf der "normalesn" Seite sehen, verschwinden in der Druckvorschau.
Woran kann das liegen?
Hier der Code meines Suchmoduls.
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 "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin: 0px\" height=\"10\">
<tr>
<form name='suche' method='POST' action='front_content.php?idcat=49'>
<td><input type=\"text\" style=\"width:120px\" name=\"suche\" value=\"$suche\"></td>
<td><INPUT type=\"image\" src=\"images/finden.gif\" valign=\"bottom\"></td>
</form>
</tr>
</table>";
?>
Die Ausgabeseite der Suche sieht so aus:
Code: Alles auswählen
<html>
<head>
<LINK REL="STYLESHEET" HREF="css/xxx.css" TYPE="text/css">
<title></title>
</head>
<body>
<table width="100%" height="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top">
<table width="795" class="content" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td height="25" align="right">
<table>
<tr>
<td>CMS_CONTAINER[1]</td>
<td>CMS_CONTAINER[11]</td>
<td><!-- Suche -->CMS_CONTAINER[10]<!-- Ende Suche --></td>
</tr>
</table>
</td>
[b]<!-- #PRINT --> [/b]
<tr>
<td valign="top" height="169"><img src="upload/website/images/dummy.jpg" width="794" height="169" border="0"></td>
</tr>
<tr>
<td height="35" valign="middle">CMS_CONTAINER[3]</td>
</tr>
<tr>
<td valign="top" height="1" style="background-color: white"><img src="upload/website/images/1px_w.gif" width="1" height="1"></td>
</tr>
<tr>
<td valign="middle" height="25">CMS_CONTAINER[4]</td>
</tr>
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" border="0" width="795">
<tr>
<td> </td>
</tr>
<tr>
<td class="header" valign="top">CMS_CONTAINER[12]</td>
</tr>
<tr>
<td class="inhalt"><p>
<?php
echo "<table border=0 cellpadding=0 cellspacing=0>";
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);
for ($i=0; $i<count($hits); $i++){
echo "<tr><td align=left class=inhalt><font size=\"-1\"><a href=\"".$results[$i][link]."\"";
echo ">".$results[$i][title]."</a></font>(".$hits[$i]." Treffer)<BR>";
echo $results[$i][text]."</span></td></tr>";
};
} else { echo "<tr><td class='inhalt' align=center>Keine passenden Seiten gefunden</td></tr>"; };
} else { echo "<tr><td class='inhalt' align=center>Keine passenden Seiten gefunden</td></tr>"; };
};
echo "</table>";
?>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
[b]<!-- ##PRINT --> [/b]
</table>
</body>
</html>