Hattu aber ein Glück
Das Purity nutzt zum Bildwechsel diese Funktion
PHP-Code:
<?php
$img_folder = 'images/stories';
// echo $img_folder ;
// function getRandomImage ($img_folder) {
$imglist=array();
mt_srand((double)microtime()*1000);
//use the directory class
$imgs = dir($img_folder);
//read all files from the directory, checks if are images and ads them to a list (see below how to display flash banners)
while ($file = $imgs->read()) {
if (preg_match("#gif#i", $file) || preg_match("#jpg#i", $file) || preg_match("#png#i", $file))
$imglist[] = $file;
}
closedir($imgs->handle);
if(!count($imglist)) return '';
//generate a random number between 0 and the number of images
$random = mt_rand(0, count($imglist)-1);
$image = $imglist[$random];
// return $image;
echo $img_folder .'/'. $image;
// }
?>
<div id="ja-header" class="clearfix" style="background: url(<?php echo $img_folder .'/'. $image; ?>) no-repeat top right; height: 200px; width: 400px;">Backgimage</div>
Ansonsten kuck auch mal hier
http://www.joomlaportal.de/joomla-te...en-lassen.html
Lesezeichen