FireFlyer
Fri. 5. December 2008, 17:04
Kann mir jemand bei der Frontendausgabe behilflich sein?
CODE
<CMSPHP>
/*************************************************************************
NAME : Pic-Slideshow V1.5
Description : Modul für der-dirigent 00.93.04
Author : sunny
Based on : Pic-Galerie by saschapi / wojewsky / MaZderMind
Create date : 2006-07-24
**************************************************************************/
//global $dedi_db, $db;
print_r($mvars);
################################################################################
##########################################
// Filenamen einlesen
################################################################################
##########################################
$mod["filename_suffix"] = $cfg_client["thumbext"];
$thumb_suffix = $cfg_client["thumbext"];
$mod['galerie_folder'] = "MOD_VALUE[4]";
$mod["pfad"] = $cfg_client["upl_path"]."MOD_VALUE[4]/";
$img_ext = explode(",",$cfg_client["upl_addon"]);
// hier entscheidet sich ob die thumbs oder die orginale verwendet werden
$smallbig = "MOD_VALUE[6]";
$suffix=($smallbig) ? $mod["filename_suffix"] : "";
$mod["file"] = array();
$sql = "SELECT A.*, B.dirname
FROM " . $dedi_db['upl'] . " as A, ". $dedi_db['directory'] ." as B
WHERE
A.iddirectory = ". $mod['galerie_folder'] ."
AND
A.idclient = '$client'
AND
A.iddirectory = B.iddirectory
ORDER BY
A.filename";
$db->query($sql);
while ($db->next_record() ) {
$path_parts = pathinfo($db->f('filename'));
$mod["file"][]=$cfg_client["upl_htmlpath"].$db->f('dirname').basename($db->f('filename'),".".$path_parts["extension"]).$suffix.".".$path_parts["extension"];
}
################################################################################
##########################################
// Slideshow erzeugen
################################################################################
##########################################
//Variablen setzen
$speed = "MOD_VALUE[1]";
$duration = "MOD_VALUE[2]";
$random = "MOD_VALUE[3]";
//Bildernamen shuffeln wenn angekreuzt
if ($random) {
shuffle($mod["file"]);
}
//Ordnet jedem Bild eine Variable pic_X zu
extract ($mod["file"], EXTR_PREFIX_ALL, "pic");
echo "
<img src=\"$pic_0\" id=\"Slideshow\" alt=\"Slideshow\" />
<script type=\"text/javascript\">
<!-- Begin
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = $speed;
// Duration of crossfade (seconds)
var crossFadeDuration = $duration;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below
";
//Array mit Bildernamen an das Javascript übergeben
$hermie = $mod["file"];
echo 'picja=new Array("'.$hermie[0].'"';
for($i=1;$i<count($hermie);$i++){
echo ',"'.$hermie[$i].'"'; }
echo '); anzahl='.count($hermie).';';
echo "
// Pic Array mit Bildernamen füllen
for(i=0;i<anzahl;i++){
Pic[i]=picja[i]+''
}
// do not edit anything below this line
var t;
var j = -1;
var p = Pic.length;
var preLoad = new Array();
var SLimg = document.getElementById('Slideshow');
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if ( window.Initialize) {
Initialize();
}
if (document.all) {
SLimg.style.filter=\"blendTrans(duration=2)\";
SLimg.style.filter=\"blendTrans(duration=crossFadeDuration)\";
SLimg.filters.blendTrans.Apply();
}
j = j + 1;
if (j > (p - 1)) j = 0;
SLimg.src = preLoad[j].src;
if (document.all) {
SLimg.filters.blendTrans.Play();
}
t = setTimeout('runSlideShow()', slideShowSpeed);
}
runSlideShow();
function stopSlideShow(){
clearTimeout(t);
t = 0;
}
function prevPic(){
stopSlideShow();
j = j - 1;
if (j < 0){
j = p - 1;
}
SLimg.src = preLoad[j].src;
}
function nextPic(){
stopSlideShow();
j = j + 1;
if (j > (p-1)) j = 0;
SLimg.src = preLoad[j].src;
}
function firstPic(){
stopSlideShow();
SLimg.src = preLoad[0].src;
j = -1;
}
function lastPic(){
stopSlideShow();
SLimg.src = preLoad[p-1].src;
j = -1;
}
// End -->
</script>
<br/>
";
if ("MOD_VALUE[7]" == "true") {
echo "
<input type=\"button\" value=\"play\" onclick=\"runSlideShow();\" />
<input type=\"button\" value=\"stop\" onclick=\"stopSlideShow();\" />
<input type=\"button\" value=\"prev\" onclick=\"prevPic();\" />
<input type=\"button\" value=\"next\" onclick=\"nextPic();\" />
<input type=\"button\" value=\"first\" onclick=\"firstPic();\" />
<input type=\"button\" value=\"last\" onclick=\"lastPic();\" />
";
}
$template = "MOD_VALUE[15]";
$template = str_replace('{slideshow}', "TEST", $template);
echo $template;
// VARIABLEN LEEREN
unset($size);
unset($mod);
unset($mip_form);
</CMSPHP>
Zum testen lass ich {slideshow} durch TEST ersetzen und es klappt.
Ich möchte statt {slideshow} den Code zum anzeigen ersetzt bekommen, aber wie?