ch hatte mein Galerie Modul unter der 4.6.2 laufen und alles lief klasse.
Hier mal der Code:
Code: Alles auswählen
Input:
?><?php
/***********************************************
* Bildergalerie Input
*
* Author : Timo A. Hummel
* Copyright : four for business AG
* Created : 30-09-2005
* modified : 21.02.2006 Klövekorn (zeilen/Spalten-Eingabe auskommentiert)
************************************************/?>
<table>
<tr>
<td><?php echo mi18n("Breite");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[0]"; ?>" value="<?php echo "CMS_VALUE[0]"; ?>"></td>
</tr>
<tr>
<td><?php echo mi18n("Höhe");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[1]"; ?>" value="<?php echo "CMS_VALUE[1]"; ?>"></td>
</tr>
<!--
<tr>
<td><?php echo mi18n("Spalten");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[2]"; ?>" value="<?php echo "CMS_VALUE[2]"; ?>"></td>
</tr>
<tr>
<td><?php echo mi18n("Zeilen");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[3]"; ?>" value="<?php echo "CMS_VALUE[3]"; ?>"></td>
</tr>
-->
<tr>
<td><?php echo mi18n("Breite Detailansicht");?></td>
<td><input type="text" name="<?php echo "CMS_VAR[4]"; ?>" value="<?php echo "CMS_VALUE[4]"; ?>"></td>
</tr>
<?php
$sql = "SELECT DISTINCT dirname FROM ".$cfg['tab']['upl']." ORDER BY dirname";
$db->query($sql);
echo '<tr><td>'.mi18n("Verzeichnis auswählen").'</td><td>
<select name="CMS_VAR[5]" size="1" style="width: 320px">
<option value="">'.mi18n("Nichts ausgewählt").'</option>';
while ($db->next_record()) {
if ( stristr($db->f("dirname"),'CVS/') === FALSE ) {
if ($db->f("dirname")=="CMS_VALUE[5]") {
echo '<option value="'.$db->f("dirname").'" selected="selected">'.$db->f("dirname").'</option>';
} else {
echo '<option value="'.$db->f("dirname").'">'.$db->f("dirname").'</option>';
}
}
}
echo '</select></td></tr>';?>
</table>
<?php
Code: Alles auswählen
Output:
<?php
/***********************************************
* Bildergalerie Output mit Vor/Zurück
*
* Author : Timo A. Hummel
* Copyright : four for business AG
* Created : 30-09-2005
* modified : 19.02.2006 Klövekorn (vor und zurück in der Bilderansicht)
************************************************/
cInclude("includes", "functions.api.images.php");
/* Gallery variables */
$bRecursive = false;
$sPath = "CMS_VALUE[5]";
if ($sPath=='') {
$sPath = $cfgClient[$client]["path"]["frontend"] . $cfgClient[$client]["upl"]["frontendpath"] . "bildergalerie/";
} else {
$sPath = $cfgClient[$client]["path"]["frontend"] . $cfgClient[$client]["upl"]["frontendpath"] . "CMS_VALUE[5]";
}
/*
$iRows = "CMS_VALUE[3]";
if ($iRows == 0)
{$iRows = 2;}
$iColumns = "CMS_VALUE[2]";
if ($iColumns == 0) {$iColumns = 2;}
*/
if (isset($start)) {$iCurrentPage = $start;
} else {
$iCurrentPage = 1;
}
$iWidth = "CMS_VALUE[0]";
$iHeight = "CMS_VALUE[1]";
if ($iWidth == 0) {$iWidth = 300;}
if ($iHeight == 0) { $iHeight = 300;}
$iDetailWidth = "CMS_VALUE[4]";
if ($iDetailWidth == 0) {$iDetailWidth = 300;}
$aValidExtensions = array("jpg", "jpeg", "gif", "png");
$iImagesPerPage = $iRows * $iColumns;
//aus dem ersten REQUEST-Teil verschobener Code:
$aGalleryFiles = scanDirectory($sPath, $bRecursive);
if (is_array($aGalleryFiles))
{// Filter out non-images:
foreach ($aGalleryFiles as $key => $aGalleryFile)
{
$sExtension = strtolower(getFileExtension($aGalleryFile));
if (!in_array($sExtension, $aValidExtensions))
{
unset($aGalleryFiles[$key]);
}
} //ende foreach
/* Calculate effective variables */
$iFileCount = count($aGalleryFiles); //die anzahl der bilder
// $iPages = ceil($iFileCount / $iImagesPerPage); //liefert die Ganzzahl, die gleich oder größer Number ist
$aImagesToDisplay = array_slice($aGalleryFiles, ($iCurrentPage - 1) * $iFileCount,$iFileCount);//$iImagesPerPage, $iImagesPerPage);
$oImageTpl = new Template;
$oGalleryTpl = new Template;
$oEmptyImageTpl = new Template;
$aRenderedImages = array();
$iRow = 0;
$iImagesRendered = 0;
$i = 0;
}
//ende verschobener Code
if ($_REQUEST['view']=='')
{/* Read all gallery files */
foreach ($aImagesToDisplay as $sImageToDisplay)
{// Do Scaling
$sScaledImage = cApiImgScale($sImageToDisplay, $iWidth, $iHeight);
// setzt den Link zusammen um auf die Großansicht zu gehen: "front_content.php/.../view=...
$link = 'front_content.php?idcatart='.$idcatart.'&start='.$_REQUEST['start'].'&view='.urlencode(str_replace($cfgClient[$client]['path']['frontend'],'',$sImageToDisplay));
//macht den textlink:
$description = ig_getImageDescription($sImageToDisplay);
if ($description=='')
{
$description = ' ';
$array_des_pfades = explode("/",$sImageToDisplay);
$bildname_pos = count($array_des_pfades)-1;
}
//$download_link = str_replace($cfgClient[$client]['path']['frontend'],$cfgClient[$client]['path']['htmlpath'],$sImageToDisplay);
$download_size = ig_GetReadableFileSize($sImageToDisplay);
$oImageTpl->reset();
$oImageTpl->set("s", "FILE", $sScaledImage);
$oImageTpl->set("s", "WIDTH", $iWidth);
$oImageTpl->set("s", "HEIGHT", $iHeight);
$oImageTpl->set("s", "LINK", $link);
$oImageTpl->set("s", "DESCRIPTION", $description);
$oImageTpl->set("s", "DOWNLOAD_LINK", $download_link);
$oImageTpl->set("s", "DOWNLOAD_SIZE", $download_size);
/*$oImageTpl->set("s", "DOWNLOAD_CAPTION", mi18n("runter laden"));*/
$oImageTpl->set("s", "PREVIEW_CAPTION", mi18n("$array_des_pfades[$bildname_pos]"));
$aRenderedImages[] = $oImageTpl->generate($cfgClient[$client]["path"]["frontend"] . "templates/gallery_image.html", true, false); //Rendered Image ist das Thumbnailbild selbst
$iImagesRendered++;
if ($iImagesRendered == $iFileCount)//$iColumns)
{
$oGalleryTpl->set("d", "COLUMNS", implode("", $aRenderedImages));
$oGalleryTpl->next();
$iImagesRendered = 0;
$aRenderedImages = array();
}
} //Ende foreach "scaling"
// ohne diesen Block keine Thumbs:
if (count($aRenderedImages) < $iColumns && count($aRenderedImages) > 0)
{
$iEmptyCells = $iColumns - count($aRenderedImages);
$oEmptyImageTpl->set("s", "WIDTH", $iWidth);
$oEmptyImageTpl->set("s", "HEIGHT", $iHeight);
$sEmptyCells = str_repeat($oEmptyImageTpl->generate($cfgClient[$client]["path"]["frontend"] . "templates/gallery_empty.html", true, false),$iEmptyCells);
$oGalleryTpl->set("d", "COLUMNS", implode("", $aRenderedImages) . $sEmptyCells);
$oGalleryTpl->next();
}
$aLinks = array();
/*
if ($iCurrentPage > 1)
{
$oPreviousTpl = new Template;
$oPreviousTpl->set("s", "LINK", $cfgClient[$client]["path"]["htmlpath"] . sprintf("front_content.php?idcatart=%s&start=%s", $idcatart, $iCurrentPage - 1));
$oPreviousTpl->set("s", "TITLE", mi18n("Zurück"));
$aLinks[] = $oPreviousTpl->generate($cfgClient[$client]["path"]["frontend"] . "templates/gallery_link.html", true, false);
}
if ($iCurrentPage < $iPages)
{
$oNextTpl = new Template;
$oNextTpl->set("s", "LINK", $cfgClient[$client]["path"]["htmlpath"] . sprintf("front_content.php?idcatart=%s&start=%s", $idcatart, $iCurrentPage + 1));
$oNextTpl->set("s", "TITLE", mi18n("Vor"));
$aLinks[] = $oNextTpl->generate($cfgClient[$client]["path"]["frontend"] . "templates/gallery_link.html", true, false);
}
*/
//$oGalleryTpl->set("s", "NAVIGATION", implode("", $aLinks));
$oGalleryTpl->generate($cfgClient[$client]["path"]["frontend"] . "templates/gallery.html", false, false);
// }
}
else
{//generierung des Detailbildes
// vorheriges/nächstes Bild bestimmen
//das $_REQUEST analysieren:
$request_view_uebergabe = $_REQUEST['view'];
$requestpfad = explode('/', $request_view_uebergabe);
$letztes_element_request = count($requestpfad)-1;
$request_bild = $requestpfad[$letztes_element_request];
foreach ($aImagesToDisplay as $arrayelement)
{
//ins view-Format konvertieren:
$pfadarray = explode('/', $arrayelement);
$letztes_element = count($pfadarray)-1;
$bild = $pfadarray[$letztes_element];
$allebilder[] = $bild;
}
//Diese Funktion gibt den Index des aktuellen Bildes aus:
function bildfinder($array)
{
global $request_bild;
while(list($k,$val) = each($array))
{
if (preg_match("/$request_bild/",$val)) return $k;
}
return FALSE;
}
//Anwendung der Funktion bildfinder:
$k = bildfinder($allebilder);
$vorbildindex = $k-1;
$nachbildindex = $k+1;
if ($nachbildindex == $iFileCount) {$nachbildindex = 0;}
if ($vorbildindex < 0) {$vorbildindex = $iFileCount-1;}
$vorbild = "upload/CMS_VALUE[5]/".$allebilder[$vorbildindex];
$nachbild = "upload/CMS_VALUE[5]/".$allebilder[$nachbildindex];
$vorbild = 'front_content.php?idcatart='.$idcatart.'&start='.$_REQUEST['start'].'&view='.urlencode(str_replace($cfgClient[$client]['path']['frontend'],'',$vorbild));
$nachbild = 'front_content.php?idcatart='.$idcatart.'&start='.$_REQUEST['start'].'&view='.urlencode(str_replace($cfgClient[$client]['path']['frontend'],'',$nachbild));
//ende vorher,nachher
$sImageToDisplay = $cfgClient[$client]['path']['frontend'].$_REQUEST['view']; //der pfad beginnt bei "kunden4c"
$sScaledImage = cApiImgScale($sImageToDisplay, $iDetailWidth, 1000);
$description = $bild;//ig_getImageDescription($sImageToDisplay);
if ($description=='')
{
$description = ' ';
}
$download_link = str_replace($cfgClient[$client]['path']['frontend'],$cfgClient[$client]['path']['htmlpath'],$sImageToDisplay);
$download_size = ig_GetReadableFileSize($sImageToDisplay);
$oImageTpl = new Template;
$oImageTpl->set("s", "IMG",$sScaledImage);
$oImageTpl->set("s", "BACKLINK",'front_content.php?idcat='.$idcat.'&idart='.$idart.'&start='.$_REQUEST['start']);
$oImageTpl->set("s", "BACKCAPTION",mi18n("Übersicht"));
$oImageTpl->set("s", "DESCRIPTION", $request_bild);
$oImageTpl->set("s", "DOWNLOAD_LINK", $download_link);
$oImageTpl->set("s", "DOWNLOAD_SIZE", $download_size);
$oImageTpl->set("s", "ZURUECK", mi18n("Vorheriges Bild"));
$oImageTpl->set("s", "WEITER", mi18n("Nächstes Bild"));
$oImageTpl->set("s", "VORHERIGES", $vorbild);
$oImageTpl->set("s", "NAECHSTES", $nachbild);
/*$oImageTpl->set("s", "DOWNLOAD_CAPTION", mi18n("runter laden")); */
$oImageTpl->generate($cfgClient[$client]["path"]["frontend"] . "templates/gallery_detail.html", false, false);
}
function ig_getImageDescription($idupl)
{
global $cfg, $cfgClient, $db, $client, $lang;
$cApiClient = new cApiClient($client);
$language_separator = $cApiClient->getProperty('language','separator');
if(is_numeric($idupl))
{//ID is a number
$query = "SELECT description FROM ".$cfg["tab"]["upl"]." WHERE idupl = ".$idupl;
}
else
{//ID is a string
$path_parts = pathinfo($idupl);
$upload = $cfgClient[$client]['upl']['frontendpath'];
$len = strlen($upload);
$pos = strpos($idupl,$upload);
$dirname = substr($path_parts['dirname'],$pos+$len).'/';
$query = "SELECT description FROM ".$cfg["tab"]["upl"]." WHERE (dirname = '".$dirname."') AND (filename='".$path_parts['basename']."') AND (filetype='".$path_parts['extension']."')";
}
$db->query($query);
if($db->next_record())
{
return htmlspecialchars(urldecode($db->f("description")));
}
else
{
return '';
}
}
function ig_GetReadableFileSize($path)
{
$filesize = filesize($path);
$unit = "bytes";
if ($filesize > 1024) {
$filesize = ($filesize / 1024);
$unit = "kB"; }
if ($filesize > 1024) {
$filesize = ($filesize / 1024);
$unit = "MB"; }
if ($filesize > 1024) {
$filesize = ($filesize / 1024);
$unit = "GB"; }
if ($filesize > 1024) {
$filesize = ($filesize / 1024);
$unit = "TB"; }
$filesize = round($filesize, 0);
return $filesize." ".$unit;
}
?>
Unter den Detailbildern hatte ich eine Navigation mit vor/zurück - und nun nach der Umstellung auf die 4.6.8 ist folgendes passiert:
1. Das komplette Übersichtslayout ist zerschossen
2. Plötzlich sind Bildbezeichnungen, "Download_Captions" und die Bildgrößen zu sehen und teilweise auch irrsinnig verlinkt.
3. Bei den Details steht plötzlich die Bildbezeichnung unter dem Bild und keine Navigation ist mehr da.
Woran mag das wohl liegen?? Ob du da vielleicht einen Rat für mich weisst?
Lieben Dank im Voraus

Galerie (fehlerhaft ist hier zu sehen: www.re-flexion.de (Fotogalerien)