Zeigt Artikel Mehrspaltig an (nur Headline)
Beispiel: http://www.topmineral.de/de/produkte/vorsatz/show.html
Ist die alte Version der Homepage diese wird zur Zeit umgesetzt auf Contenido
Kann leider kein Support geben!
INPUT
Code: Alles auswählen
?><?php
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : Artikel Mehrspaltig
* Author(s) : Andreas Lindner, 4fb, Markus Grampp
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 12.08.2005 / 27.02.2008
************************************************/
#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
$cms_limit_articles = "CMS_VALUE[15]";
# Spalten
$cms_columns = "CMS_VALUE[13]";
if ("CMS_VALUE[17]" != '') {
$cms_include_start_article = ' checked';
} else {
$cms_include_start_article = '';
}
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Sortierung von oben nach unten").':</td>
<td style="padding:5px;">';
if ("CMS_VALUE[16]" == '2') {
echo '<input type="radio" name="CMS_VAR[16]" value="2" checked/>';
} else {
echo '<input type="radio" name="CMS_VAR[16]" value="2"/>';
}
echo '</td>
</tr>
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Sortierung von links nach rechts").':</td>
<td style="padding:5px;">';
if ("CMS_VALUE[16]" == '1') {
echo '<input type="radio" name="CMS_VAR[16]" value="1" checked/>';
} else {
echo '<input type="radio" name="CMS_VAR[16]" value="1"/>';
}
echo '</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>';
#Columns
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Anzahl Spalten").':</td>
<td style="padding:5px;"><input type="text" name="CMS_VAR[13]" value="'.$cms_columns.'"></td>
</tr>';
echo '</table>';
?><?php
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Artikel Mehrspaltig
* Author(s) : Andreas Lindner, 4fb, Markus Grampp
* Copyright : Contenido - four for business, Andreas Lindner
* Created : 12.08.2005 / 27.02.2008
************************************************/
function arrayprint($ArrayContent) {
print '<pre>';
print_r ($ArrayContent);
print '</pre>';
}
cInclude('classes', 'class.article.php');
cInclude('includes', 'functions.api.string.php');
cInclude('includes', 'functions.api.images.php');
if (!is_object($tpl)) {
$tpl = new Template;
}
$column = "CMS_VALUE[13]";
$Sortierung ="1"; //1 = von links nacht rechts - 2 = von oben nach unten
$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]";
$template = "teaser-standard.html";
// anzahl der zeichen text
$mxtext = 200;
$limit = "CMS_VALUE[15]";
$Sortierung = "CMS_VALUE[16]";
if ("CMS_VALUE[3]" == "sortdate") {
$order = 'lastmodified';
} else {
$order = 'artsort';
}
// Keine Startartikel
$with_start = false;
$newsheadline = "CMS_VALUE[4]";
$tpl->set('s', 'TITLE', $newsheadline);
if (strlen($selcat) > 0 AND $selcat != '0') {
$options = array ('idcat' => $selcat, "start" => $with_start, "order" => $order );
$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');
if ($noimg != 'true') {
} // 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." ";
$TeaserArray[HEADLINE] = $teaserheadline;
$TeaserArray[TEXT] = $teasertext;
$TeaserArray[HREF] = $href;
/*
$tpl->set('d', 'HEADLINE', $teaserheadline);
$tpl->set('d', 'TEXT', $teasertext);
$tpl->set('d', 'HREF', $href);
$tpl->set('d', 'MORE', mi18n("mehr"));
$tpl->next();
*/
$TeaserCompletArray[]=$TeaserArray;
unset($TeaserArray);
} // end for
// $tpl->generate('templates/'.$template);
}
}
$Output = '<table width="100%" border="0">';
/////////////////////////////////
if ($Sortierung == 1) {
/* RECHTS LINKS*/
$SplittetArray = array_chunk($TeaserCompletArray, $column);
foreach ($SplittetArray as $Splittet1Array){
$Output .='<tr>';
foreach ($Splittet1Array as $Splittet2Array){
$Output .='<td><a href="'.$Splittet2Array[HREF].'" target="_self">'.$Splittet2Array[HEADLINE].'</a></td>';
}
$Output .='</tr>';
}
/////////////////////////////////
} else {
/*Von Oben nach unten*/
$ZeilenCounter=0;
for ($i = 0; $i < count($TeaserCompletArray); $i ++) { // Über Anzahl Artikel
$ZeilenCounter ++;
$ZeilenArray[$ZeilenCounter][] = $TeaserCompletArray[$i];
if ($ZeilenCounter >= count($TeaserCompletArray)/$column) {
$ZeilenCounter=0;
}
}// Über Anzahl Artikel ENDE
foreach ($ZeilenArray as $ZeilenArray1) {
$Output .="<tr>";
foreach ($ZeilenArray1 as $SpaltenzuHTML) {
$Output .='<td><a href="'.$SpaltenzuHTML[HREF].'" target="_self">'.$SpaltenzuHTML[HEADLINE].'</a></td>';
}
$Output .="</tr>";
}
}
/////////////////////////////////
$Output .= ' </table>';
echo $Output ;
?>