Newsmodul erweitern, aber wie???????????????
Verfasst: Di 7. Feb 2006, 21:04
Hallöchen,
ich brauch wieder mal hilfe
. Ich wollte in ein Blättermodule das die News wie bei mein Newsmodul aussehen. Ich sag mal so ich wollte die Blätter Funktion von diesen Modul hier:
in mein News Modul einbinden, ich weis es gibt schon ein Artikelllist modul der die blätterfunktion hat, doch ich hab schon sehr viel an mein News Modul geändert. Ich kann nich einfach ein anderes nehemn. Hier ist das News Module:
Bitte hilft mir!!!!!!
Ich bin schon nah dran gewesen. Er hat die Anzahl artikeln angezeigt doch er hat auf jeden Blatt die gleichen news angezeigt.
ich brauch wieder mal hilfe

Code: Alles auswählen
<?php
$anzahl = "4";
if($anzahl<1) {$anzahl=10;}
$laenge = "100";
if($laenge<1) {$laenge=100;}
$sql = "SELECT ARTLANG.idart, ARTLANG.title, CATART.idcat, ARTLANG.created, CONTENT.value, CONTENT.idtype, CONTENT.typeid
FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".$cfg["tab"]["art_lang"]." AS ARTLANG, ".$cfg["tab"]["cat"]." AS CAT, ".$cfg["tab"]["content"]." AS CONTENT
WHERE ARTLANG.idart = CATART.idart AND CATART.idcat = CAT.idcat AND ARTLANG.idartlang=CONTENT.idartlang AND CONTENT.idtype<=2 AND CONTENT.typeid<=2 AND CAT.idcat='$idcat' AND ARTLANG.idlang = '$lang' AND ARTLANG.online = '1' AND CATART.is_start='0'
ORDER BY ARTLANG.artsort ASC,ARTLANG.created DESC";
$db->query($sql);
if ($db->num_rows() != 0)
{
//Überschrift der Artikellist
echo "<h1><br>CMS_HTMLHEAD[6]</h1>
<table border=0 cellspacing=0 cellpadding=0 id=\"font\">";
$artikel = array(array());
$j=0;
$db->next_record();
$idart_last=$db->f("idart");
for ($i=0; $i<$db->num_rows(); $i++)
{
$artikel[$j][0] = $db->f("idart");
$artikel[$j][1] = $db->f("idcat");
$artikel[$j][2] = substr($db->f("created"),8,2).".".substr($db->f("created"),5,2).".";
while ( $idart_last==$db->f("idart") )
{
if ( $db->f("idtype") == 2 && $db->f("typeid") == 1 )
{
$html_text = strip_tags(urldecode($db->f("value")));
$array = array ("ä" => "ن", "ö" => "ِ", "ü" => "ü", "ß" => "ك", "Ä" => "ؤ", "Ö" => "ض", "Ü" => "ü", " " => " ", """ => "\"", "<" => "<", ">" => ">", "&" => "&");
$html_text = strtr($html_text, $array);
$artikel[$j][5] = htmlentities(substr($html_text,0,$laenge))."...";
} elseif ( $db->f("idtype") == 1 && $db->f("typeid") == 1 )
{
$artikel[$j][3] = strip_tags(urldecode($db->f("value")));
} elseif ( $db->f("idtype") == 1 && $db->f("typeid") == 2 )
{
$artikel[$j][4] = strip_tags(urldecode($db->f("value")));
}
$idart_last=$db->f("idart");
$db->next_record();
$i++;
}
$idart_last=$db->f("idart");
$j++;
$i--;
}
if($blatt=="") {$blatt=0;}
$blattmax=ceil($j/$anzahl)-1;
$blatt1 = $blatt+1;
$blattmax1 = $blattmax+1;
//Zeigt wo man sich befindet oben
if ($j>$anzahl)
{
echo " <tr>
<td colspan=3 align=\"right\">Seite ".$blatt1." von ".$blattmax1." – <b>";
for ($i=0; $i<=$blattmax; $i++)
{
$k = $i+1;
if($i==$blatt) {
echo " ".$k." ";
} else {
$navmod_link ="front_content.php?client=$client&lang=$lang&idcat=$idcat&blatt=".$i."";
echo ' <a href="'.$sess->url("$navmod_link").'" id="font">'.$k.'</a> ';
}
}
echo "</b><br> </td>
</tr>";
}
//-------------------------------
for ($i=$anzahl*$blatt; $i < min($j,$anzahl*$blatt+$anzahl); $i++)
{
$k = $i-1;
//Link der Artikeln
$navmod_link ="front_content.php?client=$client&lang=$lang&idcat=".$artikel[$i][1]."&idart=".$artikel[$i][0]."";
echo '<tr>';
if ( $i>0 && $artikel[$i][2] == $artikel[$k][2] )
{
echo '<td> </td>';
} else
{
echo '<td valign="top"><p><b>'.$artikel[$i][2].'</b></p></td>';
}
//Ausgabe der Artikeln
echo '<td><img border="0" src="images/2.gif" width="7" height="1"></td>
<td><p><b><a href="'.$sess->url("$navmod_link").'" id="font">'.$artikel[$i][3].'</a> '.$artikel[$i][4].'</b> '.$artikel[$i][5].' <a href="'.$sess->url("$navmod_link").'" id="font">mehr</a></p></td>
</tr>';
}
//Zeigt wo man sich befindet unten
if ($j>$anzahl)
{
echo " <tr>
<td colspan=3 align=\"right\">Seite ".$blatt1." von ".$blattmax1." – <b>";
for ($i=0; $i<=$blattmax; $i++)
{
$k = $i+1;
if($i==$blatt) {
echo " ".$k." ";
} else {
$navmod_link ="front_content.php?client=$client&lang=$lang&idcat=$idcat&blatt=".$i."";
echo '<a href="'.$sess->url("$navmod_link").'" id="font">'.$k.'</a> ';
}
}
echo "</b></td>
</tr>";
}
echo '</table>';
}
//-------------------------
?>
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
* Modified : 27.01.2006
************************************************/
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_efrin3.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 = 'created';
} 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') {//Wenn Bild ja
$br_img = $article->getContent('CMS_IMG', 1);
$img_teaser = '';
$sql = "SELECT
*
FROM
".$cfg["tab"]["upl"]."
WHERE
idupl=$br_img ";
//echo "<pre>"; print_r($sql); echo "</pre>";
$db->query($sql);
if ($db->next_record()) {
$filename = $db->f('filename');
$dirname = $db->f('dirname');
//echo $dirname.$filename;
}
$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);
if($br_img!=''){
$teaser_img = '<img src="'.$img_teaser.'" class="teaser_img">';
}
} // end if noimg
$headline = strip_tags($article->getContent('CMS_HTMLHEAD', 1));
$headline = str_replace($replace, " ", $headline);
$teaserheadline = /*$subheadline." - ".*/ $headline;
$autor = strip_tags($article->getContent('CMS_HTML', 3));
$autor = str_replace($replace, " ", $autor);
$teaserautor = /*$subheadline." - ".*/ $autor;
$quelle = strip_tags($article->getContent('CMS_HTML', 4));
$quelle = str_replace($replace, " ", $quelle);
$teaserquelle = /*$subheadline." - ".*/ $quelle;
/* $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
$sql = "SELECT DATE_FORMAT(created, '%d.%m.%Y') AS Changedatum FROM con__art_lang WHERE idart = " .$article_id;
$db->query($sql);
if ($db->next_record())
{
$time = $db->f('Changedatum');
}
$teasertext = $teasertext." ";
$tpl->set('d', 'HEADLINE', $teaserheadline);
$tpl->set('d', 'TEXT', $teasertext);
$tpl->set('d', 'HREF', $href);
$tpl->set('d', 'QUELLE', $teaserquelle);
$tpl->set('d', 'AUTOR', $teaserautor);
$tpl->set('d', 'TIME', $time);
$tpl->set('d', 'IMG', $teaser_img);
$tpl->set('d', 'MORE', mi18n("mehr"));
$tpl->next();
} // end for
$tpl->generate('templates/'.$template);
}
}
?>
Ich bin schon nah dran gewesen. Er hat die Anzahl artikeln angezeigt doch er hat auf jeden Blatt die gleichen news angezeigt.