Seite 1 von 1
White screen bei Moduleinbau Artikelliste
Verfasst: Mo 22. Dez 2003, 15:07
von sepp
Hallo Leutz,
habe folgendes Problem:
wollte die Artikelliste dahingehend anpassen, das mir nur die x-neuesten Artikel angezeigt werden. Hat leider nicht geklappt und lässt sich auch nicht mehr in den Ursprungszustand zurücksetzten.
Bekomme nur noch einen weißen Bildschirm und folgende Fehlermeldung im log:
PHP Parse error: parse error, unexpected ')' in
...\front_content.php(553) : eval()'d code on line 603
habe eigentlich nur das standard-modul wieder hineinkopiert...
wäre klasse wenn mir jemand helfen könnte.
Danke schon im Voraus
Verfasst: Mo 22. Dez 2003, 15:27
von ttb
Die Fehlermeldung deutet darauf hin, dass eine Klammer zu viel bzw. unerwartet geschlossen ist.
nichts gefunden
Verfasst: Mo 22. Dez 2003, 16:16
von sepp
Danke für die schnelle Antwort,
habe die front_content.php und das Modul auf Klammern (fehlend/zu viel) gecheckt, aber noch immer nichts gefunden. Kann mir auch nicht wirklich vorstellen, dass es mit der front_content.php zu tun hat.
Mein Modul sieht folgendermassen aus:
Code: Alles auswählen
Eingabe:
/**
* Artikelliste mit I1,H1,T1
*
* Erstellt eine Liste mit allen Artikel bis
* auf den Startartikel.
*
* INPUT
*
* Author Jan Lengowski
* Copyright four for business AG
*/
// selected category
$selected = "CMS_VALUE[0]";
$checked = "CMS_VALUE[4]";
echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">
<tr valign=\"top\">
<td>Kategorie wählen:</td>
<td>
<select name=\"CMS_VAR[0]\">";
if($selected!="0" && $selected!=""){
echo"<option value=\"0\">--- kein ---</option>";
}else{
echo"<option selected=\"selected\" value=\"0\">--- kein ---</option>";
}
// fetch all categorys
$query = "SELECT A.idcat, A.level, C.name FROM ".$cfg["tab"]["cat_tree"]." AS A, ".
$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat=B.idcat ".
"AND B.idcat=C.idcat AND C.idlang='$lang' AND B.idclient='$client' ".
"AND C.visible=1 ORDER BY A.idtree";
// execute query
$db->query($query);
// loop result and build the options
while ($db->next_record()) {
// indent spacer
$spaces = "|";
// how many levels
$levels = $db->f("level");
for ($i = 0; $i < $levels; $i ++) {
// add 2 spaces for every level
$spaces = $spaces . "--";
} // end for
$spaces .= ">";
if ($selected == $db->f("idcat")) {
// selected category
echo "<option selected=\"selected\" value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";
} else {
// category
echo "<option value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";
} // end if
} // end while
echo " </select>";
echo " </td>
</tr>
<tr>
<td>Überschrift anzeigen ?</td>
<td><input type=\"checkbox\" name=\"CMS_VAR[4]\" value=\"Y\"";
if($checked) echo " checked";
echo "></td>
</tr>
<tr>
<td>Hintergrundfarbe</td>
<td><input type=\"text\" name=\"CMS_VAR[5]\" value=\"CMS_VALUE[5]\"></td>
</tr>
<tr>
<td>Randfarbe</td>
<td><input type=\"text\" name=\"CMS_VAR[6]\" value=\"CMS_VALUE[6]\"></td>
</tr>
<tr>
<td>Überschrift</td>
<td><input type=\"text\" name=\"CMS_VAR[2]\" value=\"CMS_VALUE[2]\"></td>
</tr>
<tr>
<td>Angezeigte Länge in Zeichen</td>
<td><input type=\"text\" name=\"CMS_VAR[3]\" value=\"CMS_VALUE[3]\"></td>
</tr>
</table>";
Ausgabe:
<?
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* REFERENZ MODUL / ARTIKELLISTE
*
* Artikelliste mit Img 1, Head 1, Head 2
*
* Erstellt eine Liste mit allen Artikel bis
* auf den Startartikel.
*
* Author : Jan Lengowski
* Copyright : four for business AG
* Created : 15-08-2002
* Modified : 16-08-2002
************************************************/
// second db class instance
$db2 = new DB_Contenido;
$first_line = "CMS_VALUE[4]";
// selected category
$selcat = "CMS_VALUE[0]";
if($selcat!="0" && $selcat!=""){
// select all articles in category widthout start article
$query = "SELECT ARTLANG.idart, ARTLANG.idartlang FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".
$cfg["tab"]["art_lang"]." AS ARTLANG ".
"WHERE CATART.idcat = '$selcat' AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' AND ".
"ARTLANG.online = '1' ORDER BY CATART.idart DESC";
// execute query
$db->query($query);
unset($articleID);
unset($linkID);
// get id's of sub articles
while ($db->next_record()) {
$articleID[] = $db->f("idartlang");
$linkID[] = $db->f("idart");
} // end while
// loop through subarticles
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
if($first_line == "Y")
{
echo '
<tr><td height="30" colspan="2" ></td></tr>
<tr><td height="21" width="22" style="border: 0px; border-top:1px; border-bottom:1px; border-color: CMS_VALUE[6]; border-style: solid; background-color: CMS_VALUE[5]"><img src="images/wuerfel.gif" width="22" height="21" border="0"></td>
<td width="143" style="border: 1px; border-left:0px; border-color: CMS_VALUE[6]; border-style: dashed; background-color: CMS_VALUE[5]; padding-left:10px" class="punkte">CMS_VALUE[2]</td></tr>
';
}
if (is_array($articleID)) {
foreach ($articleID as $key => $value) {
// select all CMS variables of the article
$sql = "SELECT * FROM ".$cfg["tab"]["content"]." WHERE idartlang = '$value' AND idtype = '1' AND typeid = '1'";
$db->query($sql);
$db->next_record();
$head = $db->f("value");
if ( strlen($head) > CMS_VALUE[3]) {
$head = substr($head, 0, CMS_VALUE[3]);
$head .= '..';
}
// link
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idart=$linkID[$key]&m=$m&s=$s");
echo '<tr><td colspan="2" class="text" height="22" style="border: 1px; border-top:0px; border-color: CMS_VALUE[6]; border-style: dashed; background-color: CMS_VALUE[5]; padding-left:10px"><a href="'.$link.'">'.$db->f("value").'</a></td></tr>';
} // end while
unset($headline);
unset($text);
} // end foreach
} // end if (is_array)
echo '</table><br>';
?>
WinXP
Apache : 2.0.47
PHP : 4.3.3
(minixampp)
ausser dem Modul läufts auch zufriedenstellend.
Verfasst: Di 23. Dez 2003, 16:24
von sepp
Problem gelöst....weil es eigentlich keines war.
Als Contenido-Neuling hab ich wohl den Wald vor lauter Bäumen nicht gesehen. Jetzt klingen meine Kopfschmerzen auch langsam wieder ab.
Nachdem ich den Artikeln wieder ein Template zugewiesen hab, wird auch die Artikelliste anstängig ausgegeben. Die Sortierung nach den neuesten x läuft nun auch hervorragend.
Was mir nun diese olle Fehlermeldung sagen will/wollte ignorier ich fürs Erste mal und tu so als wäre sie nicht da.