Hilfe! Fehlermeldung bei Einsatz des zweigeteilten Menüs
Verfasst: So 13. Feb 2005, 22:56
Ich setze das zweigeteilte menü ein und bekomme nach Einrichtung folgende Fehlermeldung:
Ich habe das Modul von yodatortenboxer wie beschrieben eingebunden.
Haupmenü Eingabe
Hauptmenü Ausgabe
Untermenü Ausgabe (Eingabe bleibt leer)
Hat jemand eine Idee was falsch läuft? Die Fehlermeldung erscheint nur, bei Einsatz dieser Module, lasse ich sie weg, kommt keine Fehlermeldung.
Ich habe noch keine weiteren Module außer den Standard eingebunden. Ich nutze die aktuelle Version 4.4.5
Code: Alles auswählen
Parse error: parse error, unexpected ')' in /xxx/yyy/zzz/contenido/includes/include.con_editcontent.php(571) : eval()'d code on line 292
Ich habe das Modul von yodatortenboxer wie beschrieben eingebunden.
Haupmenü Eingabe
Code: Alles auswählen
/******************************************************************
*
* CONTENIDO MODUL
*
* Hauptnavigation - als unabhängiges Modul zur Unternavigation
*
* Zwei Module werden benötigt und hier beschrieben
*
* Mit Hilfe dieser zwei Module kann man zum Beispiel
* eine Horizontale Hauptnavigation in einem Container
* und eine vertikale Unternavigation in einem anderen Container
* oder umgekehrt realisieren (oben Haupt- und links oder rechts Unternavigation.
*
* Um die Haupnnavigation oder Unternavigation horizontal einzustellen
* kopiert die nav["" | "second" | "third"]_["off" | [on].html
* nach nav["" | "second" | "third"]_h_["off" | [on].html
* (z.B. cp navsecond_off.html navsecond_h_off.html
* - liegen im Pfad .../contenido/cms/templates/) und
* schmeisst dort die Tabellen-Tags raus (die stehen jetzt schon im Modul)
*
* Orginal
* Modulname : Navigation 1.1
* Author : Jan Lengowski
* Copyright : Contenido - four for business
* Created : 15-05-2003
* Modified :26-05-2003
* Modified : by herby
* Modified : by yodatortenboxer
*
*******************************************************************
/******************************************************************
*Hauptnavigation Eingabe:
******************************************************************/
/**
* Navigation
*
* INPUT
*
* @autor Jan Lengowski <Jan.Lengowski@4fb.de>
* @copyright four for business AG 2003
*/
?>
<table cellspacing="0" cellpadding="0" cellpadding="4">
<tr>
<td class="text">Baum wählen:</td>
<td>
<select name="CMS_VAR[0]">
<option value="0">-- kein --</option>
<?php
$sql = "SELECT
A.idcat,
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 AND
A.level = '0'
ORDER BY
A.idtree";
$db->query($sql);
while ( $db->next_record() ) {
if ( "CMS_VALUE[0]" == $db->f("idcat") ) {
echo '<option selected="selected" value="'.$db->f("idcat").'">'.$db->f("name").'</option>';
} else {
echo '<option value="'.$db->f("idcat").'">'.$db->f("name").'</option>';
}
}
?>
</select>
</td>
</tr>
</table>
<?php
Code: Alles auswählen
/******************************************************************
*Hauptnavigation Ausgabe:
******************************************************************/
<?php
// Hauptnav
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Navigation 1.1
* Author : Jan Lengowski
* Copyright : Contenido - four for business
* Created : 15-05-2003
* Modified : 26-05-2003
************************************************/
if ( !is_object($db2) ) {
$db2 = new DB_Contenido;
}
/**
* Check if a category is child
* of another category
*
* @return boolean true/false
* @author Jan Lengowski <Jan.Lengowski@4fb.de>
* @copyright four for business AG 2003
*/
function catIsChildOf($id, $idparent) {
global $cfg, $client, $lang;
$db = new DB_Contenido;
$parent = $id;
while ( $parent != 0 ) {
$sql = "SELECT
a.parentid
FROM
".$cfg["tab"]["cat"]." AS a,
".$cfg["tab"]["cat_lang"]." AS b
WHERE
a.idclient = '".$client."' AND
b.idlang = '".$lang."' AND
a.idcat = b.idcat AND
a.idcat = '".$parent."'";
$db->query($sql);
$db->next_record();
$parent = $db->f("parentid");
if ($parent == $idparent) {
return true;
}
}
return false;
}
if ( catIsChildOf($idcat, CMS_VALUE[0]) ) {
$sel_idcat = $idcat;
} else {
$sel_idcat = CMS_VALUE[0];
}
/* Include Template Class */
include_once($cfg["path"]["contenido"] . 'classes/class.template.php');
/**
* Array storing alle the
* navigation data
*/
$navitems = array();
/* Template Instance */
$tpl = new Template;
/**
* Recursive function for creating
* the navigation array
* @param Int $idcat Category id
*/
function nav($idcat) {
global $navitems, $client, $lang, $cfg;
$db = new DB_Contenido;
$db2 = new DB_Contenido;
$sql = "SELECT parentid FROM ".$cfg["tab"]["cat"]." WHERE idcat = '$idcat'";
$db->query($sql);
$db->next_record();
$parentid = $db->f("parentid");
if ( $parentid == 0 ) {
if ( $idcat != CMS_VALUE[0] ){
$navitems = array();
$sql = "SELECT
A.idcat,
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
B.idclient = '$client' AND
C.idlang = '$lang' AND
C.visible = '1' AND
B.parentid = 'CMS_VALUE[0]'
ORDER
BY A.idtree";
$db->query($sql);
while ($db->next_record()) {
/* Check for external redirects... */
$sql = "SELECT
a.external_redirect AS ext
FROM
".$cfg["tab"]["art_lang"]." AS a,
".$cfg["tab"]["cat_art"]." AS b,
".$cfg["tab"]["cat"]." AS c
WHERE
b.idcat = '".$db->f("idcat")."' AND
b.is_start = '1' AND
c.idclient = '".$client."' AND
c.idcat = b.idcat AND
a.idart = b.idart AND
a.idlang = '".$lang."'";
$db2->query($sql);
$db2->next_record();
$target = ( $db2->f("ext") == 0 ) ? '_self' : '_blank';
$navitems[$db->f("idcat")] = array("idcat" => $db->f("idcat"),
"name" => $db->f("name"),
"target" => $target);
}
}
return true;
}
$sql = "SELECT
A.idcat,
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
B.idclient = '$client' AND
C.idlang = '$lang' AND
C.visible = '1' AND
B.parentid = '$parentid'
ORDER BY
A.idtree";
$db->query($sql);
while ($db->next_record()) {
/* Check for external redirects... */
$sql = "SELECT
a.external_redirect AS ext
FROM
".$cfg["tab"]["art_lang"]." AS a,
".$cfg["tab"]["cat_art"]." AS b,
".$cfg["tab"]["cat"]." AS c
WHERE
b.idcat = '".$db->f("idcat")."' AND
b.is_start = '1' AND
c.idclient = '".$client."' AND
c.idcat = b.idcat AND
a.idart = b.idart AND
a.idlang = '".$lang."'";
$db2->query($sql);
$db2->next_record();
$target = ( $db2->f("ext") == 0 ) ? '_self' : '_blank';
$tmp_nav[$db->f("idcat")] = array("idcat" => $db->f("idcat"),
"name" => $db->f("name"),
"target" => $target);
}
$tmp_nav[$idcat]["sub"] = $navitems;
$navitems = $tmp_nav;
/* Function call */
nav($parentid);
} // end function
$sql = "SELECT
A.idcat,
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
B.idclient = '$client' AND
C.idlang = '$lang' AND
C.visible = '1' AND
B.parentid = '$sel_idcat'
ORDER BY
A.idtree";
$db->query($sql);
while ( $db->next_record() ) {
/* Check for external redirects... */
$sql = "SELECT
a.external_redirect AS ext
FROM
".$cfg["tab"]["art_lang"]." AS a,
".$cfg["tab"]["cat_art"]." AS b,
".$cfg["tab"]["cat"]." AS c
WHERE
b.idcat = '".$db->f("idcat")."' AND
b.is_start = '1' AND
c.idclient = '".$client."' AND
c.idcat = b.idcat AND
a.idart = b.idart AND
a.idlang = '".$lang."'";
$db2->query($sql);
$db2->next_record();
$target = ( $db2->f("ext") == 0 ) ? '_self' : '_blank';
$navitems[$db->f("idcat")] = array("idcat" => $db->f("idcat"),
"name" => $db->f("name"),
"target" => $target);
}
/* Create Navigation Array */
nav($sel_idcat);
/* Start Output buffer */
ob_start();
echo '<table cellspacing="0" cellpadding="0" border="0"><tr><td>';
foreach ($navitems as $key => $data) {
/* 1. Navigations Ebene */
$tpl->reset();
$tpl->set('d', 'NAME', $data['name']);
$tpl->set('d', 'TARGET', $data['target']);
$tpl->set('d', 'HREF', $sess->url('front_content.php?idcat='.$data['idcat']));
$tpl->next();
if ($idcat == $data['idcat'] || is_array($data['sub'])) {
$tpl->generate('templates/navfirst_h_on.html');
} else {
$tpl->generate('templates/navfirst_h_off.html');
}
if (is_array($data['sub'])) {
$tmp_data = array();
$tmp_data = $data;
} // end if
} // end foreach
echo '</td></tr></table>';
/* Read out buffer */
$html = ob_get_contents();
/* Clean buffer */
ob_end_clean();
/* Output buffer-contents */
echo $html;
?>
Untermenü Ausgabe (Eingabe bleibt leer)
Code: Alles auswählen
/******************************************************************
*
* Unternavigation Zweites benötigtes Modul
* -abhängig von der Hauptnavigation
* -als zweites freipositionierbares Modul einsetzbar
*
******************************************************************/
/******************************************************************
* Unternavigation Eingabe: bleibt Leer
******************************************************************/
/******************************************************************
* Unternavigation Ausgabe:
******************************************************************/
<?php
if (is_array($tmp_data['sub'])) {
$data = $tmp_data;
echo '<table cellspacing="0" cellpadding="0" border="0"><tr><td>';
foreach ($data['sub'] as $key => $data) {
/* 2. Navigations Ebene */
$tpl->reset();
$tpl->set('d', 'NAME', $data['name']);
$tpl->set('d', 'TARGET', $data['target']);
$tpl->set('d', 'HREF', $sess->url('front_content.php?idcat='.$data['idcat']));
$tpl->next();
if ($idcat == $data['idcat'] || is_array($data['sub'])) {
$tpl->generate('templates/navsecond_h_on.html');
} else {
$tpl->generate('templates/navsecond_h_off.html');
}
if (is_array($data['sub'])) {
echo '<tr><td>';
foreach ($data['sub'] as $key2 => $data2) {
/* 3. Navigations Ebene */
$tpl->reset();
$tpl->set('d', 'NAME', $data2['name']);
$tpl->set('d', 'TARGET', $data2['target']);
$tpl->set('d', 'HREF', $sess->url('front_content.php?idcat='.$data2['idcat']));
$tpl->next();
if ($idcat == $data2['idcat']) {
$tpl->generate('templates/navthird_h_on.html');
} else {
$tpl->generate('templates/navthird_h_off.html');
}
} // end foreach
echo '</td></tr>';
} // end if
} // end for each
echo '</td></tr></table>';
} // end if
?>
Ich habe noch keine weiteren Module außer den Standard eingebunden. Ich nutze die aktuelle Version 4.4.5