[11-Aug-2006 15:02:54] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in F:\web_gcc\ibu_cms_neu\cms\front_content.php(793) : eval()'d code on line 33
[11-Aug-2006 15:02:54] PHP Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in F:\web_gcc\ibu_cms_neu\cms\front_content.php(793) : eval()'d code on line 39
[11-Aug-2006 15:04:03] /cms/front_content.php?idcat=848 MySQL error 2006: MySQL server has gone away
Der Fehler tritt nur auf, sobald im Eingabefeld der textHMTL sehr viel Text oder extrem komplexe Tabellen eingefügt werden. In Frontend äußert sich der Fehler, indem man auf die Startseite geleitet wird (Die Kategorie kann nicht mehr angezeigt werden).
Na ja, dass Modul, dass ich hier benutze ist recht komplex und zum Teil selbst geschrieben. Vielleicht findet jemand den Fehler.
Was macht das Modul?
Der Benutzer kann in der Artikel- und Kategoriekonfiguration aus 5 "Modulen" wählen:
- Text& Bildmodul
Navigationsmodul
Listenmodul
Downloadmodul
Newsteasermodul
Code: Alles auswählen
echo '<table cellspacing="0" cellpadding="10" border="0">';
// Modul wählen (CMS_VALUE[0])
$modul = "CMS_VALUE[0]";
echo '<tr><td>Modul wählen: </td>';
echo '<td><select size=\"40\" name="CMS_VAR[0]">';
echo "<option value=\"--- kein ---\" selected=\"selected\""; if ("CMS_VALUE[0]" == "--- kein ---") {echo "selected=selected";} echo ">--- kein ---</option>";
echo "<option value=\"Text/Bild Modul 1\""; if ("CMS_VALUE[0]" == "Text/Bild Modul 1") {echo "selected=selected";} echo ">Text/Bild Modul 1</option>";
echo "<option value=\"Text/Bild Modul 2\""; if ("CMS_VALUE[0]" == "Text/Bild Modul 2") {echo "selected=selected";} echo ">Text/Bild Modul 2</option>";
echo "<option value=\"Text/Bild Modul 3\""; if ("CMS_VALUE[0]" == "Text/Bild Modul 3") {echo "selected=selected";} echo ">Text/Bild Modul 3</option>";
echo "<option value=\"Text/Bild Modul 4\""; if ("CMS_VALUE[0]" == "Text/Bild Modul 4") {echo "selected=selected";} echo ">Text/Bild Modul 4</option>";
echo "<option value=\"Navigations Modul\""; if ("CMS_VALUE[0]" == "Navigations Modul") {echo "selected=selected";} echo ">Navigations Modul</option>";
echo "<option value=\"Download Modul\""; if ("CMS_VALUE[0]" == "Download Modul") {echo "selected=selected";} echo ">Download Modul</option>";
echo "<option value=\"Linklisten Modul\""; if ("CMS_VALUE[0]" == "Linklisten Modul") {echo "selected=selected";} echo ">Linklisten Modul</option>";
echo "<option value=\"Newsteaser Modul\""; if ("CMS_VALUE[0]" == "Newsteaser Modul") {echo "selected=selected";} echo ">Newsteaser Modul</option>";
echo "</select><br>"; if ($modul == "--- kein ---" Or $modul == "") { echo 'Wählen Sie Ihr Modul und schicken Sie das Formular ab.<br>Weitere Einstellungsmöglichkeiten werden sichtbar.';} echo '</td></tr>';
// Text/Bild Modul 1 (CMS_VALUE[1], CMS_VALUE[2], CMS_VALUE[3]) -----------------------------------------
if ($modul == "Text/Bild Modul 1") {
echo '<tr><td width = "100">Headline Farbe:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[1]\" VALUE=\"Mag\" checked=\"checked\"";
if ("CMS_VALUE[1]" == "Mag") {
echo "checked=checked";
}
echo "> Magenta
<input type=\"radio\" name=\"CMS_VAR[1]\" value=\"Grey\"";
if ("CMS_VALUE[1]" == "Grey") {
echo "checked=checked";
}
echo "> Grau ";
echo "</td></tr>";
echo '<tr><td width = "100">Headline Text:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[2]\" VALUE=\"CMS_VALUE[2]\"><br>(Keine Angabe, Ausgabe des Seitentitel des Artikel)";
echo "</td></tr>";
// Bild wählen
$bild = "CMS_VALUE[3]";
echo "<tr>
<td width=\"120\">Bild wählen:</td>
<td><select name=\"CMS_VAR[3]\" size=\"1\">";
echo "<option value=\"kein\">--- kein ---</option>";
$db = new DB_Contenido;
$query = "SELECT DISTINCT dirname, filename, filetype FROM ".$cfg["tab"]["upl"]." HAVING (filetype = 'jpg' Or filetype = 'png' Or filetype = 'gif' Or filetype = 'tif' Or filetype = 'bmp') ORDER BY dirname ASC";
$db->query($query);
while ($db->next_record()) { ?> <option value="<?php echo $db->f("dirname").$db->f("filename") ?>"
<?php if ($bild == $db->f("dirname").$db->f("filename")) echo " selected" ?>><?php echo $db->f("dirname").$db->f("filename") ?></option>
<?php
}
echo "</select><br>(Keine Angabe, kein Bild)</td></tr>";
}
// Text/Bild Modul 2 (CMS_VALUE[4], CMS_VALUE[5], CMS_VALUE[6])-------------------------------------------------------------
if ($modul == "Text/Bild Modul 2") {
echo '<tr><td width = "100">Headline Farbe:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[4]\" VALUE=\"Mag\" checked=\"checked\"";
if ("CMS_VALUE[4]" == "Mag") {
echo "checked=checked";
}
echo "> Magenta
<input type=\"radio\" name=\"CMS_VAR[4]\" value=\"Grey\"";
if ("CMS_VALUE[4]" == "Grey") {
echo "checked=checked";
}
echo "> Grau ";
echo "</td></tr>";
echo '<tr><td width = "100">Headline Text:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[5]\" VALUE=\"CMS_VALUE[5]\"><br>(Keine Angabe, Ausgabe des Seitentitel des Artikel)";
echo "</td></tr>";
// Bild wählen
$bild = "CMS_VALUE[6]";
echo "<tr>
<td width=\"120\">Bild wählen:</td>
<td><select name=\"CMS_VAR[6]\" size=\"1\">";
echo "<option value=\"kein\">--- kein ---</option>";
$db = new DB_Contenido;
$query = "SELECT DISTINCT dirname, filename, filetype FROM ".$cfg["tab"]["upl"]." HAVING (filetype = 'jpg' Or filetype = 'png' Or filetype = 'gif' Or filetype = 'tif' Or filetype = 'bmp') ORDER BY dirname ASC";
$db->query($query);
while ($db->next_record()) { ?> <option value="<?php echo $db->f("dirname").$db->f("filename") ?>"
<?php if ($bild == $db->f("dirname").$db->f("filename")) echo " selected" ?>><?php echo $db->f("dirname").$db->f("filename") ?></option>
<?php
}
echo "</select><br>(Keine Angabe, kein Bild)</td></tr>";
}
// Text/Bild Modul 3 (CMS_VALUE[7], CMS_VALUE[8], CMS_VALUE[9]) -----------------------------------------
if ($modul == "Text/Bild Modul 3") {
echo '<tr><td width = "100">Headline Farbe:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[7]\" VALUE=\"Mag\" checked=\"checked\"";
if ("CMS_VALUE[7]" == "Mag") {
echo "checked=checked";
}
echo "> Magenta
<input type=\"radio\" name=\"CMS_VAR[7]\" value=\"Grey\"";
if ("CMS_VALUE[7]" == "Grey") {
echo "checked=checked";
}
echo "> Grau ";
echo "</td></tr>";
echo '<tr><td width = "100">Headline Text:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[8]\" VALUE=\"CMS_VALUE[8]\"><br>(Keine Angabe, Ausgabe des Seitentitel des Artikel)";
echo "</td></tr>";
// Bild wählen
$bild = "CMS_VALUE[9]";
echo "<tr>
<td width=\"120\">Bild wählen:</td>
<td><select name=\"CMS_VAR[9]\" size=\"1\">";
echo "<option value=\"kein\">--- kein ---</option>";
$db = new DB_Contenido;
$query = "SELECT DISTINCT dirname, filename, filetype FROM ".$cfg["tab"]["upl"]." HAVING (filetype = 'jpg' Or filetype = 'png' Or filetype = 'gif' Or filetype = 'tif' Or filetype = 'bmp') ORDER BY dirname ASC";
$db->query($query);
while ($db->next_record()) { ?> <option value="<?php echo $db->f("dirname").$db->f("filename") ?>"
<?php if ($bild == $db->f("dirname").$db->f("filename")) echo " selected" ?>><?php echo $db->f("dirname").$db->f("filename") ?></option>
<?php
}
echo "</select><br>(Keine Angabe, kein Bild)</td></tr>";
}
// Text/Bild Modul 4 (CMS_VALUE[10], CMS_VALUE[11], CMS_VALUE[12]) -------------------------------------
if ($modul == "Text/Bild Modul 4") {
echo '<tr><td width = "100">Headline Farbe:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[10]\" VALUE=\"Mag\" checked=\"checked\"";
if ("CMS_VALUE[10]" == "Mag") {
echo "checked=checked";
}
echo "> Magenta
<input type=\"radio\" name=\"CMS_VAR[10]\" value=\"Grey\"";
if ("CMS_VALUE[10]" == "Grey") {
echo "checked=checked";
}
echo "> Grau ";
echo "</td></tr>";
echo '<tr><td width = "100">Headline Text:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[11]\" VALUE=\"CMS_VALUE[11]\"><br>(Keine Angabe, Ausgabe des Seitentitel des Artikel)";
echo "</td></tr>";
// Bild wählen
$bild = "CMS_VALUE[12]";
echo "<tr>
<td width=\"120\">Bild wählen:</td>
<td><select name=\"CMS_VAR[12]\" size=\"1\">";
echo "<option value=\"kein\">--- kein ---</option>";
$db = new DB_Contenido;
$query = "SELECT DISTINCT dirname, filename, filetype FROM ".$cfg["tab"]["upl"]." HAVING (filetype = 'jpg' Or filetype = 'png' Or filetype = 'gif' Or filetype = 'tif' Or filetype = 'bmp') ORDER BY dirname ASC";
$db->query($query);
while ($db->next_record()) { ?> <option value="<?php echo $db->f("dirname").$db->f("filename") ?>"
<?php if ($bild == $db->f("dirname").$db->f("filename")) echo " selected" ?>><?php echo $db->f("dirname").$db->f("filename") ?></option>
<?php
}
echo "</select><br>(Keine Angabe, kein Bild)</td></tr>";
}
// Navigationsmodul CMS_VALUE[26], CMS_VALUE[27] ----------------------------------------------------------------------------------
if ($modul == "Navigations Modul") {
echo '<td width = "100">Navigationsmodul:</td><td>Funktioniert nur <u>ab</u> Navigationsebene 3!!!</td></tr>';
echo '<tr><td width = "100">Headline Farbe:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[26]\" VALUE=\"Mag\" checked=\"checked\"";
if ("CMS_VALUE[26]" == "Mag") {
echo "checked=checked";
}
echo "> Magenta
<input type=\"radio\" name=\"CMS_VAR[26]\" value=\"Grey\"";
if ("CMS_VALUE[26]" == "Grey") {
echo "checked=checked";
}
echo "> Grau ";
echo "</td></tr>";
echo '<tr><td width = "100">Headline Text:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[27]\" VALUE=\"CMS_VALUE[27]\"><br>(Keine Angabe, kein Headline Text)";
echo "</td></tr>";
}
// Download Modul (CMS_VALUE[13], CMS_VALUE[14], CMS_VALUE[15], CMS_VALUE[16] ---------------------------------------------
if ($modul == "Download Modul") {
echo '<tr><td width = "100">Headline Farbe:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[13]\" VALUE=\"Mag\" checked=\"checked\"";
if ("CMS_VALUE[13]" == "Mag") {
echo "checked=checked";
}
echo "> Magenta
<input type=\"radio\" name=\"CMS_VAR[13]\" value=\"Grey\"";
if ("CMS_VALUE[13]" == "Grey") {
echo "checked=checked";
}
echo "> Grau ";
echo "</td></tr>";
echo '<tr><td width = "100">Headline Text:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[14]\" VALUE=\"CMS_VALUE[14]\"><br>(Keine Angabe, kein Headline Text)";
echo "</td></tr>";
$download = "CMS_VALUE[15]";
echo "<tr>
<td width=\"120\">Ordner wählen:</td>
<td><select name=\"CMS_VAR[15]\" size=\"1\">";
echo "<option value=\"kein\">--- kein ---</option>";
$db = new DB_Contenido;
$query = "SELECT DISTINCT dirname FROM ".$cfg["tab"]["upl"]." ORDER BY dirname ASC";
$db->query($query);
while ($db->next_record()) { ?> <option value="<?php echo $db->f("dirname") ?>"
<?php if ($download == $db->f("dirname")) echo " selected" ?>><?php echo $db->f("dirname") ?></option>
<?php
}
echo "</select></td></tr>";
echo '<tr><td width = "100">Ordnen:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[16]\" VALUE=\"filename\" checked=\"checked\"";
if ("CMS_VALUE[16]" == "filename") {
echo "checked=checked";
}
echo "> Alphabetisch <input type=\"radio\" name=\"CMS_VAR[16]\" value=\"lastmodified\"";
if ("CMS_VALUE[16]" == "lastmodified") {
echo "checked=checked";
}
echo "> Neuste oben ";
echo "</td></tr>";
}
// Linklisten Modul (CMS_VALUE[17], CMS_VALUE[18], CMS_VALUE[19], CMS_VALUE[20], CMS_VAR[28]---------------------------------------------
if ($modul == "Linklisten Modul") {
echo '<tr><td width = "100">Headline Farbe:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[17]\" VALUE=\"Mag\" checked=\"checked\"";
if ("CMS_VALUE[17]" == "Mag") {
echo "checked=checked";
}
echo "> Magenta
<input type=\"radio\" name=\"CMS_VAR[17]\" value=\"Grey\"";
if ("CMS_VALUE[17]" == "Grey") {
echo "checked=checked";
}
echo "> Grau ";
echo "</td></tr>";
echo '<tr><td width = "100">Headline Text:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[18]\" VALUE=\"CMS_VALUE[18]\"><br>(Keine Angabe, kein Headline Text)";
echo "</td></tr>";
$cat = "CMS_VALUE[19]";
echo "<tr>
<td width=\"120\">Kategorie wählen:</td>
<td><select name=\"CMS_VAR[19]\" size=\"1\">";
echo "<option value=\"kein\">--- kein ---</option>";
$db = new DB_Contenido;
$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' ".
" ORDER BY A.idtree";
$db->query($query);
while ($db->next_record()) {
$spaces = "|";
$levels = $db->f("level");
for ($i = 0; $i < $levels; $i ++) {$spaces = $spaces . "--";} // end for
$spaces .= ">";
if ($levels == 1) {$spacestop = " ------------------------------------>";} else {$spacestop = "";}
if ($cat == $db->f("idcat")) {
echo "<option selected=\"selected\" value=\"".$db->f("idcat")."\">".$spaces.$db->f("name").$spacestop."</option>";
} else {
echo "<option value=\"".$db->f("idcat") ."\">". $spaces . $db->f("name").$spacestop ."</option>";
} // end if
} // end while
echo "</select>";
echo "</td></tr>";
echo '<tr><td width = "100">Zuordnungsnummer für Artikel wählen:</td>';
echo "<td><INPUT size=\"5\" TYPE=\"text\" NAME=\"CMS_VAR[28]\" VALUE=\"CMS_VALUE[28]\"><br>(Tragen Sie hier die Nummer dieses Containers ein -> Siehe oben)";
echo "</td></tr>";
echo '<tr><td width = "100">Sortieren:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[20]\" VALUE=\"title\" checked=\"checked\"";
if ("CMS_VALUE[20]" == "title") {
echo "checked=checked";
}
echo "> Alphabetisch <input type=\"radio\" name=\"CMS_VAR[20]\" value=\"lastmodified\"";
if ("CMS_VALUE[20]" == "lastmodified") {
echo "checked=checked";
}
echo "> Neuste zuerst ";
echo "<input type=\"radio\" name=\"CMS_VAR[20]\" value=\"artsort\"";
if ("CMS_VALUE[20]" == "artsort") {
echo "checked=checked";
}
echo "> nach Sortierungsschlüssel ";
echo "</td></tr>";
}
// Newsteaser Modul (CMS_VALUE[17], CMS_VALUE[18], CMS_VALUE[19], CMS_VALUE[20], CMS_Value[25] ---------------------------------------------
if ($modul == "Newsteaser Modul") {
echo '<tr><td width = "100">Headline Farbe:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[17]\" VALUE=\"Mag\" checked=\"checked\"";
if ("CMS_VALUE[17]" == "Mag") {
echo "checked=checked";
}
echo "> Magenta
<input type=\"radio\" name=\"CMS_VAR[17]\" value=\"Grey\"";
if ("CMS_VALUE[17]" == "Grey") {
echo "checked=checked";
}
echo "> Grau ";
echo "</td></tr>";
echo '<tr><td width = "100">Headline Text:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[18]\" VALUE=\"CMS_VALUE[18]\"><br>(Keine Angabe, kein Headline Text)";
echo "</td></tr>";
$cat = "CMS_VALUE[19]";
echo "<tr>
<td width=\"120\">Kategorie wählen:</td>
<td><select name=\"CMS_VAR[19]\" size=\"1\">";
echo "<option value=\"kein\">--- kein ---</option>";
$db = new DB_Contenido;
$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";
$db->query($query);
while ($db->next_record()) {
$spaces = "|";
$levels = $db->f("level");
for ($i = 0; $i < $levels; $i ++) {$spaces = $spaces . "--";} // end for
$spaces .= ">";
if ($cat == $db->f("idcat")) {
echo "<option selected=\"selected\" value=\"".$db->f("idcat")."\">".$spaces.$db->f("name")."</option>";
} else {
echo "<option value=\"".$db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";
} // end if
} // end while
echo "</select>";
echo "</td></tr>";
echo '<tr><td width = "100">Ordnen:</td>';
echo "<td><INPUT TYPE=\"radio\" NAME=\"CMS_VAR[20]\" VALUE=\"title\" checked=\"checked\"";
if ("CMS_VALUE[20]" == "title") {
echo "checked=checked";
}
echo "> Alphabetisch <input type=\"radio\" name=\"CMS_VAR[20]\" value=\"published\"";
if ("CMS_VALUE[20]" == "published") {
echo "checked=checked";
}
echo "> Neuste zuerst ";
echo "<input type=\"radio\" name=\"CMS_VAR[20]\" value=\"artsort\"";
if ("CMS_VALUE[20]" == "artsort") {
echo "checked=checked";
}
echo "> nach Sortierungsschlüssel ";
echo "</td></tr>";
echo '<tr><td width = "100">Anzahl Artikel:</td>';
echo "<td><INPUT size=\"40\" TYPE=\"text\" NAME=\"CMS_VAR[25]\" VALUE=\"CMS_VALUE[25]\"><br>(Keine Angabe, 5 Artikel)";
echo "</td></tr>";
}
echo "</table>";
Code: Alles auswählen
<?php
$db = new db_contenido;
$db2 = new db_contenido;
// ausgewähltes Modul
$modul = "CMS_VALUE[0]";
if ($modul == "Text/Bild Modul 1") { $x=0; $y=0; }
if ($modul == "Text/Bild Modul 2") { $x=0; $y=1; }
if ($modul == "Text/Bild Modul 3") { $x=0; $y=2; }
if ($modul == "Text/Bild Modul 4") { $x=0; $y=3; }
if ($modul == "Navigations Modul") { $x=4; }
if ($modul == "Download Modul") { $x=5; }
if ($modul == "Linklisten Modul") { $x=6; $y=4; }
if ($modul == "Newsteaser Modul") { $x=6; $y=5; }
if ($modul == "--- kein ---" || $modul == "" || $modul == " ") { $x=8; }
switch ($x):
case 0:
// Text/Bild Modul 1 ----------------------------------------------------------------
// CMS Variablen
if ($y == 0) {
$headlinefarbe = "CMS_VALUE[1]";
$headlinetext = "CMS_VALUE[2]";
$bildpfad = "CMS_VALUE[3]";
}
if ($y == 1) {
$headlinefarbe = "CMS_VALUE[4]";
$headlinetext = "CMS_VALUE[5]";
$bildpfad = "CMS_VALUE[6]";
}
if ($y == 2) {
$headlinefarbe = "CMS_VALUE[7]";
$headlinetext = "CMS_VALUE[8]";
$bildpfad = "CMS_VALUE[9]";
}
if ($y == 3) {
$headlinefarbe = "CMS_VALUE[10]";
$headlinetext = "CMS_VALUE[11]";
$bildpfad = "CMS_VALUE[12]";
}
if ($bildpfad == "") {$bildpfad = "kein";}
if ($headlinetext == "")
{$sql = "SELECT title FROM ".$cfg["tab"]["art_lang"]." WHERE idart=$idart AND idlang=$lang";
$db->query($sql);
$db->next_record();
$headlinetext = $db->f("title");
}
// Headline Farbe
if ($bildpfad != "kein") {
echo '<DIV class=conContentLongteaser'."$headlinefarbe".'WhiteVertSingle>';
} else {
echo '<DIV class=conContentShortteaser'."$headlinefarbe".'WhiteVertSingle>';
}
// Magenta Headline
if ($headlinetext != '') {echo '<DIV class=conTitle>'."$headlinetext".'</DIV>';}
echo '<DIV class=content>';
// Bild
if ($bildpfad != "kein") {
$bildpfad = str_replace (" ", "%20", $bildpfad);
echo "<DIV class=contentImage><img src="."upload/"."$bildpfad"."></DIV>";
}
// Normaler Text
echo '<DIV class=Text><p class="MsoNormal">';
if ($y == 0) {echo "CMS_HTML[1]";}
if ($y == 1) {echo "CMS_HTML[2]";}
if ($y == 2) {echo "CMS_HTML[3]";}
if ($y == 3) {echo "CMS_HTML[4]";}
echo '</p></div>';
echo '</div><DIV class=conFooter></DIV></div>';
break;
case 4:
// Navigations Modul --------------------------------------------------------------------------
// CMS Variablen
$headlinefarbe = "CMS_VALUE[26]";
$headlinetext = "CMS_VALUE[27]";
#System properties in use:
#Type: navigation, Name: idcat_homepage
#Contains idcat of tree to be displayed in main navigation
#Includes
cInclude("frontend", "includes/functions.navigation.php");
#hier steht das neue cInclude
cInclude("frontend", "includes/functions.hauptnavi.php");
$nav_tp = $idcat;
while($nav_tp > 0) {
$sql = "SELECT
parentid, A.idcat, A.level
FROM
".$cfg["tab"]["cat_tree"]." AS A,
".$cfg["tab"]["cat"]." AS B
WHERE
A.idcat=B.idcat AND
B.idcat ='$nav_tp'";
$db->query($sql);
$db->next_record();
$nav_tree[$db->f("level")][idcat] = $nav_tp;
$nav_tp = $db->f("parentid");
}
$kategorie2 = $nav_tree[0][idcat];
#If no tree is selected, use client setting
$start_cat = "$kategorie2";
if ($start_cat=='') {
$cApiClient = new cApiClient($client);
$start_cat = $cApiClient->getProperty('navigation','idcat_homepage');
}
if ( !is_object($db2) ) {
$db2 = new DB_Contenido;
}
if ( catIsChildOf($idcat, $start_cat) ) {
$sel_idcat = $idcat;
} else {
$sel_idcat = $start_cat;
}
/* 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;
$sql = "SELECT
A.idcat,
C.name,
C.public,
C.idcatlang
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,
a.idartlang AS idartlang
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
c.idclient = '".$client."' AND
c.idcat = b.idcat AND
a.idart = b.idart AND
a.idlang = '".$lang."'";
$db2->query($sql);
#$db2->next_record();
$flag = false;
while ($db2->next_record()&&!$flag) {
if (isStartArticle($db2->f("idartlang"), $db->f("idcat"), $lang))
{
$flag = true;
$target = ( $db2->f("ext") == 0 ) ? '_self' : '_blank';
$navitems[$db->f("idcat")] = array("idcat" => $db->f("idcat"),
"name" => $db->f("name"),
"public" => $db->f("public"),
"idcatlang" => $db->f("idcatlang"),
"target" => $target);
}
}
}
/* Create Navigation Array */
if(($sel_idcat=='')||($sel_idcat=='0')){
$cApiClient = new cApiClient($client);
$sel_idcat = $cApiClient->getProperty('navigation', 'idcat_homepage');
}
nav($sel_idcat);
/* Start Output buffer */
ob_start();
// Headline Farbe
echo '<DIV class=conContentLongteaser'."$headlinefarbe".'WhiteVertSingle>';
// Magenta Headline
if ($headlinetext != '' ) { echo '<DIV class=conTitle>'."$headlinetext".'</DIV>';}
echo '<div class="content">
<div class="noContentImage"></div>
<div class="text">
<div class="htmlLinks">';
foreach ($navitems as $key => $data) {
if (checkCatPermission($data['idcatlang'],$data['public'])) {
/* 2. Navigation level */
if (is_array($data['sub'])) {
foreach ($data['sub'] as $key => $data) {
if (checkCatPermission($data['idcatlang'],$data['public'])) {
/* 3. Navigation level */
if (is_array($data['sub'])) {
foreach ($data['sub'] as $key => $data) {
if (checkCatPermission($data['idcatlang'],$data['public'])) {
$name = $data['name'];
$target = $data['target'];
$href = $sess->url('front_content.php?idcat='.$data['idcat']);
if ($idcat == $data['idcat']) {
echo '<div class="link"><a href="'."$href".'" title="'."$name".'" target="'."$target".'"><b>'."$name".'</b></a></div>';
}elseif(is_array($data['sub'])){
echo '<div class="link"><a href="'."$href".'" title="'."$name".'" target="'."$target".'"><b>'."$name".'</b></a></div>';
} else {
echo '<div class="link"><a href="'."$href".'" title="'."$name".'" target="'."$target".'">'."$name".'</a></div>';
}
} // end if
} // end foreach
} // end if
} // end if
} // end foreach
} // end if
} // end if
} // end foreach
/* Read out buffer */
$html = ob_get_contents();
/* Clean buffer */
ob_end_clean();
/* Output buffer-contents */
echo $html;
echo '</DIV></DIV></DIV><DIV class=conFooter></DIV></DIV>';
break;
case 5:
// Download Modul ----------------------------------------------------------------
// CMS Variablen
$headlinefarbe = "CMS_VALUE[13]";
$headlinetext = "CMS_VALUE[14]";
$downloadpfad = "CMS_VALUE[15]";
if ($downloadpfad == "") {$downloadpfad = "kein";}
$sort = "CMS_VALUE[16]";
// Headline Farbe
echo '<DIV class=conContentShortteaser'."$headlinefarbe".'WhiteVertSingle>';
// Magenta Headline
if ($headlinetext != '' ) { echo '<DIV class=conTitle>'."$headlinetext".'</DIV>';}
echo '<DIV class=content>';
// Download Liste
$db = new DB_Contenido;
$query = "SELECT DISTINCT filename, dirname, filetype, lastmodified, description
FROM ".$cfg["tab"]["upl"]."
WHERE dirname = '$downloadpfad'
AND filetype != 'gif'
AND filetype != 'jpg'
AND filetype != 'psd'
AND filetype != 'tif'
AND filetype != 'jpeg'
ORDER BY '$sort' ASC";
$db->query($query);
echo '<DIV class=noContentImage></DIV><div class="linkpic"><div class="htmlLinks">';
while ($db->next_record()) {
$datapfard = "upload/"."$downloadpfad".$db->f("filename");
$datapfard = str_replace (" ", "%20", $datapfard);
$filename = $db->f("filename");
$filenamelang = $filename;
$filename = capiStrTrimHard($filename, 55);
$description = $db->f("description");
$description = urldecode($description);
if ($description == "") {$description = $filenamelang;}
if ("$datapfard" != "upload/") {
// $datasize = human_readable_size(filesize($datapfard)); // Abfrage für Dateigröße, nicht verwendet
echo '<div class="link"><div class="disk"><ul><li><A href="'."$datapfard".'" target=_blanc title="'."$description".'">'."$filename".'</A></ul></li></div></div>';
}
}
echo '</DIV></DIV></div><DIV class=conFooter></DIV></div>';
break;
case 6:
// Listen Modul ----------------------------------------------------------------
// CMS Variablen
$headlinefarbe = "CMS_VALUE[17]";
$headlinetext = "CMS_VALUE[18]";
$selcat = "CMS_VALUE[19]";
$sort = "CMS_VALUE[20]";
if ($y == "4" ) {$artlist = "CMS_VALUE[28]";}
if ($y == "5" ) {$artlist = "0";}
if ($y == "4" ) {if ($artlist == "") {$artlist = "0";}}
if ($y == "4" ) {if ($sort == "lastmodified") {$order = "DESC";} else {$order = "ASC";}}
if ($y == "5" ) {if ($sort == "published") {$order = "DESC";} else {$order = "ASC";}}
if ($sort == "artsort") {$order = "ASC";}
if ($y == "5" ) {$limit = "CMS_VALUE[25]"; if ($limit == "") {$limit = "5";}}
// Headline Farbe
if ($y == "4") {echo '<DIV class=conContentDetailsview'."$headlinefarbe".'WhiteVertSingle>';}
if ($y == "5") {echo '<DIV class=conContentShortteaser'."$headlinefarbe".'WhiteVertSingle>';}
// Magenta Headline
if ($headlinetext != '' ) {echo '<DIV class=conTitle>'."$headlinetext".'</DIV>';}
if ($y == "4" ) { echo '<DIV class=content>';}
// Artikel listen
if($selcat!="0" && $selcat!=""){
$db = new DB_Contenido;
$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'
AND ARTLANG.artlist = '$artlist'";
if ($y == "4"){ $query .= " ORDER BY ARTLANG.$sort $order";}
if ($y == "5"){ $query .= " AND CATART.is_start = '0' ORDER BY ARTLANG.$sort $order LIMIT 0, $limit";}
// 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
if (is_array($articleID)) {
if ($y == "4") {echo '<DIV class=noContentImage></DIV><div class="linkpic"><div class="htmlLinks">';}
foreach ($articleID as $key => $value) {
$sql = "SELECT title, summary, idart, external_redirect, redirect, redirect_url FROM ".$cfg["tab"]["art_lang"]." WHERE idartlang = '$value' ";
$db->query($sql);
$db->next_record();
$summary = $db->f("summary");
$title = $db->f("title");
if ($y == "4") {if ($summary == "") {$summary = $title; }}
if ($y == "4") {$title = capiStrTrimHard($title, 60);}
$idart = $db->f("idart");
$externlink = $db->f("redirect_url");
$externlinkcheck = $db->f("redirect");
if ($y == "5") {
$summary2 = $summary;
$summary = capiStrTrimAfterWord($summary, 100);
if ($summary!=$summary2) {$summary.= ' ...';}
}
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idart=$idart");
if ($y == "4") {
if ($externlinkcheck == "0") {echo '<div class="link"><A href="'."$link".'" title= "'."$title".'">'."$title".'</A></div>'; }
// Testen ob externer Link
if ($externlinkcheck == "1") {
// Testen ob Datei
if (preg_match("/upload/", $externlink) || preg_match("/renderStaticPage/", $externlink) || preg_match("/pdf/", $externlink)) {
echo '<div class="link"><div class="disk"><ul><li><A href="'."$link".'"target="_blanc" title="'."$title".'">'."$title".'</A></ul></li></div></div>';
} else {
$externlinktest = capiStrTrimHard($externlink, 7);
if ($externlinktest == "http...") {
if (substr($externlink, 0, 19) == 'http://164.28.47.91') {
$externlink = "https://164.28.47.91/cms/front_content.php?idart=4234&idcat=1165";
}
echo '<div class="link"><ul><li><A href="'."$externlink".'" title= "'."$summary".'"target="_blanc">'."$title".'</A></li></ul></div>';
} else {
echo '<div class="link"><A href="'."$externlink".'" title= "'."$summary".'">'."$title".'</A></div>';
} //endif
} //endif
} //endif
} // end y=4
if ($y == "5") {
echo '<DIV class=content>';
echo '<DIV class=noContentImage></DIV><div class="text">';
echo '<p class="MsoNormal"><span class="subHeadline">'."$title".': </span>'."$summary".' <span class="moreLink"><A href="'."$link".'" title= "'."$title".'">Mehr...</A></span></p></DIV></div>';
}
}// end foreach
if ($y == "4" ) {echo '</DIV></DIV>';}
} // end if (is_array)
} // end if ($selcat)
if ($y == "4" ) {echo '</div>';}
echo '<DIV class=conFooter></DIV></div>';
unset($selcat);
unset($artlist);
break;
case 8:
break;
default:
echo "Die Kategorie ist noch nicht konfiguriert worden!";
endswitch;
?>