Need help with background image slideshow

Ruud

A webserver and PHP code will never rotate your images automatically.
You will need to add some extra javascript logic in there.

There are many solutions for doing that.
Maybe the captionslider module is something for you.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

hep

I already have some "random background" code that pulls random images from a media folder, but I'd like for it to cycle through all of the images in the folder like a slide show, instead of only loading different background images each time the page loads. Any suggestions? Here's the code I currently have:

$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.');
$names = array();
while ($file = readdir($folder))  {
   $ext=strtolower(substr($file,-4));
   if ($ext==".jpg"||$ext==".gif"||$ext==".png"){
      $names[count($names)] = $file;
   }
}
closedir($folder);
shuffle($names);
$image=$names[0];
$name=substr($image,0,-4);
$return_img = 'style="background: transparent url(\''.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'\') no-repeat;"';
return $return_img;