nur falls jemand Interesse hat, ich habe das Modul etwas geändert.
Nun kann die vorgegebene Zeit (Output Zeile 295 ist Standard 4000 Millisekunden) in dem Artikel selbst über die Konfiguration angepasst werden. Also den automatischen Bildwechsel schneller oder langsamer machen, ohne dabei ins Modul gehen zu müssen.
Code: Alles auswählen
/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname : Galleriffic
* Author : Andreas Dinkelacker
* Copyright : Andreas Dinkelacker
* Created : 28.05.2009
* Modifiziert : contenido12 EL
* Created : 16.10.2012
* Version : 0.3.3 BETA
* License : GNU/GPLv2 only (http://www.gnu.org/licenses/gpl-2.0.html#TOC1)
************************************************/
echo "<script type='text/javascript'>
<!--
show=false;
function showhide(id,id2,id3,var1){
if (document.getElementById(id3).checked==false) {
show=true
}
if (var1==true && document.getElementById(id3).checked==true) show=false
if(show) {
document.getElementById(id).style.display='none'
document.getElementById(id2).disabled=false
show = false
}else{
document.getElementById(id).style.display='block'
document.getElementById(id2).disabled=true
show = true
}
}
-->
</script>";
echo '<style type="text/css">
<!--
.setBorder td {border-bottom: 1px solid #B3B3B3; margin:0px;}
-->
</style>';
$formSubmitOnchange='javascript:if (document.tplcfgform.send) {document.tplcfgform.send.value = 0}; document.tplcfgform.submit();';
$value0="CMS_VALUE[0]"; // Vorschaubilder pro Seite
$value1="CMS_VALUE[1]"; // NN
$value2="CMS_VALUE[2]"; // Bildgröße
$value3="CMS_VALUE[3]"; // Thumbgröße
$value4="CMS_VALUE[4]"; // Ordner
$value5="CMS_VALUE[5]"; // eigene Image Größe
$value6="CMS_VALUE[6]"; // eigene Image Breite
$value7="CMS_VALUE[7]"; // eigene Image Höhe
$value8="CMS_VALUE[8]"; // eigene Thumb Größe
$value9="CMS_VALUE[9]"; // eigene Thumb Breite
$value10="CMS_VALUE[10]"; // eigene Thumb Höhe
$value11="CMS_VALUE[11]"; // Sichtbarkeit inaktiver Bilder
$value12="CMS_VALUE[12]"; // Caching
$value13="CMS_VALUE[13]"; // Delete all cached files (only this gallery)
$value14="CMS_VALUE[14]"; // pre render images (only this gallery)
// - faster loading of first call of website
$value15="CMS_VALUE[15]"; // delete original file after resizing
$value16="CMS_VALUE[16]"; // Anzahl Spalten
if ($value16=="") $value16="0";
$value17="CMS_VALUE[17]"; // Anordnung Navigation und Bild
$value18="CMS_VALUE[18]"; // Ausrichtung der Anzeige
$value19="CMS_VALUE[19]"; // Position Steuerelemente
$value20="CMS_VALUE[20]"; // Position Anzeige
$value21="CMS_VALUE[21]"; // Position Bild-Infobox
$value22="CMS_VALUE[22]"; // Quadratische Thumbs (Seitenverhaeltnis anpassen)
if ($value22=="true") $chk22=' checked="checked"';
$value23="CMS_VALUE[23]"; // Delay Zeit für automatischen Wechsel
if ($value23=="") $value23="10000";
else $chk22='';
if ($value19=="" && $value20=="" && $value21=="") {
$value19="top";
$value20="middle";
$value21="bottom";
}
$inputImage="none";
$inputThumb="none";
if ($value5==1) {$styleImage=' disabled="disabled"';$inputImage="block";$chk5=' checked="checked"';}
if ($value8==1) {$styleThumb=' disabled="disabled"';$inputThumb="block";$chk8_1=' checked="checked"';}
echo '<table cellspacing="0" cellpadding="0" class="setBorder">';
echo '<tr>
<td style="width:250px;">'.mi18n("Vorschaubilder pro Seite").':<br/><small>'.mi18n("0 fuer alle Thumbs auf einer Seite").'</small></td>
<td><input style="width:30px;" name="CMS_VAR[0]" type="text" value="'.$value0.'" /></td>
</tr>';
echo '<tr>
<td>'.mi18n("Anzahl Spalten").':<br/><small>'.mi18n("A fuer automatische Spaltenzahl").'</small><br/><small>'.mi18n("0 fuer alle Thumbs in einer Zeile").'</small> </td>
<td><input style="width:30px;" name="CMS_VAR[16]" type="text" value="'.$value16.'" /></td>
</tr>';
echo '<tr>
<td>'.mi18n("Zeit in Millisekunden").':<br/><small>'.mi18n("Millisekunden").'</small><br/><small>'.mi18n("10000 Millisekunden fuer Wechsel").'</small> </td>
<td><input style="width:30px;" name="CMS_VAR[23]" type="text" value="'.$value23.'" /></td>
</tr>';
$ownSizeLang=mi18n("eigene Werte");
echo '<tr>
<td valign="top">'.mi18n("Groesse des Bildes").': </td>
<td><select id="selectImage" name="CMS_VAR[2]"'.$styleImage.'>';
$sel="";
if ($value2=="320x240") $sel=' selected="selected"';
echo '<option value="320x240"'.$sel.'>320x240</option>';
$sel="";
if ($value2=="480x360") $sel=' selected="selected"';
echo '<option value="480x360"'.$sel.'>480x360</option>';
$sel="";
if ($value2=="640x480" || $value2=="") $sel=' selected="selected"';
echo '<option value="640x480"'.$sel.'>640x480</option>';
$sel="";
if ($value2=="800x600") $sel=' selected="selected"';
echo '<option value="800x600"'.$sel.'>800x600</option>';
$sel="";
echo '</select><input type="checkbox" id="chkImage" name="CMS_VAR[5]" value="1" onclick="javascript:showhide(\'inputImage\',\'selectImage\',\'chkImage\',false)"'.$chk5.' /> '.$ownSizeLang.'
<div id="inputImage" style="display:'.$inputImage.';"><input type="text" name="CMS_VAR[6]" value="'.$value6.'" style="width:50px;" /><b>x</b><input type="text" name="CMS_VAR[7]" value="'.$value7.'" style="width:50px;" /></div></td>
</tr>';
if (is_writable($cfgClient[$client][upl][path].$value4) && $value4!="") {
if ($value15==1) $chk15a=' checked="checked"';
elseif ($value15==0 || $value15=="") $chk15b=' checked="checked"';
echo '<tr>
<td>'.mi18n("Original durch verkleinertes Bild ersetzen?").': </td>
<td><input type="radio" value="1" name="CMS_VAR[15]"'.$chk15a.' /> '.mi18n("ja, Original ersetzen").' <input type="radio" value="0" name="CMS_VAR[15]"'.$chk15b.' /> '.mi18n("nein").'</td>
</tr>';
}
echo '<tr>
<td valign="top">'.mi18n("Größe des Thumbs").': </td>
<td><select id="selectThumb" name="CMS_VAR[3]"'.$styleThumb.'>';
$sel="";
if ($value3=="25x25") $sel=' selected="selected"';
echo '<option value="25x25"'.$sel.'>25x25</option>';
$sel="";
if ($value3=="50x50") $sel=' selected="selected"';
echo '<option value="50x50"'.$sel.'>50x50</option>';
$sel="";
if ($value3=="75x75") $sel=' selected="selected"';
echo '<option value="75x75"'.$sel.'>75x75</option>';
$sel="";
if ($value3=="100x100" || $value3=="") $sel=' selected="selected"';
echo '<option value="100x100"'.$sel.'>100x100</option>';
$sel="";
if ($value3=="120x120") $sel=' selected="selected"';
echo '<option value="120x120"'.$sel.'>120x120</option>';
$sel="";
if ($value3=="150x150") $sel=' selected="selected"';
echo '<option value="150x150"'.$sel.'>150x150</option>';
$sel="";
if ($value3=="200x200") $sel=' selected="selected"';
echo '<option value="200x200"'.$sel.'>200x200</option>';
$sel="";
echo '</select>
<input type="checkbox" id="chkThumb" name="CMS_VAR[8]" value="1" onclick="javascript:showhide(\'inputThumb\',\'selectThumb\',\'chkThumb\',true)"'.$chk8_1.' /> '.$ownSizeLang.'
<input type="checkbox" id="chkThumb" name="CMS_VAR[22]" value="true"'.$chk22.' /> '.mi18n("Quadratische Thumbs (Seitenverhältnis anpassen)").'
<div id="inputThumb" style="display:'.$inputThumb.';"><input type="text" name="CMS_VAR[9]" value="'.$value9.'" style="width:50px;" /><b>x</b><input type="text" name="CMS_VAR[10]" value="'.$value10.'" style="width:50px;" /></div></td>
</tr>';
echo '<tr>
<td>'.mi18n("Ordner auswaehlen").': </td>
<td colspan="2"><select size="1" name="CMS_VAR[4]" onchange="'.$formSubmitOnchange.'"><option></option>';
$root=$cfgClient[$client]['path']['frontend'].$cfgClient[$client]['upload'];
$content = scandir($root);
foreach ($content as $key => $folder) {
$folder=$folder.'/';
if (substr_count($folder,"./")==0) {
if ($value4 == $folder) $sel=' selected="selected"';
if (is_dir($root.$folder)) echo '<option value="'.$folder.'"'.$sel.'>'.$folder.'</option>';
if (is_dir($root.$folder)) {
$root2=$root.$folder;
$content2 = scandir($root2);
foreach ($content2 as $key2 => $folder2) {
$folder2=$folder.$folder2.'/';
if ($value4 == $folder2) $sel=' selected="selected"';
if (substr_count($folder2,"./")==0 && is_dir($root.$folder2)) echo '<option value="'.$folder2.'"'.$sel.'>'.$folder2.'</option>';
if (is_dir($root.$folder2)) {
$root3=$root.$folder2;
$content3 = scandir($root3);
foreach ($content3 as $key3 => $folder3) {
$folder3=$folder2.$folder3.'/';
if ($value4 == $folder3) $sel=' selected="selected"';
if (substr_count($folder3,"./")==0 && is_dir($root.$folder3)) echo '<option value="'.$folder3.'"'.$sel.'>'.$folder3.'</option>';
if (is_dir($root.$folder3)) {
$root4=$root.$folder3.'/';
$content4 = scandir($root4);
foreach ($content4 as $key4 => $folder4) {
$folder4=$folder3.$folder4.'/';
if ($value4 == $folder4) $sel=' selected="selected"';
if (substr_count($folder4,"./")==0 && is_dir($root.$folder4)) echo '<option value="'.$folder4.'"'.$sel.'>'.$folder4.'</option>';
$sel="";
}
}
$sel="";
}
}
}
$sel="";
}
$sel="";
}
}
echo '</select></td>
</tr>';
echo '<tr>
<td>'.mi18n("Sichtbarkeit inaktiver Bilder").': </td>
<td><select name="CMS_VAR[11]">';
$sel="";
if ($value11=="0.25") $sel=' selected="selected"';
echo '<option value="0.25"'.$sel.'>25 %</option>';
$sel="";
if ($value11=="0.33") $sel=' selected="selected"';
echo '<option value="0.33"'.$sel.'>33 %</option>';
$sel="";
if ($value11=="0.50" || $value11=="") $sel=' selected="selected"';
echo '<option value="0.50"'.$sel.'>50 %</option>';
$sel="";
if ($value11=="0.66") $sel=' selected="selected"';
echo '<option value="0.66"'.$sel.'>66 %</option>';
$sel="";
if ($value11=="0.75") $sel=' selected="selected"';
echo '<option value="0.75"'.$sel.'>75 %</option>';
$sel="";
if ($value11=="1") $sel=' selected="selected"';
echo '<option value="1"'.$sel.'>100 %</option>';
$sel="";
echo '</td>
</tr>';
echo '<tr>
<td>'.mi18n("Anordnung der Elemente").':</td>
<td><select name="CMS_VAR[17]" class="textbox">';
if ($value17=="lr") $sel=' selected="selected"';
echo '<option value="lr"'.$sel.'>'.mi18n("Navigation links, Anzeige rechts").'</option>';
$sel="";
if ($value17=="rl") $sel=' selected="selected"';
echo '<option value="rl"'.$sel.'>'.mi18n("Navigation rechts, Anzeige links").'</option>';
$sel="";
if ($value17=="ou") $sel=' selected="selected"';
echo '<option value="ou"'.$sel.'>'.mi18n("Navigation oben, Anzeige unten").'</option>';
$sel="";
if ($value17=="uo") $sel=' selected="selected"';
echo '<option value="uo"'.$sel.'>'.mi18n("Navigation unten, Anzeige oben").'</option>';
$sel="";
echo '</select></td>
</tr>';
echo '<tr>
<td>'.mi18n("Ausrichtung der Anzeige").':</td>
<td><select name="CMS_VAR[18]" class="textbox">';
if ($value18=="l") $sel=' selected="selected"';
echo '<option value="l"'.$sel.'>'.mi18n("links").'</option>';
$sel="";
if ($value18=="r") $sel=' selected="selected"';
echo '<option value="r"'.$sel.'>'.mi18n("rechts").'</option>';
$sel="";
if ($value18=="c") $sel=' selected="selected"';
echo '<option value="c"'.$sel.'>'.mi18n("zentriert").'</option>';
$sel="";
echo '</select></td>
</tr>';
if ($value19=="top") $chk19a=' checked="checked"';
elseif ($value19=="middle") $chk19b=' checked="checked"';
elseif ($value19=="bottom") $chk19c=' checked="checked"';
elseif ($value19=="none") $chk19d=' checked="checked"';
if ($value20=="top") $chk20a=' checked="checked"';
elseif ($value20=="middle") $chk20b=' checked="checked"';
elseif ($value20=="bottom") $chk20c=' checked="checked"';
elseif ($value20=="none") $chk20d=' checked="checked"';
if ($value21=="top") $chk21a=' checked="checked"';
elseif ($value21=="middle") $chk21b=' checked="checked"';
elseif ($value21=="bottom") $chk21c=' checked="checked"';
elseif ($value21=="none") $chk21d=' checked="checked"';
$checkArr=array();
$allnones=0;
if (!in_array($value19,$checkArr)) if ($value19=="none") $allnones+=1; else array_push($checkArr,$value19);
if (!in_array($value20,$checkArr)) if ($value20=="none") $allnones+=1; else array_push($checkArr,$value20);
if (!in_array($value21,$checkArr)) if ($value21=="none") $allnones+=1; else array_push($checkArr,$value21);
if (sizeof($checkArr)<bcsub(3,$allnones)) $bgColor=' style="background-color:#ff0000;"';
echo '<tr>
<td valign="top">'.mi18n("Positionierung der Anzeige-Elemente").':</td>
<td>
<table width="400" cellspacing="0" cellpadding="0"'.$bgColor.'>
<tr>
<td> </td>
<td>Steuerelemente</td>
<td>Anzeige</td>
<td>Infobox</td>
</tr>
<tr>
<td><b>'.mi18n("Oben").'</b></td>
<td><input type="radio" name="CMS_VAR[19]" value="top" id="controlsT"'.$chk19a.' /></td>
<td><input type="radio" name="CMS_VAR[20]" value="top" id="slideshowT"'.$chk20a.' /></td>
<td><input type="radio" name="CMS_VAR[21]" value="top" id="captionT"'.$chk21a.' /></td>
</tr>
<tr>
<td><b>'.mi18n("Mitte").'</b></td>
<td><input type="radio" name="CMS_VAR[19]" value="middle" id="controlsM"'.$chk19b.' /></td>
<td><input type="radio" name="CMS_VAR[20]" value="middle" id="slideshowM"'.$chk20b.' /></td>
<td><input type="radio" name="CMS_VAR[21]" value="middle" id="captionM"'.$chk21b.' /></td>
</tr>
<tr>
<td><b>'.mi18n("Unten").'</b></td>
<td><input type="radio" name="CMS_VAR[19]" value="bottom" id="controls"'.$chk19c.' /></td>
<td><input type="radio" name="CMS_VAR[20]" value="bottom" id="slideshow"'.$chk20c.' /></td>
<td><input type="radio" name="CMS_VAR[21]" value="bottom" id="caption"'.$chk21c.' /></td>
</tr>
<tr>
<td><b>'.mi18n("nicht anzeigen").'</b></td>
<td><input type="radio" name="CMS_VAR[19]" value="none" id="controls"'.$chk19d.' /></td>
<td><input type="radio" name="CMS_VAR[20]" value="none" id="slideshow"'.$chk20d.' /></td>
<td><input type="radio" name="CMS_VAR[21]" value="none" id="caption"'.$chk21d.' /></td>
</tr>
</table>
</td>
</tr>';
echo '<tr>
<td valign="top">'.mi18n("Neuerstellung der Bilder (Cache)").':</td>
<td><select name="CMS_VAR[12]"'.$styleThumb.'>';
$sel="";
if ($value12=="0" || $value12=="") $sel=' selected="selected"';
echo '<option value="0"'.$sel.'>'.mi18n("unbegrenzt").'</option>';
$sel="";
if ($value12=="10") $sel=' selected="selected"';
echo '<option value="10"'.$sel.'>'.mi18n("10 Minuten").'</option>';
$sel="";
if ($value12=="60") $sel=' selected="selected"';
echo '<option value="60"'.$sel.'>'.mi18n("1 Stunde").'</option>';
$sel="";
if ($value12=="1440") $sel=' selected="selected"';
echo '<option value="1440"'.$sel.'>'.mi18n("1 Tag").'</option>';
$sel="";
if ($value12=="10080") $sel=' selected="selected"';
echo '<option value="10080"'.$sel.'>'.mi18n("1 Woche").'</option>';
$sel="";
if ($value12=="43200") $sel=' selected="selected"';
echo '<option value="43200"'.$sel.'>'.mi18n("30 Tage").'</option>';
$sel="";
echo '</select></td>
</tr>';
if ($value4!="") {
echo '<tr><td colspan="2"><small>'.mi18n("Die Bilder liegen in einem Cache. Manchmal ist es sinnvoll diese nach einer gewissen Zeit neu zu erstellen.<br/>Bei z.B. Bildergalerien ist dies in aller Regel nur auf Bedarf nötig.").'</small></td></tr>';
echo '<tr>
<td>'.mi18n("gesamten (!!!) Cache loeschen").': </td>
<td><input name="delCache" type="image" src="'.$cfg[path][contenido_fullhtml].'images/delete.gif" onclick="'.$formSubmitOnChange.'" /></td>
</tr>';
}
if ($value4!="" && isset($_POST[delCache])) {
$cachePath=$cfgClient[$client]['path']['frontend'].'/cache';
$allFiles=scandir($cachePath);
foreach ($allFiles as $key => $file) {
if (is_file($pathAllFiles.$file)) unlink($pathAllFiles.$file);
}
}
echo '</table>';
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : Galleriffic
* Author : Andreas Dinkelacker
* Copyright : Andreas Dinkelacker
* Created :
* Version :
* Modifiziert : contenido12 EL
* Created : 16.10.2012
* License : GNU/GPLv2 only (http://www.gnu.org/licenses/gpl-2.0.html#TOC1)
************************************************/
$value0="CMS_VALUE[0]"; //Bilder pro Seite
$value1="CMS_VALUE[1]"; // Breite der Galerie
$value2="CMS_VALUE[2]"; // Bildgroesse
$value3="CMS_VALUE[3]"; // Thumbgroesse
$value4="CMS_VALUE[4]"; // Ordner
$value5="CMS_VALUE[5]"; // eigene Image Groesse
$value6="CMS_VALUE[6]"; // eigene Image Breite
$value7="CMS_VALUE[7]"; // eigene Image Hoehe
$value8="CMS_VALUE[8]"; // eigene Thumb Groesse
$value9="CMS_VALUE[9]"; // eigene Thumb Breite
$value10="CMS_VALUE[10]"; // eigene Thumb Hoehe
$value11="CMS_VALUE[11]"; // Sichtbarkeit inaktiver Bilder
$value12="CMS_VALUE[12]"; // Caching
$value15="CMS_VALUE[15]"; // delete original file after resizing
$value16="CMS_VALUE[16]"; // Anzahl Spalten
$value17="CMS_VALUE[17]"; // Anordnung Navigation und Bild
$value18="CMS_VALUE[18]"; // Ausrichtung der Anzeige
$value19="CMS_VALUE[19]"; // Position Steuerelemente
$value20="CMS_VALUE[20]"; // Position Anzeige
$value21="CMS_VALUE[21]"; // Position Bild-Infobox
$value22="CMS_VALUE[22]"; // Quadratische Thumbs (Seitenverhaeltnis anpassen)
if ($value22!="true") $value22="false";
$value23="CMS_VALUE[23]"; // Delay Zeit für automatischen Wechsel
if ($value23=="") $value23="10000";
// Check if mod_rewrite may be active
if (substr_count($_SERVER[REQUEST_URI],"front_content.php")==0) {
$modRewrite=1;
$modRewriteFiller="?";
$phpSelf=str_replace("?".$_SERVER[QUERY_STRING],"",$_SERVER[REQUEST_URI]);
} else {
$modRewrite=0;
$modRewriteFiller="&";
$idcat=strip_tags($_GET[idcat]);
$idart=strip_tags($_GET[idart]);
$idcatart=strip_tags($_GET[idcatart]);
if ($idcat!="" && $idcat!=0) {
$artCat='idcat='.$idcat;
} elseif ($idart!="" && $idart!=0) {
$artCat='idart='.$idart;
} elseif ($idcatart!="" && $idcatart!=0) {
$artCat='idcatart='.$idcatart;
}
$phpSelf=$_SERVER[PHP_SELF].'?'.$artCat;
}
if ($_GET[filename]!="") {
$fileName=strip_tags($_GET[filename]);
$absPath=$cfgClient[$client]['upload'].$value4.$filename;
$fileSize=@filesize($absPath);
header("Content-type: ".getMime($absPath));
header("Content-Length: ".$fileSize);
header("Content-Disposition: attachment; filename=\"".$fileName."\"");
ob_clean();
flush();
readfile($absPath);
exit();
}
cInclude('classes', 'class.template.php');
$tpl = new Template;
$tpl->reset();
if ($value5!=1) {
$iSize=explode("x",$value2);
// Image height */
$iHeight=$iSize[1];
// Image width
$iWidth=$iSize[0];
} else {
// Image height
$iHeight=$value7;
// Image width
$iWidth=$value6;
}
if ($value8!=1) {
$tSize=explode("x",$value3);
// Thumb height
$tHeight=$tSize[1];
// Thumb width
$tWidth=$tSize[0];
} else {
// Thumb height
$tHeight=$value10;
// Thumb width
$tWidth=$value9;
}
// Set standard width which is set in the site properties.
// Necessary if there is an image which is bigger than this values
// (makes problems on resizing)
$iWidthSettings=$iWidth;
$tWidthSettings=$tWidth;
if ($value16=="A") {
// first calculate image size and thumb sizes to get the correct value
$restWidth=round($value1-$iWidthSettings-10,0);
$numOfThumbs=round($restWidth/($tWidthSettings+6),0);
} elseif ($value16>0) $numOfThumbs=$value16;
elseif ($value16==0) $numOfThumbs=$value0;
if ($value23==10000) $delay=$value23;
$naviWidth=round(($tWidthSettings*$numOfThumbs)+($numOfThumbs*17),0);
/*
The following variables will build the content of the gallery.
The divs must be separated to ensure more layout configuration.
*/
$contentDivStart='<div id="gallery-adv" class="gal_content"><div id="loading-adv" class="loader"></div>';
$contentControlsAdv='<div id="controls-adv" class="controls"></div>';
$contentSlideshowAdv='<div id="slideshow-adv" class="slideshow"></div>';
$contentCaptionAdv='<div id="caption-adv" class="embox"></div>';
$contentDivEnd='</div>';
$checkArr=array();
$allnones=0;
if (!in_array($value19,$checkArr)) if ($value19=="none") $allnones+=1; else array_push($checkArr,$value19);
if (!in_array($value20,$checkArr)) if ($value20=="none") $allnones+=1; else array_push($checkArr,$value20);
if (!in_array($value21,$checkArr)) if ($value21=="none") $allnones+=1; else array_push($checkArr,$value21);
if (sizeof($checkArr)<bcsub(3,$allnones)) $contentDivs=$contentDivStart.$contentControlsAdv.$contentLoadingAdv.$contentSlideshowAdv.$contentCaptionAdv.$contentDivEnd;
else {
$contentDivs=$contentDivStart;
if ($value19=="top") $contentDivs.=$contentControlsAdv;
elseif ($value20=="top") $contentDivs.=$contentSlideshowAdv;
elseif ($value21=="top") $contentDivs.=$contentCaptionAdv;
if ($value19=="middle") $contentDivs.=$contentControlsAdv;
elseif ($value20=="middle") $contentDivs.=$contentSlideshowAdv;
elseif ($value21=="middle") $contentDivs.=$contentCaptionAdv;
if ($value19=="bottom") $contentDivs.=$contentControlsAdv;
elseif ($value20=="bottom") $contentDivs.=$contentSlideshowAdv;
elseif ($value21=="bottom") $contentDivs.=$contentCaptionAdv;
}
/*
Define the alignment of the elements
*/
if ($value17=="lr") {
$naviPos='float:left;position:absolute;';
$contentPos='float:right;';
$galleryAlign='width:'.$value1.'px;position:relative;';
$tpl->set('s','CONTENTTOP',$contentDivs);
$tpl->set('s','CONTENTBOTTOM','');
} elseif ($value17=="rl") {
$naviPos='float:right;position:absolute;margin-left:'.bcadd($iWidth,20,0).'px;';
$contentPos='float:left;';
$galleryAlign='width:'.round($iWidth+10,0).'px;position:relative;';
$tpl->set('s','CONTENTTOP',$contentDivs);
$tpl->set('s','CONTENTBOTTOM','');
} elseif ($value17=="ou") {
$naviPos="width:".$value1."px";
$contentPos="";
$tpl->set('s','CONTENTBOTTOM','<br clear="all"/>'.$contentDivs);
$tpl->set('s','CONTENTTOP','');
$galleryAlign='width:'.round($iWidth+10,0).'px;position:relative;';
$numOfThumbs=substr(round($value1/($tWidth+6),2),0,-3);
echo $numOfThumbs;
} elseif ($value17=="uo") {
$naviPos="width:".$value1."px";
$contentPos="";
$tpl->set('s','CONTENTTOP',$contentDivs);
$tpl->set('s','CONTENTBOTTOM','');
$galleryAlign='width:'.round($iWidth+10,0).'px;position:relative;';
$numOfThumbs=substr(round($value1/($tWidth+6),2),0,-3);
}
if ($value18=="l") {
$galleryAlign.="left:0px;";
} elseif ($value18=="r") {
$galleryAlign.="right:0px;";
} elseif ($value18=="c") {
if ($value17=="uo" || $value17=="ou") {
if ($iWidth>$naviWidth) $thisWidth=round($iWidth+30,0);
else $thisWidth=$naviWidth;
} else $thisWidth=round($iWidth+$naviWidth+30,0);
$galleryAlign='width:'.$thisWidth.'px;position:relative;';
$galleryAlign.="left:50%;margin-left:-".round($thisWidth/2,0)."px;";
}
// Read the images
$fContent=scandir($cfgClient[$client]['upload'].$value4);
$countFiles=0;
foreach ($fContent as $key => $file) {
if (is_file($cfgClient[$client]['upload'].$value4.$file)) {
$fileId=mysql_fetch_assoc(mysql_query("SELECT * FROM ".$cfg[tab][upl]." WHERE filename='".$file."'"));
$fileId=$fileId[idupl];
$fileMeta=mysql_fetch_assoc(mysql_query("SELECT * FROM ".$cfg[tab][upl_meta]." WHERE idupl='".$fileId."'"));
if ($fileMeta[medianame]!="") $medianame=urldecode($fileMeta[medianame]);
else $medianame=$file;
if ($fileMeta[description]!="") $description=urldecode($fileMeta[description]);
else $description="";
$tpl->set('d', 'HREFORIGINAL', $phpSelf.$modRewriteFiller.'filename='.$file);
// Scale image to thumb size and to smaller size
// the next lines are necessary, that if the original file was
// replaced, the file now is resized again
$iWidth=$iWidthSettings;
$scaledThumb=cApiImgScale($cfgClient[$client]['upload'].$value4.$file, $tWidth, $tHeight, false, false, $value12);
// right here the decision is made, whether the thumbs should be quadratic
// or resized within keeping the aspect ratio
if ($value22=="true") {
$scaledThumb=str_replace($cfgClient[$client]['path']['htmlpath'],"",$scaledThumb);
$scaledThumbSize=@getimagesize($scaledThumb);
if ($scaledThumbSize[0]>$scaledThumbSize[1]) {$tmpHeight=$scaledThumbSize[1];$tmpWidth=$scaledThumbSize[1];}
else {$tmpWidth=$scaledThumbSize[0];$tmpHeight=$scaledThumbSize[0];}
$scaledThumb=cApiImgScale($scaledThumb, $tmpWidth, $tmpHeight, true, false, $value12);
}
$scaledImage=cApiImgScale($cfgClient[$client]['upload'].$value4.$file, $iWidth, $iHeight, false, false, $value12);
if ($value15==1) {
$scaledImage=strrchr($scaledImage,"/");
if (unlink($cfgClient[$client]['upload'].$value4.$file) && copy($cfgClient[$client]["path"]["frontend"]."cache".$scaledImage, $cfgClient[$client]["upl"]["path"].$value4.$file)) {
@unlink($cfgClient[$client]["path"]["frontend"]."cache".$scaledImage);
chmod($cfgClient[$client]["upl"]["path"].$value4.$file,0757);
$scaledImage=$cfgClient[$client]["htmlpath"]["frontend"].$cfgClient[$client]['upload'].$value4.$file;
}
}
$imgSize=getimagesize(str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $scaledImage));
if ($imgSize[0]<$iWidth) $iWidth=$imgSize[0];
$file=str_replace("/","",strrchr($scaledImage,"/"));
$tpl->set('d', 'HREFTHUMB', $scaledThumb);
$tpl->set('d', 'HREFRESIZE', $scaledImage);
$tpl->set('d', 'TITLE', $medianame);
$tpl->set('d', 'DOWNLOADORIGINAL', mi18n("Download"));
$tpl->set('d', 'DESCRIPTION', $description);
$tpl->set('s', 'NAVIWIDTH', $naviWidth);
$tpl->set('s', 'CONTENTPOS', $contentPos);
$tpl->set('s', 'CLOSEDIV', $contentDivEnd);
$tpl->set('s', 'NAVIPOS', $naviPos);
$tpl->set('s', 'GALLERYSETTINGS', $galleryAlign);
//$tpl->set('s', 'CONTENTWIDTH', round($iWidth+$naviWidth+50,0).'px');
$tpl->set('s', 'CONTENTWIDTH', $value1.'px');
$tpl->set('s', 'CONTROLWIDTH', $iWidth.'px');
$tpl->next();
$countFiles++;
}
}
$tpl->generate('templates/galleriffic.html');
// finally set the images per site to all images if CMS_VALUE[0] is set to 0
if ($value0==0) $value0=$countFiles;
function getMime($filename) {
$mime_types = array(
// images
'png' => 'image/png',
'jpe' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'jpg' => 'image/jpeg',
'gif' => 'image/gif',
'bmp' => 'image/bmp',
'ico' => 'image/vnd.microsoft.icon',
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
'svg' => 'image/svg+xml',
'svgz' => 'image/svg+xml'
);
$ext = strtolower(array_pop(explode('.',$filename)));
return $mime_types[$ext];
}
?>
<script type="text/javascript">
// Initially set opacity on thumbs and add
// additional styling for hover effect on thumbs
var onMouseOutOpacity = <?php echo $value11; ?>;
$('#thumbs-adv ul.thumbs li').css('opacity', onMouseOutOpacity)
.hover(
function () {
$(this).not('.selected').fadeTo('fast', 5.0);
},
function () {
$(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
}
);
$(document).ready(function() {
// Initialize Advanced Galleriffic Gallery
var galleryAdv = $('#gallery-adv').galleriffic('#thumbs-adv', {
delay: <?php echo $value23; ?>,
numThumbs: <?php echo $value0; ?>,
preloadAhead: <?php echo $value0; ?>,
enableTopPager: true,
enableBottomPager: true,
imageContainerSel: '#slideshow-adv',
controlsContainerSel: '#controls-adv',
captionContainerSel: '#caption-adv',
loadingContainerSel: '#loading-adv',
renderSSControls: true,
renderNavControls: true,
playLinkText: '<?php echo mi18n("Slideshow starten");?>',
pauseLinkText: '<?php echo mi18n("Slideshow anhalten");?>',
prevLinkText: '‹ <?php echo mi18n("Vorheriges Bild");?>',
nextLinkText: '<?php echo mi18n("Nächstes Bild");?> ›',
nextPageLinkText: '›',
prevPageLinkText: '‹',
lastPageLinkText: '»',
firstPageLinkText: '«',
enableHistory: true,
autoStart: true,
onChange: function(prevIndex, nextIndex) {
$('#thumbs-adv ul.thumbs').children()
.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
.eq(nextIndex).fadeTo('fast', 1.0);
},
onTransitionOut: function(callback) {
$('#slideshow-adv, #caption-adv').fadeOut('fast', callback);
},
onTransitionIn: function() {
$('#slideshow-adv, #caption-adv').fadeIn('fast');
},
onPageTransitionOut: function(callback) {
$('#thumbs-adv ul.thumbs').fadeOut('fast', callback);
},
onPageTransitionIn: function() {
$('#thumbs-adv ul.thumbs').fadeIn('fast');
}
});
});
</script>