Code: Alles auswählen
$bild = preg_grep("/.+\.(jpg)/i",$alle);
Code: Alles auswählen
//thumnails erzeugen
if (!$fehler) {
foreach ($bild as $einzelbild) {
$new_img = split("\.",$bild);
if ($new_img[1] == "jpg") {
$im = @ImageCreateFromJPEG($cfg['path']['frontend'].$upldir.$album_dir."/" .$einzelbild);
} else if ($new_img[1] == "gif") {
$im = @ImageCreateFromGIF($cfg['path']['frontend'].$upldir.$album_dir."/" .$einzelbild);
} else {
$src_im = imagecreatefromgd($cfg['path']['frontend'].$upldir.$album_dir."/" .$einzelbild);
}
list($src_width, $src_height) = getimagesize($cfg['path']['frontend'].$upldir.$album_dir."/" .$einzelbild);
if($src_width > $src_height) {
$new_image_width = $max_breite;
$new_image_height = $src_height * $max_breite / $src_width;
}
if($src_width <= $src_height) {
$new_image_height = $max_hoehe;
$new_image_width = $src_width * $max_hoehe / $src_height;
}
$new_image = imagecreatetruecolor($new_image_width, $new_image_height);
imagecopyresampled($new_image, $im, 0, 0, 0, 0, $new_image_width,$new_image_height, $src_width, $src_height);
if (!imagejpeg($new_image, $thm_new_dir."/".$einzelbild, 40)) {
$fehler = "Konnte Thumb nicht erstellen: ".$thm_new_dir."/".$einzelbild."<br>";
} else {
$dbA_entry = "INSERT INTO ".$db_fotos." ".
"(filename, album_id, album_dir, idart) ".
"VALUES ('$einzelbild', '$album_id', '$album_dir', '$idart')";
if (!$db->query($dbA_entry)) { $fehler = "Beim Datenbankeintrag traten Fehler auf: ".$sql_entry; }
}
}//end foreach
}
die großen bilder sind in meinem layout max. 382 x 287 px, für größere bilder die angaben der iframe-größe im output entsprechend anpassen.
(blödes maß, hat aber eben so bei mir ins layout gepasst).
alle anderen verwendeten styles fasse ich gleich in einem css-file zusammen.
die editiermöglichkeiten sieht man im editor des artikels (vorausgesetzt, der iframe ist groß genug )
die übersichtsseite ist ein zweites modul und hat nur output:
Code: Alles auswählen
<?php
// manuelle konfiguration des moduls
$uploadpfad = "upload/galerie/"; // relativ zum root-verzeichnis (mit slash am ende)
$thumbnailpfad = "/thm/"; //relativ zum bildverzeichnis (mit slash am anfang und am ende)
// nicht verwendet-ToDo:blättern wie in fotogalerie
$angezeigte_anzahl = 10;
//auslesen der angelegten alben
$dbA = new DB_Contenido;
$sqlA = "SELECT * FROM ".$cfg["tab"]["fotoalbum"]." WHERE idart != 0 ORDER by album_datum DESC";
$dbA->query($sqlA);
$dbF = new DB_Contenido;
$db_hl = new DB_Contenido;
$db_shl = new DB_Contenido;
while ($dbA->next_record()) {
$albumdate = split("-",$dbA->f("album_datum"));
$albumdate = $albumdate[2].".".$albumdate[1].".".$albumdate[0];
$artikel = $dbA->f("idart");
$link = "front_content.php?idart=".$artikel;
$imgToShow = $uploadpfad.$dbA->f("album_dir").$thumbnailpfad;
$sqlF = "SELECT * from ".$cfg["tab"]["fotos"]." WHERE idart = ".$artikel." ORDER by foto_pos";
$dbF->query($sqlF);
$dbF->next_record();
$imgToShow .= $dbF->f("filename");
$sql_hl = "SELECT * from ".$cfg["tab"]["content"]." WHERE idartlang = ".$artikel." AND idtype = 1 AND typeid = 1";
$db_hl->query($sql_hl);
if (($db_hl->next_record()) && ($db_hl->f("value") != "")) {
$headline = $db_hl->f("value");
} else {
$headline = $dbA->f("album_title");
}
$headline = strip_tags(urldecode($headline));
$sql_shl = "SELECT * from ".$cfg["tab"]["content"]." WHERE idartlang = ".$artikel." AND idtype = 1 AND typeid = 2";
$db_shl->query($sql_shl);
if (($db_shl->next_record()) && ($db_shl->f("value") != "")) {
$subheadline = $db_shl->f("value");
} else {
$subheadline = "";
}
$subheadline = strip_tags(urldecode($subheadline));
//##########-HTML-Output-##########
echo '
<table cellpadding="0" cellspacing="0" class="newstable" style="width:100%;">
<tr>
<td width=100 valign=top align=center rowspan=2><a href="'.$link.'"><img style="margin-right:10px; margin-top:5px; margin-bottom:5px;" src="'.$imgToShow.'" border=0></td>
<td valign=top p class="hl4" style="text-align:left;"><a href="'.$link.'">'.$headline.'</a></td>
<td valign=top align=right class=klein><strong>'.$albumdate.'</strong></td>
</tr>
<tr>
<td colspan=2 style="font:normal 9pt/15pt arial;">'.$subheadline.'</td>
</tr>
</table>
';
}//end while next record
?>
bitte beachten: einen artikel offline-stellen nützt nix, ich komm aber leider erst am wochenende dazu, das einzubauen.
ich hab alle meine contenido-installationen bereits auf 4.5.2 upgedatet, kann daher leider selbst nicht prüfen, ob das modul unter 4.4.4 läuft
gruß
oma