ich bins mal wieder mit einem weiterem Problem.
Habe das Standartmodul aus der Con 4.8.5 Version benutzt und in meine
Templates eingefügt. Alles ging prima, bis ich das Layout noch etwas modifizierte. Danach zeigte der Container für News nichts mehr an.
Habe das Layout dann wieder zurückgestellt, aber das Modul ist immernoch
nicht zu sehen. Ist vielleicht am Code was falsch, da ich ja das Layout wieder benutze, wo es zu Anfang ja ging.
INPUT
Code: Alles auswählen
?><?php
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : News
* Author(s) : Andreas Lindner, 4fb
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 12.08.2005
************************************************/
#Select category
$cms_idcat = "CMS_VALUE[1]";
echo '<table cellpadding="0" cellspacing="0" border="0">';
echo '
<tr><td class="text_medium" style="padding:5px">Kategorie wählen: </td></tr>
<tr><td class="text_medium" style="padding:5px">';
echo buildCategorySelect("CMS_VAR[1]", "CMS_VALUE[1]");
echo ' <input type="image" src="images/submit.gif">';
echo '</td></tr>';
#Select sort field and sort order
$sortdate = 'checked';
$cms_imgsize = "CMS_VALUE[14]";
$cms_limit_articles = "CMS_VALUE[15]";
$cms_sort_direction = "CMS_VALUE[16]";
if ("CMS_VALUE[17]" != '') {
$cms_include_start_article = ' checked';
} else {
$cms_include_start_article = '';
}
if ("CMS_VALUE[3]" == 'sortdate') {
$sortdate = 'checked';
$sortnum = '';
}
elseif ("CMS_VALUE[3]" == 'sortnum') {
$sortdate = '';
$sortnum = 'checked';
}
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Sortierung nach Datum").':</td>
<td style="padding:5px;"><input type="radio" name="CMS_VAR[3]" value="sortdate" '.$sortdate.'></td>
</tr>
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Sortierung nach Nummer").':</td>
<td style="padding:5px;"><input type="radio" name="CMS_VAR[3]" value="sortnum" '.$sortnum.'></td>
</tr>
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Sortierung aufsteigend").':</td>
<td style="padding:5px;">';
if (strtolower($cms_sort_direction) == 'desc') {
echo '<input type="radio" name="CMS_VAR[16]" value="asc"/>';
} else {
echo '<input type="radio" name="CMS_VAR[16]" value="asc" checked/>';
}
echo '</td>
</tr>
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Sortierung absteigend").':</td>
<td style="padding:5px;">';
if (strtolower($cms_sort_direction) == 'desc') {
echo '<input type="radio" name="CMS_VAR[16]" value="desc" checked/>';
} else {
echo '<input type="radio" name="CMS_VAR[16]" value="desc"/>';
}
echo '</td>
</tr>';
$noimg = '';
if ("CMS_VALUE[13]" == 'true') {
$noimg = 'checked';
}
#Headline
echo '
<tr><td class="text_medium" style="padding:5px;">'.mi18n("Überschrift").': </td></tr>
<tr><td style="padding:5px;"><input type="text" name="CMS_VAR[4]" value="CMS_VALUE[4]"></td></tr>
<tr>
<td colspan="2" class="text_medium" style="padding:5px;"><b><u>'.mi18n("Bild für Teaser").':</u></b></td>
</tr>
<tr>
<td colspan="2" class="text_medium" style="padding:5px;">'.mi18n("Es wird das erste Bild des Artikels angezeigt.").'</td>
</tr>';
#Image width
echo '
<tr><td class="text_medium" style="padding:5px;">'.mi18n("Bildbreite").': </td></tr>
<tr><td style="padding:5px;"><input type="text" name="CMS_VAR[14]" value="'.$cms_imgsize.'" maxlength="3"></td></tr>';
#Disable images
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Kein Bild anzeigen").':</td>
<td style="padding:5px;"><input type="checkbox" name="CMS_VAR[13]" value="true" '.$noimg.'></td>
</tr>';
#Number of articles
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Anzahl Artikel begrenzen").':</td>
<td style="padding:5px;"><input type="text" name="CMS_VAR[15]" value="'.$cms_limit_articles.'"></td>
</tr>';
#Include start article
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Startartikel in Liste einbeziehen").':</td>
<td style="padding:5px;"><input type="text" name="CMS_VAR[17]" value="yes"'.$cms_include_start_article.'></td>
</tr>';
echo '</table>';
?><?php
OUTPUT
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : News
* Author(s) : Andreas Lindner, 4fb
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 12.08.2005
************************************************/
cInclude('classes', 'class.article.php');
cInclude('includes', 'functions.api.string.php');
cInclude('includes', 'functions.api.images.php');
if (!is_object($tpl)) {
$tpl = new Template;
}
$tpl->reset();
$sql = "SELECT
htmlpath, frontendpath
FROM
".$cfg["tab"]["clients"]."
WHERE
idclient = ".$client." ";
$db->query($sql);
if ($db->next_record()) {
$htmlpath = $db->f('htmlpath');
$frontendpath = $db->f('frontendpath');
}
// selected category
$selcat = "CMS_VALUE[1]";
//echo "sel $selcat<br>";
$template = "teaser-standard.html";
//echo "tpl $template<br>";
// anzahl der zeichen text
$mxtext = 200;
$limit = "CMS_VALUE[15]";
$cms_sort_direction = "CMS_VALUE[16]";
if ($cms_sort_direction == '') {
$cms_sort_direction = 'desc';
}
if ("CMS_VALUE[3]" == "sortdate") {
$order = 'lastmodified';
} else {
$order = 'artsort';
}
$newsheadline = "CMS_VALUE[4]";
$tpl->set('s', 'TITLE', $newsheadline);
if (strlen($selcat) > 0 AND $selcat != '0') {
$options = array ('idcat' => $selcat, "start" => false, "order" => $order, "direction" => $cms_sort_direction);
$list = new ArticleCollection($options);
$count = $list->count;
if ($count > 0) {
if (is_numeric($limit) AND strlen($limit) > 0) {
if ($limit < $list->count) {
$limit_art = $limit;
} else {
$limit_art = $list->count;
}
} else {
$limit_art = $list->count;
}
for ($i = 0; $i < $limit_art; $i ++) {
$article = $list->nextArticle();
$article_id = $article->getField('idart');
$teaser_img = '';
if ($noimg != 'true') {
$text_html = $article->getContent('CMS_HTML', 1);
$regEx = "/<img[^>]*?>.*?/i";
$match = array ();
preg_match($regEx, $text_html, $match);
$regEx = "/(src)(=)(['\"]?)([^\"']*)(['\"]?)/i";
$img = array ();
preg_match($regEx, $match[0], $img);
$img_src = preg_split("/\//", $img[0]);
$img_name = $img_src[count($img_src) - 1];
$img_name = preg_replace("/\"/", "", $img_name);
$img_split = preg_split("/\./", $img_name);
$img_type = $img_split[count($img_split) - 1];
$img_split2 = preg_split("/_/", $img_split[0]);
$name = $img_name;
if (count($img_split2) > 1) {
$img_x = $img_split2[count($img_split2) - 1];
$img_y = $img_split2[count($img_split2) - 2];
if (is_numeric($img_x) AND is_numeric($img_y)) {
$suffix = "_".$img_x."_".$img_y.".".$img_type;
$name = preg_replace("/$suffix/", "", $img_name);
$name = $name.".[a-zA-Z]{3}";
}
}
$img_teaser = '';
if (strlen($name) > 0) {
$sql = "SELECT
*
FROM
".$cfg["tab"]["upl"]."
WHERE
filename REGEXP '$name' ";
//echo "<pre>"; print_r($sql); echo "</pre>";
$db->query($sql);
if ($db->next_record()) {
$filename = $db->f('filename');
$dirname = $db->f('dirname');
}
$img_path = $cfgClient[$client]["upl"]["path"].$dirname.$filename;
$img_size = "CMS_VALUE[14]";
$img_teaser = capiImgScale($img_path, $img_size, $img_size, $crop = false, $expand = false, $cacheTime = 1000, $wantHQ = false);
} // end if strlen
if (strlen($img_teaser) > 0) {
$teaser_img = '<img src="'.$img_teaser.'" class="teaser_img">';
} else {
$teaser_img = '';
}
} // end if noimg
$headline = strip_tags($article->getContent('CMS_HTMLHEAD', 1));
$headline = str_replace($replace, " ", $headline);
/* $subheadline = strip_tags($article->getContent('CMS_HTMLHEAD', 2));
$subheadline = str_replace($replace, " ", $subheadline);*/
$teaserheadline = /*$subheadline." - ".*/
$headline;
$href = $sess->url("front_content.php?idcat=$selcat&idart=$article_id");
$teasertext = $article->getField('summary');
if (strlen(trim($teasertext)) == 0) {
$teasertext = strip_tags($article->getContent('CMS_HTML', 1));
$teasertext2 = $teasertext;
$teasertext = capiStrTrimAfterWord($teasertext, $mxtext);
if ($teasertext!=$teasertext2) {
$teasertext.= '...';
}
} // end if
$teasertext = $teasertext." ";
$tpl->set('d', 'HEADLINE', $teaserheadline);
$tpl->set('d', 'TEXT', $teasertext);
$tpl->set('d', 'HREF', $href);
$tpl->set('d', 'IMG', $teaser_img);
$tpl->set('d', 'MORE', mi18n("mehr"));
$tpl->next();
} // end for
$tpl->generate('templates/'.$template);
}
}
?>
Beide Lämpchen stehen auf grün.
PS: Ich kann euch leider keinen Zugang geben, da das Projekt lokal läuft.
Wäre toll wenn jemand mal schauen könnte obs am Code liegt.
Habe hier noch den HTML - Quelltext meines einfachen Layout's:
LAYOUT
Code: Alles auswählen
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
<!--
.Stil3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: x-small;
color: #FFFFFF;
}
.Stil6 {font-size: 9px}
.Stil7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; }
.Stil10 {font-size: 10px}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
a:link {
text-decoration: none;
}
.Stil13 {
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Stil14 {color: #FFCC99}
-->
</style>
</head>
<body>
<table width="933" cellspacing="1" cellpadding="2" bgcolor="#990000" border="0" height="428" align="center">
<tr>
<td height="10" colspan="3" align="center" valign="middle" bgcolor="#990000"><table width="226" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td height="12"><div align="right" class="Stil14"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> CMS_CONTAINER[11]</font></div></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="160" valign="top"><table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td bgcolor="#990000" class="Stil6"><span class="Stil3">:: Rubriken </span></td>
</tr>
<tr>
<td><container id="1" name="Navigation" types="Navigation" default="Navigation">Navigation</container> </td>
</tr>
</table>
<br />
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td bgcolor="#990000" class="Stil3"><span class="Stil6">:: </span>Schnellsuche</td>
</tr>
<tr>
<td><div align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">CMS_CONTAINER[3]</font></div></td>
</tr>
</table>
<br />
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td bgcolor="#990000" class="Stil3"><span class="Stil6">:: </span>Login</td>
</tr>
<tr>
<td height="16" valign="top"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">CMS_CONTAINER[12]</font></td>
</tr>
</table></td>
<td width="570" valign="top"><table width="540" border="0" align="center" cellpadding="5" cellspacing="5">
<tr>
<td width="49%" valign="top" class="Stil7">CMS_CONTAINER[5]</td>
<td width="51%" valign="top" class="Stil7">CMS_CONTAINER[6]<br />
<br />
CMS_CONTAINER[7]<br />
<br />
CMS_CONTAINER[8]</td>
</tr>
<tr>
<td colspan="2"><span class="Stil13">Neuigkeiten aus dem Gemeindeleben </span></td>
</tr>
</table>
<table width="540" border="0" align="center" cellpadding="5" cellspacing="5">
<tr>
<td width="100%" valign="top"><span class="Stil10"><span class="Stil7">CMS_CONTAINER[9]</span></span></td>
</tr>
<tr>
<td valign="top"><span class="Stil10"><span class="Stil7">CMS_CONTAINER[10]</span></span></td>
</tr>
</table></td>
<td width="187" valign="top"><table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td bgcolor="#990000"><span class="Stil3"><span class="Stil6">:: </span>Aktuelle Veranstaltungen </span></td>
</tr>
<tr>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">CMS_CONTAINER[2]</font></td>
</tr>
</table>
<br />
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td bgcolor="#990000" class="Stil3"><span class="Stil6">:: </span>Spendenkonto & Aufrufe </td>
</tr>
<tr>
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">CMS_CONTAINER[4]</font></td>
</tr>
<tr>
<td valign="top"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">CMS_CONTAINER[13]</font></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23" colspan="3" bgcolor="#990000"><div align="center"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><font color="#FFFFFF">Copyright
2006 © Evang.-Luth. Kirchgemeinde "St. Jakobus" Ilmenau<br />
Erstellt von:<b> [AK]</b>-Zent Werbeagentur<font color="#990000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"> - Weimarer Straße 15, D-98693 Ilmenau</font></font></font></font></font><br />
</div></td>
</tr>
</table>
</body>
</html>
Viele Grüße und schonmal ein schönes Wochenend

MFG Matze