ich habe das Modul Artikelliste (Erweitert) in mein Template eingebaut und gelayoutet. Ich war sehr zufriden, bis ich feststellte, dass ich nicht in der Lage bin, den Startartikel (der Artikel mit dem Template) auszublenden. Er steht immer als letzter Artikel da und ich würde das gerne vermeiden.
Laut der Zeile "Erstellt eine Liste mit allen Artikel bis auf den Startartikel" soll das ja auch so sein. Ich weiss nicht, warum das bei mir nicht so ist.
Ich habe schon mehrere Artikel erstellt und wieder gelöscht und die Artikelnummer des auszublendenden Startartikels ist z.Z. 17.
Leider kann ich aus dem Modul nicht ersehen, wie es den Startartikel überhaupt ausfiltert.
Ich bitte um Hilfe. Ich will nur, dass der Startartikel nicht sichtbar ist
Hier nochmal ein Auszug aus meinem Modul (Output):
Code: Alles auswählen
<?
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Erweiterte Artikel liste
*
* Liste von Artikeln mit mehreren Daten basierend
* auf 4fb referenz modul
*
* Author : Evert Smit
* Copyright : 4fB
* Created : 13-07-2003
* Modified : 16-08-2002
************************************************/
// second db class instance
$db2 = new DB_Contenido;
// selected category
$selcat = "CMS_VALUE[0]";
if($selcat!="0" && $selcat!=""){
// select all articles in category widthout start article
$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' ORDER BY CATART.idart DESC";
// 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
// loop through subarticles
echo '
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<TR><TD>
';
if (is_array($articleID)) {
foreach ($articleID as $key => $value) {
// select all CMS variables of the article
$sql = "SELECT ".$cfg["tab"]["content"].".*,".$cfg["tab"]["art_lang"].".summary
FROM ".$cfg["tab"]["content"]."
left join ".$cfg["tab"]["art_lang"]."
on ".$cfg["tab"]["content"].".idartlang=".$cfg["tab"]["art_lang"].".idartlang
WHERE ".$cfg["tab"]["content"].".idartlang = '$value'
AND ".$cfg["tab"]["content"].".idtype = '1'
AND ".$cfg["tab"]["content"].".typeid = '1'";
$db->query($sql);
$db->next_record();
// select and resolve image path
$imagesql="select value from ".$cfg["tab"]["content"]." where idartlang='$value' and idtype='4' and typeid='1'";
$db2->query($imagesql);
$db2->next_record();
$image_id= $db2->f("value");
// get image name and path
$imagesql="select * from ".$cfg["tab"]["upl"]." where idupl='$image_id'";
$db2->query($imagesql);
$db2->next_record();
$webdir='upload/';
$thumbdir='thumbnails/';
$filedir='/zensored';
$imagelocation=$filedir.$webdir.$db2->f('dirname').$db2->f('filename');
$thumblocation=$filedir.$webdir.$thumbdir.$db2->f('filename');
if (!file_exists($thumblocation)){
// create thunbnail
$fileinformation=getimagesize($imagelocation);
$imagewidth = $fileinformation[0];
$imageheight = $fileinformation[1];
$imagetype=$db2->f('filetype');
$imageattributes = $fileinformation[3];
//$newfile= $last_id."-image.".$imagetype;
$target=$thumblocation;
if ( !(copy($imagelocation,$target)))
{
echo "Could not copy file to destintaion., Command returned Error Message. Please check your log files. ".$imagelocation." ".$target;
die;
}
//create thumbnails 80xrelational height
// Determine what filetype and set pointer to source image
switch ($imagetype)
{
case "gif":
$original_image=imagecreatefromgif($target);
break;
case "png":
$original_image=imagecreatefrompng($target);
break;
case "jpg":
$original_image=imagecreatefromjpeg($target);
break;
}
if (!$original_image){
echo 'Error getting image from '.$target.'.';
}
//echo $target;
// set image width and height of thunbnail and put pointer for filesytsem
$thumbfile= $db2->f('filename');
$target_thumb=$thumblocation;
$t_width=182;
// calculating height to maintain ratio
$t_height=145;
// remove digits to get solid number
list ($t_height,$notimportand)=explode('.',$t_height);
// create blank image
$thumb_image=imagecreate($t_width,$t_height);
// resize image based on height and width
imagecopyresized($thumb_image,$original_image,0,0,0,0,$t_width,$t_height,$imagewidth,$imageheight);
// store image on file system
// requires different functionf for either gif or jpeg
switch ($imagetype)
{
case "gif":
imagegif($thumb_image,$target_thumb);
break;
case "png":
imagepng($thumb_image,$target_thumb);
break;
default:
imagejpeg($thumb_image,$target_thumb,75);
break;
}
imagedestroy($thumb_image);
imagedestroy($original_image);
}
$image=$webdir.$thumbdir.$db2->f('filename');
$head = urldecode($db->f("value"));
$summary= $db->f("summary");
if ( strlen($head) > CMS_VALUE[3]) {
$head = substr($head, 0, CMS_VALUE[3]);
$head .= '..';
}
// link
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idart=$linkID[$key]&m=$m&s=$s");
//echo '<tr><td><A HREF="'.$link.'">'.$db->f("value").'</a></td></tr>';
echo '
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr align="left" valign="top" bgcolor="#F4F4F4">
<td width="27%"><img src="'.$image.'" width="182" height="145" hspace="0" vspace="3"></td>
<td class="head"><img src="img/clear.gif" width="7" height="5"></td>
<td class="head">
<p><span class="head"><A HREF="'.$link.'">'.$head.'</a></span><br>
<span class="text">'.$summary.'<br>
<img src="img/star.gif" width="9" height="8"><a href="'.$link.'">mehr...
</a> </span></p>
</td>
<td class="head"><img src="img/clear.gif" width="8" height="5"></td>
</tr>
<tr align="left" valign="top">
<td colspan="4" height="1" bgcolor="#CCCCCC"><img src="img/clear.gif" width="5" height="1"></td>
</tr>
</table>
<br>';
} // end while
echo '';
unset($head);
unset($summary);
} // end foreach
} // end if (is_array)
echo '</table>';
?>