für einen Kunden habe ich das News Modul anpassen müssen, damit die Artikel in einem Fenster unterhalb der Hauptnavigation als vertikale Laufschrift erscheinen.
Da ich den Image - Teil hier nicht benötige, habe ich ihn entfernt. Dafür kann man die Anzahl der Textzeichen nun über die Konfiguration festlegen.
Modul Laufschrift News
Input:
Code: Alles auswählen
?><?php
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname neu : News Laufschrift vertikal
* 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">'.mi18n("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_limit_articles = "CMS_VALUE[15]";
$cms_sort_direction = "CMS_VALUE[16]";
$mxtext = "CMS_VALUE[18]";
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>';
#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>';
#anzahl der zeichen text
echo '
<tr>
<td class="text_medium" style="padding:5px;">'.mi18n("Anzahl Zeichen pro Artikel (Standard 200)").':</td>
<td style="padding:5px;"><input type="text" name="CMS_VAR[18]" value="'.$mxtext.'"></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="checkbox" name="CMS_VAR[17]" value="yes"'.$cms_include_start_article.'></td>
</tr>';
echo '</table>';
?><?php
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname neu : News Laufschrift vertikal
* 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]";
// anzahl der zeichen text
$mxtext = "CMS_VALUE[18]";
if ($mxtext == '') {
$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;
}
echo '<div id="laufschrift">
<a style="border-top:1px solid #001744;"> </a><marquee direction="up" height="75" scrollamount="1" width="180">';
for ($i = 0; $i < $limit_art; $i ++) {
$article = $list->nextArticle();
$article_id = $article->getField('idart');
$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." ";
echo '<a href="'.$href.'"><b>'.$teaserheadline.'</b><br>'.$teasertext.'<br><br></a>';
} // end for
echo '</marquee><a style="border-bottom:1px solid #001744;"> </a></div>';
}
}
?>
Code: Alles auswählen
/* Laufschrift */
#laufschrift {
width:170px;
list-style:none;
margin-left:10px;
background-color:#eee;
}
#laufschrift a {
color:#001744;
font:85% verdana, sans-serif, arial, helvetica ;
padding-left:25px;
padding-right:5px;
text-decoration:none;
background:transparent;
display:block;
border-top:1px solid #fff!important;
border-top:0px solid #fff;
width:150px;
}
Schlaucher