WebsiteBaker Community Forum
WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: midiweb on February 19, 2009, 01:12:28 PM
-
hi, I've been looking for a script, a snippet, or droplet to display different changing logos of firms but at the same place, as small flash animations. I mean, for instance, a logo stays 2 seconds, another one after 4 seconds, and so on,... Cheers
-
sorry, I've just found the module "Random Image" .I'll try it.
-
There's also a Droplet (http://www.websitebakers.com/pages/admin/admin-tools/droplets.php (http://www.websitebakers.com/pages/admin/admin-tools/droplets.php)) in AMASP
http://www.websitebakers.com/pages/droplets/official-library/images/random-images.php (http://www.websitebakers.com/pages/droplets/official-library/images/random-images.php)
Hans
-
hi, I tried the dropplet Randomimage but it displays one picture in one time. I would like to display all pictures from the folder in turn, alternately, as one loop.Do you know how to do that?
-
http://www.websitebakers.com/pages/modules/image-galleries/smooth-gallery.php (http://www.websitebakers.com/pages/modules/image-galleries/smooth-gallery.php) in a certain configuration.
Hans
-
Maybe not quite what you want out of the box, but with some work you might be able to use http://www.websitebakers.com/pages/modules/image-galleries/slideshow.php
Otherwise you have to use a simple third party image rotator script. There are many javascript ones, and also very neat ajax and jquery scripts with nice effects and options. And Flash ones of course.
-
What have I to change in the dropplet Randomimage to display in a loop without to reload tha page:
$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 src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" width="'.$width.'" height="'.$height.'"/>';
I tried in the index.php with the PHP function
for($i=0;$i < 100;$i++)
{
[[RandomImage?dir=logos]]
';
}
But it displays 100 times the same logo and not the next logo.
Who can help me?
-
You cannot use that, because you need some script function. A droplet has no script. That's why Hans and I suggested two different modules to look at.